Browse Source

feat: 添加页面和按钮的行为追踪代码

dev
kola-web 1 day ago
parent
commit
d31fca2942
  1. 6
      src/patient/pages/doctor/index.ts
  2. 6
      src/patient/pages/hormones/index.ts
  3. 3
      src/patient/pages/hormonesResult/index.ts
  4. 3
      src/patient/pages/hormonesStart/index.ts
  5. 7
      src/patient/pages/hospital/index.ts
  6. 5
      src/patient/pages/qol/index.ts
  7. 2
      src/patient/pages/qolAdd/index.ts
  8. 10
      src/patient/pages/qolReport/index.ts
  9. 2
      src/patient/pages/qolResult/index.ts

6
src/patient/pages/doctor/index.ts

@ -54,6 +54,9 @@ Page({ @@ -54,6 +54,9 @@ Page({
this.getConfig(options)
})
},
onShow() {
app.mpBehavior({ PageName: 'PG_HospitalMap' })
},
getConfig(options) {
wx.ajax({
method: 'GET',
@ -303,12 +306,14 @@ Page({ @@ -303,12 +306,14 @@ Page({
}).then((_res) => {})
},
handleDetail(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_HospitalMapListItem' })
const { url } = e.currentTarget.dataset
wx.navigateTo({
url,
})
},
handleOpenMap(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_HospitalMapNavigate' })
const { lat, lng, name, address } = e.currentTarget.dataset
wx.openLocation({
latitude: lat * 1,
@ -331,6 +336,7 @@ Page({ @@ -331,6 +336,7 @@ Page({
})
},
handleDtpPhone(e: any) {
app.mpBehavior({ PageName: 'BTN_HospitalMapPhone' })
const { tel } = e.currentTarget.dataset
if (!tel) {
wx.showToast({

6
src/patient/pages/hormones/index.ts

@ -95,6 +95,7 @@ Page({ @@ -95,6 +95,7 @@ Page({
},
onLoad(options) {
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_HormonesAdd' })
this.getBaseInfo()
if (Number(options.id) > 0) {
wx.showToast({
@ -167,6 +168,10 @@ Page({ @@ -167,6 +168,10 @@ Page({
const { key, value, custom } = e.currentTarget.dataset
const { nav } = this.data
if (key === 'medicationMethod') {
app.mpBehavior({ PageName: 'BTN_HormonesAddMethod' })
}
if (key === 'medicationMethod' && value !== this.data.form.medicationMethod) {
this.setData({
'form.dosage': '',
@ -247,6 +252,7 @@ Page({ @@ -247,6 +252,7 @@ Page({
this.handlePopupCancel()
},
handleSubmit() {
app.mpBehavior({ PageName: 'BTN_HormonesAddSubmit' })
const { id, form, question } = this.data
wx.ajax({
method: 'POST',

3
src/patient/pages/hormonesResult/index.ts

@ -17,6 +17,7 @@ Page({ @@ -17,6 +17,7 @@ Page({
report: options.report == '1',
})
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_HormonesResult' })
this.getPicText(options.medicationMethod)
})
},
@ -32,11 +33,13 @@ Page({ @@ -32,11 +33,13 @@ Page({
})
},
handleReport() {
app.mpBehavior({ PageName: 'BTN_HormonesResultReport' })
wx.redirectTo({
url: '/patient/pages/qolReport/index?scrollId=proit-hormone',
})
},
handlePic() {
app.mpBehavior({ PageName: 'BTN_HormonesResultPicText' })
wx.navigateTo({
url: `/patient/pages/repositoryDetail/index?id=${this.data.picText.picTextId}`,
})

3
src/patient/pages/hormonesStart/index.ts

@ -6,6 +6,7 @@ Page({ @@ -6,6 +6,7 @@ Page({
},
onLoad(options) {
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_HormonesStart' })
if (options.id) {
this.setData({
id: options.id,
@ -14,11 +15,13 @@ Page({ @@ -14,11 +15,13 @@ Page({
})
},
handleAdd() {
app.mpBehavior({ PageName: 'BTN_HormonesStartAdd' })
wx.redirectTo({
url: `/patient/pages/hormones/index?id=${this.data.id}`,
})
},
handleReport() {
app.mpBehavior({ PageName: 'BTN_HormonesStartReport' })
wx.navigateTo({
url: `/patient/pages/qolReport/index?scrollId=proit-hormone`,
})

7
src/patient/pages/hospital/index.ts

@ -27,6 +27,9 @@ Page({ @@ -27,6 +27,9 @@ Page({
this.handleToggleSite()
})
},
onShow() {
app.mpBehavior({ PageName: 'PG_HospitalDetail' })
},
handleToggleSite() {
if (!this.data.LNG) {
wx.getSetting({
@ -148,12 +151,14 @@ Page({ @@ -148,12 +151,14 @@ Page({
})
},
handlePhone() {
app.mpBehavior({ PageName: 'BTN_HospitalDetailPhone' })
const { detail } = this.data
wx.makePhoneCall({
phoneNumber: detail.Telephone,
})
},
handleOpenMap() {
app.mpBehavior({ PageName: 'BTN_HospitalDetailNavigate' })
const { detail } = this.data
wx.openLocation({
latitude: detail.LAT,
@ -187,12 +192,14 @@ Page({ @@ -187,12 +192,14 @@ Page({
})
},
routerTo(e) {
app.mpBehavior({ PageName: 'BTN_HospitalDetailDoctorCard' })
const { url } = e.currentTarget.dataset
wx.navigateTo({
url,
})
},
handleMedical() {
app.mpBehavior({ PageName: 'BTN_HospitalDetailMedical' })
wx.navigateTo({
url: `/patient/pages/medicalDetail/index?id=${this.data.detail.hospitalPolicyId}`,
})

5
src/patient/pages/qol/index.ts

@ -13,9 +13,12 @@ Page({ @@ -13,9 +13,12 @@ Page({
showMsg: false,
})
}
app.waitLogin({ type: [1] }).then(() => {})
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_QolHome' })
})
},
handleAdd() {
app.mpBehavior({ PageName: 'BTN_QolHomeAdd' })
wx.navigateTo({
url: '/patient/pages/qolAdd/index',
})

2
src/patient/pages/qolAdd/index.ts

@ -165,6 +165,7 @@ Page({ @@ -165,6 +165,7 @@ Page({
edit: options.edit == '1',
})
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_QolAdd' })
if (options.id) {
this.getDetail()
}
@ -230,6 +231,7 @@ Page({ @@ -230,6 +231,7 @@ Page({
})
},
handleSubmit() {
app.mpBehavior({ PageName: 'BTN_QolAddSubmit' })
const { qolList0, qolList1, edit, id } = this.data
const arr = [...qolList0, ...qolList1]
const form = {}

10
src/patient/pages/qolReport/index.ts

@ -46,6 +46,7 @@ Page({ @@ -46,6 +46,7 @@ Page({
this.chartComponent6 = this.selectComponent('#chart6')
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_QolReport' })
this.handleChangeType()
this.getList()
this.getQol()
@ -102,9 +103,12 @@ Page({ @@ -102,9 +103,12 @@ Page({
.exec()
},
handleChangeType(e?: WechatMiniprogram.CustomEvent) {
if (e) {
app.mpBehavior({ PageName: 'BTN_QolReportTab' })
}
let type = ''
if (e) {
// Tab 已移除“日”,现仅有“月度/年度”
// Tab 已移除"日",现仅有"月度/年度"
type = e.detail.index === 0 ? '2' : '3'
}
else {
@ -533,6 +537,7 @@ Page({ @@ -533,6 +537,7 @@ Page({
}
},
handleDelete(e) {
app.mpBehavior({ PageName: 'BTN_QolReportDelete' })
const { id, index } = e.currentTarget.dataset
const { list } = this.data
wx.showModal({
@ -556,12 +561,14 @@ Page({ @@ -556,12 +561,14 @@ Page({
})
},
handleDetail(e) {
app.mpBehavior({ PageName: 'BTN_QolReportListItem' })
const { id, edit } = e.currentTarget.dataset
wx.navigateTo({
url: `/patient/pages/qolAdd/index?id=${id}&edit=${edit ? 1 : 0}`,
})
},
handleQol() {
app.mpBehavior({ PageName: 'BTN_QolReportAdd' })
this.handleHideFooterBtn()
const { qolDetail } = this.data
const url
@ -599,6 +606,7 @@ Page({ @@ -599,6 +606,7 @@ Page({
})
},
handleHormones() {
app.mpBehavior({ PageName: 'BTN_QolReportHormone' })
const hormoneDetail = this.data.hormoneDetail
this.handleHideFooterBtn()
const url = hormoneDetail.recordId

2
src/patient/pages/qolResult/index.ts

@ -16,6 +16,7 @@ Page({ @@ -16,6 +16,7 @@ Page({
id: options.id,
})
app.waitLogin({ type: [1] }).then(() => {
app.mpBehavior({ PageName: 'PG_QolResult' })
this.getDetail()
this.getToast()
})
@ -54,6 +55,7 @@ Page({ @@ -54,6 +55,7 @@ Page({
})
},
handleReport() {
app.mpBehavior({ PageName: 'BTN_QolResultReport' })
wx.navigateTo({
url: '/patient/pages/qolReport/index',
})

Loading…
Cancel
Save