const app = getApp() Component({ properties: { did: { type: String, value: '', }, }, data: { show: false, doctorInfo: {}, imageUrl: app.globalData.imageUrl, Timestamp: app.globalData.Timestamp, }, methods: { handleShow() { wx.ajax({ method: 'GET', url: '?r=wtx/doctor/get-info', data: { doctorId: this.data.did, }, }).then((res) => { this.setData({ doctorInfo: res, show: true, }) }) }, handleCancel() { this.setData({ show: false, }) }, handleUnbind() { const { did } = this.data wx.showModal({ title: '确认解绑?', confirmColor: 'rgba(246, 74, 58, 1)', success: (res) => { if (res.confirm) { wx.ajax({ method: 'POST', url: '?r=wtx/account/unbind-doctor', data: { doctorId: did, }, }).then(() => { wx.showToast({ title: '解绑成功', icon: 'none', }) this.setData({ show: false, }) this.triggerEvent('update') }) } }, }) }, }, })