const _app = getApp() Page({ data: { ProvinceName: '', ProvinceId: '', CityName: '', CityId: '', hostipalName: '', hostipalId: '', hostipalList: [ { id: '1', name: '北京医院', }, ], }, onLoad() {}, handleChangeSite(e: WechatMiniprogram.CustomEvent) { const detail = e.detail this.setData({ ProvinceId: detail.ProvinceId, ProvinceName: detail.ProvinceName, CityId: detail.CityId, CityName: detail.CityName, }) }, handleChange(e) { const { hostipalList } = this.data const hItem = hostipalList[e.detail.value] this.setData({ hostipalName: hItem.name, hostipalId: hItem.id, }) }, handleHostipalDisable() { wx.showToast({ title: '请先选择所在城市', icon: 'none', }) }, handleSubmit() { if (!this.data.hostipalId) { wx.showToast({ icon: 'none', title: '请先选择医院', }) return } wx.navigateTo({ url: '/patient/pages/medicalDetail/index', }) }, }) export {}