From a536d68388f9b8c3d4d63bea5d4a932f751b935b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BD=B3=E5=AE=87?= <17601616548@163.com> Date: Sat, 28 Sep 2024 15:40:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/optionalProject/optionalProject.vue | 10 ++- h5/pages/main/tjyy/tjyy.vue | 12 +-- h5/pages/main/yytjsj/yytjsj.vue | 83 +++++++++++-------- 3 files changed, 64 insertions(+), 41 deletions(-) diff --git a/h5/pages/main/optionalProject/optionalProject.vue b/h5/pages/main/optionalProject/optionalProject.vue index 6f46d18..fe3d317 100644 --- a/h5/pages/main/optionalProject/optionalProject.vue +++ b/h5/pages/main/optionalProject/optionalProject.vue @@ -254,13 +254,19 @@ const config_ref = ref(null); const configRef = (e) => { if (!config_ref.value) { config_ref.value = e; - mountedAction(); + let time = setTimeout(() => { + clearTimeout(time); + mountedAction(); + }, 500); } }; onShow(() => { if (!!config_ref.value) { - mountedAction(); + let time = setTimeout(() => { + clearTimeout(time); + mountedAction(); + }, 500); } }); diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue index ccc4a46..83bcc94 100755 --- a/h5/pages/main/tjyy/tjyy.vue +++ b/h5/pages/main/tjyy/tjyy.vue @@ -66,10 +66,10 @@ const getnmrList = async () => { const comfrimyy = async () => { let plan_id = ""; let plan_nmr_id = ""; - if(!yytjInfo.value?.doctor_name){ - uni.$lu.toast("请选择医生"); - return; - } + // if(!yytjInfo.value?.doctor_name){ + // uni.$lu.toast("请选择医生"); + // return; + // } console.log(yytjInfo.value?.nmr_list); for(let i = 0; i < yytjInfo.value?.nmr_list?.length; i++){ if(!yytjInfo.value?.nmr_list[i].time){ @@ -99,7 +99,7 @@ const comfrimyy = async () => { const response = await $api("OrderCreate", obj); $response(response, () => { - if(response.status && !response.action){ + if(response.status){ if(response.action == "pay"){ StartPay(); }else{ @@ -353,7 +353,7 @@ const toRouter = (url, status) => { > 套餐名称 - {{ comboInfo?.crowd_name || groupInfo?.crowd_name }} + {{ comboInfo?.combo_name || groupInfo?.combo_name }} ¥{{ comboInfo?.price || groupInfo?.sixi_zong_ji_jin_e }} diff --git a/h5/pages/main/yytjsj/yytjsj.vue b/h5/pages/main/yytjsj/yytjsj.vue index e2a878e..2ae38d4 100755 --- a/h5/pages/main/yytjsj/yytjsj.vue +++ b/h5/pages/main/yytjsj/yytjsj.vue @@ -39,9 +39,9 @@ const mountedAction = async () => { }; onBeforeUnmount(() => { - if(!status.value){ - $store.setYytjInfo(uni.getStorageSync("yytjInfoS")); - } + if (!status.value) { + $store.setYytjInfo(uni.getStorageSync("yytjInfoS")); + } }); const init = async () => {}; @@ -62,14 +62,14 @@ const getnmrList = async () => { return { ...val, time: "", - id: "", + id: "", }; }); yytjInfo.value.nmr_list.push({ item_id: -1, name: "体检时间", time: "", - id: "", + id: "", }); } uni.hideLoading(); @@ -87,20 +87,32 @@ const getToday = () => { // 拼接日期字符串 return year + "-" + month + "-" + day; }; -const getTjTimeList = async (timeItem) => { +const getTjTimeList = async (val) => { console.log($store.getCheckupTypeId()); + console.log(val); // 获取 体检号源 - let obj = { - hospital: buyInfo.value.hospital, - person_id: buyInfo.value.person_id, - date: currentDate.value, //currentDate.value - use_type: buyInfo.value.group_id ? 2 : 1, - checkup_type_id: buyInfo.value.group_id - ? $store.getGroupInfo()?.checkup_type_id - : $store.getCheckupTypeId().id, - amount: truePrice.value, - }; - const response = await $api("GetDayPlanList", obj); + let obj = {}; + let apiText = ""; + if (val.item_id == -1) { + obj = { + hospital: buyInfo.value.hospital, + person_id: buyInfo.value.person_id, + date: currentDate.value, //currentDate.value + use_type: buyInfo.value.group_id ? 2 : 1, + checkup_type_id: buyInfo.value.group_id + ? $store.getGroupInfo()?.checkup_type_id + : $store.getCheckupTypeId().id, + amount: truePrice.value, + }; + apiText = "GetDayPlanList"; + } else { + obj = { + hospital_id: buyInfo.value.hospital, + date: currentDate.value, + }; + apiText = "NMRGetDayPlanList"; + } + const response = await $api(apiText, obj); $response(response, () => { console.log(response, "response"); // currentXmmcObj.value["sj"] = ""; //每次请求新的时间时间置空 @@ -111,15 +123,18 @@ const getTjTimeList = async (timeItem) => { time_list.value.forEach((item) => { console.log(item.date); item.newTime = item.time.slice(0, 5); + item.date = currentDate.value; }); date_list.value.forEach((item) => { + console.log(item) + item.item_id = val.item_id; const [year, month, day] = item.date.split("-"); item.newMonthDate = `${month}/${day}`; //月份日期 item.newWeek = item.xingqi.replace("星期", "周"); }); - if (timeItem) { + if (val.time) { timeIndex.value = time_list.value.findIndex( - (item) => item.newTime == timeItem.split(" ")[1] + (item) => item.newTime == val.time.split(" ")[1] ); } uni.hideLoading(); @@ -136,14 +151,17 @@ const getCurrentClick = (item, i) => { timeIndex.value = null; yytjInfo.value.nmr_list[nmrIndex.value].time = ""; yytjInfo.value.nmr_list[nmrIndex.value].id = ""; - console.log(yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time, "xxsxsx"); - if(!yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time){ - yytjInfo.value.doctor_name = ""; - } + console.log( + yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time, + "xxsxsx" + ); + if (!yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time) { + yytjInfo.value.doctor_name = ""; + } $store.setYytjInfo(yytjInfo.value); - status.value = 0; + status.value = 0; currentDate.value = item.date; - getTjTimeList(); //带着选中的日期重新选择 + getTjTimeList(item); //带着选中的日期重新选择 }; const getCurrentTime = (item, index) => { // 选择时分 @@ -151,22 +169,23 @@ const getCurrentTime = (item, index) => { uni.$lu.toast("该号源已被其他人预约"); return; } - console.log(item); + console.log(item); timeIndex.value = index; yytjInfo.value.nmr_list[nmrIndex.value].time = item.date + " " + item.newTime; yytjInfo.value.nmr_list[nmrIndex.value].id = item.id; - status.value = 0; + status.value = 0; $store.setYytjInfo(yytjInfo.value); }; const xmmcClick = (val, index) => { - // 选择日期 + // 选择项目 nmrIndex.value = index; time.value = ""; timeIndex.value = null; if (val.time) { currentDate.value = val.time.split(" ")[0]; } - getTjTimeList(val.time); + // 体检号源 + getTjTimeList(val); }; const clickDoctor = () => { @@ -175,16 +194,14 @@ const clickDoctor = () => { uni.$lu.toast("请先选择体检时间"); return; } - status.value = 0; + status.value = 0; uni.navigateTo({ url: `/pages/main/selectDoctor/selectDoctor?date=${currentDate.value}`, }); }; - - const comfrimyy = () => { - status.value = 1; + status.value = 1; uni.navigateBack({ delta: 1, });