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

8
src/pages/d_interactiveDoctor/index.ts

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

1
src/pages/d_invite/index.ts

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

8
src/pages/d_patient/index.ts

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

9
src/pages/d_patientDetail/index.ts

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

4
src/pages/d_userInfo/index.ts

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

29
src/pages/home/index.ts

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

4
src/pages/home/index.wxml

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

67
src/pages/information/index.ts

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

82
src/pages/informationDetail/index.ts

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

7
src/pages/login/index.ts

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

3
src/pages/my/index.ts

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

Loading…
Cancel
Save