武田小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.4 KiB

8 months ago
const app = getApp<IAppOption>();
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 {};