const app = getApp() Page({ data: { popupShow: false, popupType: 'inhibitors', popupParams: {}, recordId: '', period: '', recordDate: '', drugId: '', drugName: '', type: '', dosage: '', dosageUnit: '', unitRange: [ { id: '1', name: 'mg/天', }, { id: '2', name: 'IU/天', }, ], }, onLoad(options) { console.log('DEBUGPRINT[71]: index.ts:29: options=', options) this.setData({ period: options.period, }) app.waitLogin({ type: 1 }).then(() => { this.getDict() if (options.id) { this.getDetail(options.id) } }) }, getDict() { wx.ajax({ method: 'GET', url: '?r=wtx/treatment/get-dict', data: {}, }).then((res) => { console.log('res: ', res) }) }, getDetail(id: string) { wx.ajax({ method: 'GET', url: '?r=wtx/immune/get-detail', data: { recordId: id }, }).then((res) => { this.setData({ ...res, }) }) }, handleDrug() { console.log(111) this.setData({ popupShow: true, popupType: 'inhibitors', popupParams: { close: true, list: [], }, }) }, handlePopupOk() { this.setData({ popupShow: false, }) }, handlePopupCancel() { this.setData({ popupShow: false, }) }, handleSubmit() {}, handleDel() { const { recordId } = this.data wx.ajax({ method: 'GET', url: '?r=wtx/immune/del', data: { recordId }, }).then(() => { this.handleBack() }) }, handleBack() { wx.navigateBack() }, }) export {}