|
|
@ -16,7 +16,7 @@
|
|
|
|
} else { // 已登录
|
|
|
|
} else { // 已登录
|
|
|
|
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
|
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
|
h_info.value = userinfo.value
|
|
|
|
h_info.value = userinfo.value
|
|
|
|
h_info.value.surgery_time = h_info.value.surgery_time
|
|
|
|
h_info.value.surgery_time = h_info.value.SurgeryTime
|
|
|
|
userinfo.value.avatar = uni.getStorageSync('avatarUrl')
|
|
|
|
userinfo.value.avatar = uni.getStorageSync('avatarUrl')
|
|
|
|
h_index.value = hospitals.value.findIndex((item,i) => {
|
|
|
|
h_index.value = hospitals.value.findIndex((item,i) => {
|
|
|
|
return item.ID == userinfo.value.HospitalId
|
|
|
|
return item.ID == userinfo.value.HospitalId
|
|
|
@ -33,7 +33,7 @@
|
|
|
|
pageSize:1000,
|
|
|
|
pageSize:1000,
|
|
|
|
key:''
|
|
|
|
key:''
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const hospitals = ref(null)
|
|
|
|
const hospitals = ref([])
|
|
|
|
const userinfo = ref({})
|
|
|
|
const userinfo = ref({})
|
|
|
|
const avatar = ref(null)
|
|
|
|
const avatar = ref(null)
|
|
|
|
const h_info = ref({})
|
|
|
|
const h_info = ref({})
|
|
|
@ -144,6 +144,7 @@
|
|
|
|
// if(!is_login.value) { // 新用户 - 先登录
|
|
|
|
// if(!is_login.value) { // 新用户 - 先登录
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
userinfo.value.SurgeryTime = obj.surgery_time
|
|
|
|
const res = await api.userinfoUpdae(obj) // 更新用户信息
|
|
|
|
const res = await api.userinfoUpdae(obj) // 更新用户信息
|
|
|
|
if(res.code === 0) {
|
|
|
|
if(res.code === 0) {
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
@ -175,7 +176,7 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
let res2=await api.wx_login({code:res.code},userId);
|
|
|
|
let res2=await api.wx_login({code:res.code},userId);
|
|
|
|
if(res2.code === 0) {
|
|
|
|
if(res2.code === 0) {
|
|
|
|
userinfo.value.HospitalId = hospitals.value[h_index.value].ID
|
|
|
|
userinfo.value.HospitalId = hospitals.value[h_index.value]?.ID
|
|
|
|
h_info.value.hospitalId = userinfo.value.HospitalId
|
|
|
|
h_info.value.hospitalId = userinfo.value.HospitalId
|
|
|
|
uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl
|
|
|
|
uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl
|
|
|
|
uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))
|
|
|
|
uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))
|
|
|
|