const app = getApp(); Page({ data: { id: "", detail: {} as any, }, onLoad(options) { this.setData({ id: options.id, }); app.waitLogin().then(() => { this.getDetail(); }); }, getDetail() { wx.ajax({ method: "GET", url: "?r=zd/dtp-pharmacy/detail", data: { Id: this.data.id, }, }).then((res) => { this.setData({ detail: res, }); }); }, handleSite() { const { LNG, LAT, ProvinceName, CityName, CountyName, Address, Name } = this.data.detail; wx.openLocation({ latitude: LAT, longitude: LNG, name: Name, address: `${ProvinceName}${CityName}${CountyName}${Address}`, }); }, handlePhone() { const tel = this.data.detail.Telephone; if (!tel) { wx.showToast({ icon: "none", title: "电话暂未开通", }); return; } wx.makePhoneCall({ phoneNumber: tel, }); }, });