diff --git a/h5/pages/main/tj/choose.vue b/h5/pages/main/tj/choose.vue index 202bcbc..ca409e0 100644 --- a/h5/pages/main/tj/choose.vue +++ b/h5/pages/main/tj/choose.vue @@ -37,14 +37,38 @@ const configRef = (e) => { getPersonList(); } }; - +const getUserInfo = async () => { + const response = await $api("UserInfo"); + $response(response, () => { + // $store.user = response.data.info + $store.setUser(response.data.info); + $store.setYytjInfo({}); // 切换体检人的时候清空预约信息 + + let buyinfo=$store.getBuyInfo() + buyinfo.person_id=response.data.info.person_id + $store.setBuyInfo(buyinfo); + + // uni.$lu.toast("切换成功"); + // uni.navigateBack({ + // delta: 1, + // }); + }); +}; const choosePersonClick = async (info) => { +uni.showLoading(); + const response1 = await $api("SetDefaultPerson", { + person_id: info.id, + }); + $response(response1, () => { + getUserInfo(); + }); // 查询团检ID const response = await $api("GetGroupUnit", { hospital_id: $store.save.hospital, id_number: info.id_number, phone: info.phone, }); + uni.hideLoading(); $response(response, () => { unitList.value = response.data.unit; if (response.data.unit.length > 1) {