武田基因病B开发环境
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.

92 lines
1.9 KiB

const app = getApp<IAppOption>()
1 month ago
Page({
data: {
name: '',
birthMonth: '',
provinceId: '',
cityId: '',
provinceName: '',
cityName: '',
PatientTel: '',
userInfo: {},
},
onLoad() {
app.waitLogin().then(() => {
app.getUserInfo(2).then((userInfo) => {
this.setData({
name: userInfo.PatientName,
birthMonth: userInfo.PatientBirth,
provinceId: userInfo.PatientProvinceId,
cityId: userInfo.PatientCityId,
provinceName: userInfo.PatientProvince,
cityName: userInfo.PatientCity,
PatientTel: userInfo.PatientTel,
userInfo,
})
})
})
},
handleAreaChange(e: any) {
const value = e.detail
this.setData({
provinceId: value[0].value,
cityId: value[1] ? value[1].value : '',
provinceName: value[0].label,
cityName: value[1] ? value[1].label : '',
})
this.handleUpdate()
},
handleUpdate() {
const { name, birthMonth, provinceId, cityId } = this.data
wx.ajax({
method: 'POST',
url: '?r=wtx/account/update-info',
data: {
name,
birthMonth,
provinceId,
cityId,
},
}).then((res) => {
console.log('res: ', res)
})
},
1 month ago
handleTel() {
wx.navigateTo({
url: '/patient/pages/changeTel/index',
})
},
handleLoginOut() {
wx.navigateTo({
url: '/patient/pages/loginOut/index',
})
},
handleOut() {
wx.showModal({
title: '确定退出登录吗?',
confirmColor: 'rgba(246, 74, 58, 1)',
success: (res) => {
if (res.confirm) {
wx.ajax({
method: 'POST',
url: '?r=wtx/user/reg-logout',
data: {},
}).then(() => {
app.startLogin(() => {
wx.reLaunch({
url: '/pages/index/index',
})
})
})
}
},
})
},
1 month ago
})
export {}