Browse Source

医生端埋点

dev
kola-web 2 weeks ago
parent
commit
6339491e8e
  1. 62
      src/pages/d_interactive/index.ts
  2. 8
      src/pages/d_interactiveDoctor/index.ts
  3. 1
      src/pages/d_invite/index.ts
  4. 8
      src/pages/d_patient/index.ts
  5. 9
      src/pages/d_patientDetail/index.ts
  6. 4
      src/pages/d_userInfo/index.ts
  7. 29
      src/pages/home/index.ts
  8. 4
      src/pages/home/index.wxml
  9. 67
      src/pages/information/index.ts
  10. 82
      src/pages/informationDetail/index.ts
  11. 7
      src/pages/login/index.ts
  12. 3
      src/pages/my/index.ts

62
src/pages/d_interactive/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
const app = getApp<IAppOption>();
const app = getApp<IAppOption>()
Page({
data: {
@ -14,11 +14,12 @@ Page({ @@ -14,11 +14,12 @@ Page({
},
onShow() {
app.waitLogin({ type: [2] }).then((_res) => {
this.getList();
});
app.mpBehavior({ PageName: 'PG_DoctorIMList' })
this.getList()
})
},
handleTapSearch() {
app.mpBehavior({ PageName: 'BTN_DoctorIMListSearch' })
},
handleSearch() {
this.setData({
@ -28,26 +29,23 @@ Page({ @@ -28,26 +29,23 @@ Page({
pages: 1,
count: 1,
},
});
this.getList();
})
this.getList()
},
handleNav(e) {
const { active } = e.currentTarget.dataset;
const { active } = e.currentTarget.dataset
this.setData({
active,
});
this.getList();
})
this.getList()
},
getList(newPage = 1) {
const { active } = this.data;
const { active } = this.data
if (active == '' && newPage == 1) {
}
if (active == '1' && newPage == 1) {
}
if (active == '2' && newPage == 1) {
}
wx.ajax({
method: 'GET',
@ -58,7 +56,7 @@ Page({ @@ -58,7 +56,7 @@ Page({
readStatus: this.data.active,
},
}).then((res) => {
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]
this.setData({
list,
unReadCount: res.unReadCount,
@ -67,31 +65,31 @@ Page({ @@ -67,31 +65,31 @@ Page({
pages: res.pages,
count: res.count,
},
});
});
})
})
},
onReachBottom() {
const { page, pages } = this.data.pagination;
const { page, pages } = this.data.pagination
if (pages > page) {
this.getList(page + 1);
this.getList(page + 1)
}
},
handleDetail(e) {
const { index } = e.currentTarget.dataset;
const { list } = this.data;
const listItem: any = list[index];
app.mpBehavior({ PageName: 'BTN_DoctorIMList' })
const { index } = e.currentTarget.dataset
const { list } = this.data
const listItem: any = list[index]
wx.navigateTo({
url: `/pages/d_interactiveDoctor/index?patientId=${listItem.patientId}`,
});
})
},
hancleClaer() {
if (Number(this.data.unReadCount) === 0) {
wx.showToast({
title: '暂无未读消息',
icon: 'none',
});
return;
})
return
}
wx.showModal({
title: '提示',
@ -110,14 +108,14 @@ Page({ @@ -110,14 +108,14 @@ Page({
return {
...item,
msgReadStatus: '1',
};
}
}),
});
const header = this.selectComponent('#tabbar');
header.getList(); //子组件的方法
});
})
const header = this.selectComponent('#tabbar')
header.getList() //子组件的方法
})
}
},
});
})
},
});
})

8
src/pages/d_interactiveDoctor/index.ts

