const app = getApp(); Page({ data: { showDetail: false, popupDoctorDetail: {}, Search: "", list: [], DoctorId: "", DoctorName: "", }, onLoad() { app.waitLogin().then(() => { this.getList(); }); }, handleSearch() { this.setData({ list: [], }); this.getList(); }, handleReset() { this.setData({ Search: "", }); this.handleSearch(); }, getList() { const { Search } = this.data; wx.ajax({ method: "GET", url: "?r=takeda/reg/second-doctor-list", data: { Search, }, }).then((res) => { this.setData({ list: res.list, }); }); }, handlePopupClose() { this.setData({ showDetail: false, }); }, handleRadio(e: any) { const { index } = e.currentTarget.dataset; const { list } = this.data; this.setData({ DoctorId: (list as any)[index].DoctorId, DoctorName: (list as any)[index].DoctorName, }); }, handleResolve() { const { DoctorId, DoctorName } = this.data; if (!DoctorId) { wx.showToast({ title: "请选择医生", icon: "none", }); return; } const eventChannel = this.getOpenerEventChannel(); eventChannel.emit("acceptDataFromOpenedPage", { DoctorId, DoctorName }); this.handleBack() }, handleBack() { wx.navigateBack(); }, }); export {};