武田基因病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.

99 lines
2.1 KiB

import dayjs from 'dayjs'
const app = getApp<IAppOption>()
1 month ago
Page({
data: {
name: '',
birthMonth: '',
provinceId: '',
cityId: '',
provinceName: '',
cityName: '',
end: dayjs().format('YYYY-MM-DD'),
PatientTel: '',
userInfo: {},
},
2 weeks ago
onShow() {
app.waitLogin({ type: 1 }).then(() => {
2 weeks ago
app.getUserInfo(1).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,
},
2 weeks ago
}).then(() => {
wx.showToast({
icon: 'none',
title: '保存成功',
})
})
},
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(() => {
2 weeks ago
app.updateLoginInfo(() => {
wx.reLaunch({
url: '/pages/index/index',
})
})
})
}
},
})
},
1 month ago
})
export {}