@ -54,7 +54,7 @@ Page({ @@ -54,7 +54,7 @@ Page({
},
onShow() {
app.waitLogin({ type: [2] }).then((_res) => {
app.mpBehavior({ PageName: 'PG_DoctorIMDetail' })
this.getDoctorDetail()
this.getPatientDetail()
this.getMessageList()
@ -168,7 +168,7 @@ Page({ @@ -168,7 +168,7 @@ Page({
})
},
handleSendDate() {
app.mpBehavior({ PageName: 'BTN_DoctorIMDetailClinicHours' })
const {
messageList,
doctor: { Clinic },
@ -223,7 +223,7 @@ Page({ @@ -223,7 +223,7 @@ Page({
})
},
handleSendShow() {
app.mpBehavior({ PageName: 'BTN_DoctorIMDetailSendMessage' })
this.setData({
messageListShow: true,
})
@ -360,7 +360,7 @@ Page({ @@ -360,7 +360,7 @@ Page({
})
},
handlePatientDetail() {
app.mpBehavior({ PageName: 'BTN_DoctorIMDetailPatient' })
wx.navigateTo({
url: `/pages/d_patientDetail/index?id=${this.data.patientId}`,
})

1
src/pages/d_invite/index.ts

@ -18,6 +18,7 @@ Page({ @@ -18,6 +18,7 @@ Page({
})
}
app.waitLogin().then((_res) => {
app.mpBehavior({ PageName: 'PG_DoctorCode' })
wx.showLoading({
title: '加载中',
})

8
src/pages/d_patient/index.ts

@ -59,7 +59,7 @@ Page({ @@ -59,7 +59,7 @@ Page({
},
onShow() {
app.waitLogin().then((_res) => {
app.mpBehavior({ PageName: 'PG_DoctorPatientList' })
this.getList()
app.getUserInfo(2).then((userInfo) => {
this.setData({
@ -99,7 +99,7 @@ Page({ @@ -99,7 +99,7 @@ Page({
this.getList()
},
handleTapSearch() {
app.mpBehavior({ PageName: 'BTN_DoctorPatientListSearch' })
},
handleNav(e) {
const { active } = e.currentTarget.dataset
@ -185,7 +185,7 @@ Page({ @@ -185,7 +185,7 @@ Page({
})
},
handleDetail(e: any) {
app.mpBehavior({ PageName: 'BTN_DoctorPatientList' })
const { index } = e.currentTarget.dataset
const item = this.data.list[index]
@ -194,13 +194,13 @@ Page({ @@ -194,13 +194,13 @@ Page({
})
},
handleSend(e) {
app.mpBehavior({ PageName: 'BTN_DoctorPatientListSendMessage' })
const { index } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/d_interactiveDoctor/index?patientId=${this.data.list[index].PatientId}`,
})
},
handleSendGroup() {
wx.navigateTo({
url: '/pages/d_taskList/index',
})

9
src/pages/d_patientDetail/index.ts

@ -167,7 +167,7 @@ Page({ @@ -167,7 +167,7 @@ Page({
})
app.waitLogin({ type: [2] }).then(async (_res) => {
app.mpBehavior({ PageName: 'PG_DoctorPatientDetail' })
this.getDoctorDetail()
await this.getDetail()
app.getUserInfo(2).then((userInfo) => {
@ -887,7 +887,6 @@ Page({ @@ -887,7 +887,6 @@ Page({
})
},
handleRemark() {
this.setData({
popupRemarkShow: true,
remark: this.data.detail.DoctorRemark,
@ -926,7 +925,6 @@ Page({ @@ -926,7 +925,6 @@ Page({
},
handleEditUser() {
this.setData({
popupEditShow: true,
})
@ -971,7 +969,7 @@ Page({ @@ -971,7 +969,7 @@ Page({
wx.navigateBack()
},
handleSend() {
app.mpBehavior({ PageName: 'BTN_DoctorPatientDetailSendMessage' })
wx.navigateTo({
url: `/pages/d_interactiveDoctor/index?patientId=${this.data.detail.PatientId}`,
})
@ -980,10 +978,8 @@ Page({ @@ -980,10 +978,8 @@ Page({
handleNav(e, mp = true) {
const { index } = e.currentTarget.dataset
if (index == 0 && mp) {
}
if (index == 1 && mp) {
}
this.setData({
nav: index,
@ -1057,6 +1053,7 @@ Page({ @@ -1057,6 +1053,7 @@ Page({
})
},
handleEDC() {
app.mpBehavior({ PageName: 'BTN_DoctorPatientDetailEDC' })
wx.ajax({
method: 'POST',
url: '?r=zd/doctor/patient/set-edc',

4
src/pages/d_userInfo/index.ts

@ -57,7 +57,7 @@ Page({ @@ -57,7 +57,7 @@ Page({
onLoad() {},
onShow() {
app.waitLogin({ type: [2] }).then((_res) => {
app.mpBehavior({ PageName: 'PG_DoctorInfoDetails' })
this.getDetail()
})
},
@ -120,7 +120,6 @@ Page({ @@ -120,7 +120,6 @@ Page({
this.handleWeekIntroduceSubmit()
},
handleChangePhone() {
wx.navigateTo({
url: '/doctor/pages/d_changePhone/index',
})
@ -201,7 +200,6 @@ Page({ @@ -201,7 +200,6 @@ Page({
this.getDetail()
},
handleSwitch() {
wx.navigateTo({
url: '/doctor/pages/d_changeDoctor/index',
})

29
src/pages/home/index.ts

@ -15,7 +15,7 @@ Page({ @@ -15,7 +15,7 @@ Page({
close: true,
} as any,
userInfo: {},
userInfo: {} as any,
current: 0,
stat: {},
@ -41,17 +41,21 @@ Page({ @@ -41,17 +41,21 @@ Page({
},
onShow() {
app.waitLogin({ type: [2] }).then(() => {
app.mpBehavior({ PageName: 'PG_DoctorHome' })
this.getNotice()
this.getBanner()
this.getBriefingList()
this.getSopList()
this.getList()
this.getStat()
app.getUserInfo(2).then((userInfo) => {
app.getUserInfo(2).then((userInfo: any) => {
this.setData({
userInfo,
})
this.getTab()
this.getBriefingList()
this.getSopList()
if (userInfo.IsEDC === '1') {
app.mpBehavior({ PageName: 'PG_DoctorHomeNotice' })
}
})
})
},
@ -119,6 +123,7 @@ Page({ @@ -119,6 +123,7 @@ Page({
})
},
handleNoticeDetail(e) {
app.mpBehavior({ PageName: 'BTN_DoctorHomeNotice' })
const { index } = e.currentTarget.dataset
const { Id, Url } = this.data.notice[index]
app.oldMpBehavior({ PositionId: '4', OperateType: '1', OperateId: Id })
@ -187,6 +192,9 @@ Page({ @@ -187,6 +192,9 @@ Page({
this.setData({
briefingList: res.list,
})
if (res.list.length && this.data.userInfo.IsEDC === '1') {
app.mpBehavior({ PageName: 'PG_DoctorHomeBrief' })
}
})
},
getSopList() {
@ -204,6 +212,9 @@ Page({ @@ -204,6 +212,9 @@ Page({
this.setData({
sopList: res.list,
})
if (res.list.length && this.data.userInfo.IsEDC === '1') {
app.mpBehavior({ PageName: 'PG_DoctorHomeSop' })
}
})
},
getList() {
@ -222,15 +233,20 @@ Page({ @@ -222,15 +233,20 @@ Page({
this.setData({
list: res.list,
})
if (res.list.length) {
app.mpBehavior({ PageName: 'PG_DoctorHomeLibrary' })
}
})
},
handleBriefingDetail(e: any) {
app.mpBehavior({ PageName: 'BTN_DoctorHomeBrief' })
const { id } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/informationDetail/index?id=${id}`,
})
},
handleSop(e) {
app.mpBehavior({ PageName: 'BTN_DoctorHomeSop' })
const { index } = e.currentTarget.dataset
const { Id, FileList } = this.data.sopList[index]
const params: any = FileList[0]
@ -245,6 +261,7 @@ Page({ @@ -245,6 +261,7 @@ Page({
this.handleFile(params)
},
handleDetail(e: any) {
app.mpBehavior({ PageName: 'BTN_DoctorHomeLibrary' })
const { id, index } = e.currentTarget.dataset
const params = this.data.list[index]
if (params.ContentType === '5' && params.FileList[0]) {
@ -327,6 +344,10 @@ Page({ @@ -327,6 +344,10 @@ Page({
popupShow: false,
})
},
handleMpBehavior(e) {
const { code } = e.currentTarget.dataset
app.mpBehavior({ PageName: code })
},
onShareAppMessage(e) {
if (e.from === 'button') {
const { Title, CoverImgUrl, Id } = e.target.dataset.params

4
src/pages/home/index.wxml

@ -148,7 +148,7 @@ @@ -148,7 +148,7 @@
<view class="title">统计数据截止到昨天 <text class="sub">每天00:05更新</text></view>
</view>
<view class="s-container">
<view class="card">
<view class="card" bind:tap="handleMpBehavior" data-code="BTN_DoctorHomeTotalPatient">
<image class="icon" src="{{imageUrl}}icon52.png?t={{Timestamp}}"></image>
<view class="content">
<view class="text">
@ -161,7 +161,7 @@ @@ -161,7 +161,7 @@
</view>
</view>
</view>
<view class="card">
<view class="card" bind:tap="handleMpBehavior" data-code="BTN_DoctorHomeNewPatient">
<image class="icon" src="{{imageUrl}}icon53.png?t={{Timestamp}}"></image>
<view class="content">
<view class="text">

67
src/pages/information/index.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import dayjs from 'dayjs';
import dayjs from 'dayjs'
const app = getApp<IAppOption>();
const app = getApp<IAppOption>()
Page({
data: {
@ -22,8 +22,9 @@ Page({ @@ -22,8 +22,9 @@ Page({
},
onShow() {
app.waitLogin({ type: [2] }).then(() => {
this.getList();
});
app.mpBehavior({ PageName: 'PG_LibraryList' })
this.getList()
})
},
getList(newPage = 1) {
wx.ajax({
@ -35,10 +36,10 @@ Page({ @@ -35,10 +36,10 @@ Page({
},
}).then((res) => {
res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
item.FileType = item.FileList[0]?.FileType || '';
});
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD')
item.FileType = item.FileList[0]?.FileType || ''
})
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]
this.setData({
total: res.count,
list,
@ -47,25 +48,26 @@ Page({ @@ -47,25 +48,26 @@ Page({
pages: res.pages,
count: res.count,
},
});
});
})
})
},
onReachBottom() {
const { page, pages } = this.data.pagination;
const { page, pages } = this.data.pagination
if (pages > page) {
this.getList(page + 1);
this.getList(page + 1)
}
},
handleDetail(e) {
const { id, index } = e.currentTarget.dataset;
const params = this.data.list[index];
app.mpBehavior({ PageName: 'BTN_LibraryListContent' })
const { id, index } = e.currentTarget.dataset
const params = this.data.list[index]
if (params.ContentType === '5' && params.FileList[0]) {
app.oldMpBehavior({ PositionId: '1', OperateType: '1', OperateId: id as string });
this.handleFile(params.FileList[0]);
app.oldMpBehavior({ PositionId: '1', OperateType: '1', OperateId: id as string })
this.handleFile(params.FileList[0])
} else {
wx.navigateTo({
url: `/pages/informationDetail/index?id=${id}`,
});
})
}
},
handleFile({ FileUrl, FileName }) {
@ -78,45 +80,46 @@ Page({ @@ -78,45 +80,46 @@ Page({
showMenu: false,
filePath: res.filePath,
success: () => {
wx.hideLoading();
wx.hideLoading()
},
fail: () => {
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
wx.hideLoading();
})
wx.hideLoading()
},
});
})
} else {
wx.hideLoading();
wx.hideLoading()
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
})
}
},
fail() {
wx.hideLoading();
wx.hideLoading()
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
})
},
});
})
},
onShareAppMessage(e) {
if (e.from === 'button') {
const { Title, CoverImgUrl, Id } = e.target.dataset.params;
app.oldMpBehavior({ PositionId: '2', OperateType: '3', OperateId: Id });
app.mpBehavior({ PageName: 'BTN_LibraryListShare' })
const { Title, CoverImgUrl, Id } = e.target.dataset.params
app.oldMpBehavior({ PositionId: '2', OperateType: '3', OperateId: Id })
return {
title: Title,
path: `/pages/informationDetail/index?id=${Id}`,
imageUrl: CoverImgUrl,
};
}
return {};
}
return {}
},
});
})
export {};
export {}

82
src/pages/informationDetail/index.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import dayjs from 'dayjs';
import dayjs from 'dayjs'
const app = getApp<IAppOption>();
const app = getApp<IAppOption>()
Page({
data: {
@ -38,11 +38,12 @@ Page({ @@ -38,11 +38,12 @@ Page({
onLoad(options) {
this.setData({
id: options.id,
});
})
app.waitLogin({ type: [2] }).then(() => {
app.oldMpBehavior({ PositionId: '1', OperateType: '1', OperateId: options.id as string });
this.getDetail();
});
app.mpBehavior({ PageName: 'PG_LibraryDetails' })
app.oldMpBehavior({ PositionId: '1', OperateType: '1', OperateId: options.id as string })
this.getDetail()
})
},
getDetail() {
wx.ajax({
@ -55,11 +56,11 @@ Page({ @@ -55,11 +56,11 @@ Page({
})
.then((res) => {
if (res.ContentType == '4') {
wx.hideShareMenu();
wx.offCopyUrl();
wx.hideShareMenu()
wx.offCopyUrl()
wx.setNavigationBarTitle({
title: '通知详情页',
});
})
}
this.setData({
pageShow: true,
@ -68,23 +69,23 @@ Page({ @@ -68,23 +69,23 @@ Page({
PublishTime: dayjs(res.PublishTime).format('YYYY-MM-DD'),
},
showShare: res.ContentType !== '4',
});
})
})
.catch((err) => {
const { errorCode, errorMsg } = err.data.data;
const empty1 = errorCode === '1';
const empty2 = errorCode === '2';
const { errorCode, errorMsg } = err.data.data
const empty1 = errorCode === '1'
const empty2 = errorCode === '2'
this.setData({
pageShow: false,
errorMsg,
empty1,
empty2,
empty3: !empty1 && !empty2,
});
});
})
})
},
handlePopup(e) {
const { index } = e.currentTarget.dataset;
const { index } = e.currentTarget.dataset
this.setData({
popupShow: true,
popupType: 'popup5',
@ -92,31 +93,31 @@ Page({ @@ -92,31 +93,31 @@ Page({
position: 'bottom',
index,
},
});
})
},
handlePopupOk() {
const { popupType } = this.data;
const { popupType } = this.data
if (popupType === 'popup5') {
this.handleDownload();
this.handlePopupCancel();
this.handleDownload()
this.handlePopupCancel()
}
},
handlePopupCancel() {
this.setData({
popupShow: false,
});
})
},
handleDownload() {
const {
detail,
popupParams: { index },
} = this.data;
const params = detail.FileList[index];
} = this.data
const params = detail.FileList[index]
wx.showLoading({
title: '加载中',
mask: true,
});
app.oldMpBehavior({ PositionId: '1', OperateType: '2', OperateId: detail.Id as string });
})
app.oldMpBehavior({ PositionId: '1', OperateType: '2', OperateId: detail.Id as string })
wx.downloadFile({
url: params.FileUrl,
filePath: `${wx.env.USER_DATA_PATH}/${params.FileName}`,
@ -126,48 +127,49 @@ Page({ @@ -126,48 +127,49 @@ Page({
showMenu: true,
filePath: res.filePath,
success: () => {
wx.hideLoading();
wx.hideLoading()
},
fail: (err) => {
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
wx.hideLoading();
})
wx.hideLoading()
},
});
})
} else {
wx.hideLoading();
wx.hideLoading()
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
})
}
},
fail(err) {
wx.hideLoading();
wx.hideLoading()
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
})
},
});
})
},
handleBackHome() {
wx.reLaunch({
url: '/pages/home/index',
});
})
},
onShareAppMessage() {
const { Title, CoverImgUrl, Id } = this.data.detail;
app.oldMpBehavior({ PositionId: '1', OperateType: '3', OperateId: Id as string });
app.mpBehavior({ PageName: 'BTN_LibraryDetailsShare' })
const { Title, CoverImgUrl, Id } = this.data.detail
app.oldMpBehavior({ PositionId: '1', OperateType: '3', OperateId: Id as string })
return {
title: Title,
path: `/pages/informationDetail/index?id=${Id}`,
imageUrl: CoverImgUrl,
};
}
},
});
})
export {};
export {}

7
src/pages/login/index.ts

@ -23,6 +23,9 @@ Page({ @@ -23,6 +23,9 @@ Page({
this.setData({
back: options.back,
})
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_DoctorLogin' })
})
},
getCode() {
if (timer) return
@ -70,11 +73,13 @@ Page({ @@ -70,11 +73,13 @@ Page({
})
},
handleCheck() {
app.mpBehavior({ PageName: 'BTN_DoctorPrivacyAgree' })
this.setData({
check1: !this.data.check1,
})
},
handleDocRule() {
app.mpBehavior({ PageName: 'BTN_DoctorLogin' })
const { check1 } = this.data
return new Promise((resolve) => {
if (check1) {
@ -127,6 +132,7 @@ Page({ @@ -127,6 +132,7 @@ Page({
})
},
handleWxSubmit(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_DoctorQuickLogin' })
const { iv, encryptedData } = e.detail
if (iv && encryptedData) {
wx.ajax({
@ -181,6 +187,7 @@ Page({ @@ -181,6 +187,7 @@ Page({
})
},
handleShowPopup() {
app.mpBehavior({ PageName: 'PG_DoctorLoginFail' })
this.setData({
popupShow: true,
popupType: 'popup4',

3
src/pages/my/index.ts

@ -15,6 +15,7 @@ Page({ @@ -15,6 +15,7 @@ Page({
},
onShow() {
app.waitLogin({ type: [2] }).then(() => {
app.mpBehavior({ PageName: 'PG_DoctorPersonalCenter' })
this.getUserInfo()
})
},
@ -119,6 +120,7 @@ Page({ @@ -119,6 +120,7 @@ Page({
})
},
handleUserInfo() {
app.mpBehavior({ PageName: 'BTN_DoctorPersonalCenterInfo' })
wx.navigateTo({
url: '/pages/d_userInfo/index',
})
@ -129,6 +131,7 @@ Page({ @@ -129,6 +131,7 @@ Page({
})
},
handleInvite() {
app.mpBehavior({ PageName: 'BTN_DoctorPersonalCenterCode' })
wx.navigateTo({
url: '/pages/d_invite/index',
})

Loading…
Cancel
Save