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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save