const app = getApp() Page({ data: { popupShow: false, popupType: '', popupParams: { position: 'bottom', } as any, topicShow: false, replayShow: true, fileList: [] as any[], }, onLoad() { app.waitLogin({ type: 0 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data if (popupType === 'argument') { wx.ajax({ method: 'POST', url: '?r=wtx/user/agree-guest-privacy', data: { WorkerId: app.globalData.scene?.workerId || '', }, }).then(() => { this.setData({ popupShow: false, popupType: '', popupParams: {}, }) const waitBindDoctorId = app.globalData.waitBindDoctorId if (waitBindDoctorId) { this.handleBindDoctor(waitBindDoctorId) } }) } if (popupType === 'conformBindDoctorConform') { this.setData({ popupShow: false, }) wx.ajax({ method: 'POST', url: '?r=wtx/account/wait-bind-doctor', data: { doctorId: app.globalData.waitBindDoctorId, }, }).then(() => { wx.navigateTo({ url: `/patient/pages/login/index`, }) }) } }, handlePopupCancel() { const { popupType } = this.data if (popupType === 'argument') { wx.exitMiniProgram() } if (popupType === 'conformBindDoctorConform') { this.setData({ popupShow: false, }) wx.ajax({ method: 'POST', url: '?r=wtx/account/wait-bind-doctor', data: { doctorId: app.globalData.waitBindDoctorId, }, }).then(() => { app.globalData.waitBindDoctorId = '' }) } }, handleWechatWork() { wx.navigateTo({ url: '/pages/wechatWork/index', }) }, handleSetData(e) { const { fileList } = this.data this.setData({ fileList: [...fileList, ...e.detail], }) }, handleDeleteFile(e) { const { index } = e.detail const { fileList } = this.data this.setData({ fileList: fileList.filter((_, i) => i !== index), }) }, topicClose() { this.setData({ topicShow: false, }) }, }) export {}