diff --git a/h5/pages/main/selectDoctor/selectDoctor.vue b/h5/pages/main/selectDoctor/selectDoctor.vue index 160d3a2..567af33 100755 --- a/h5/pages/main/selectDoctor/selectDoctor.vue +++ b/h5/pages/main/selectDoctor/selectDoctor.vue @@ -1,125 +1,122 @@ - \ No newline at end of file + diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue index bb6fd40..fe768f1 100755 --- a/h5/pages/main/tjyy/tjyy.vue +++ b/h5/pages/main/tjyy/tjyy.vue @@ -289,7 +289,7 @@ const comfrimyy = async () => { console.log(obj); const response = await $api("OrderCreate", obj); - // return + return; $response(response, () => { if (response.status) { if (response.data.action == "pay") { @@ -361,12 +361,36 @@ onShow(() => { }); const toRouter = (url, status, index) => { + let i = index; if (status) { - console.log(index); - yytjInfo.value.nmrIndex = index; + if ( + yytjInfo.value.nmr_list.length > 1 && + yytjInfo.value.nmr_list[0].time == "" + ) { + // 核磁时间没选择 + i = 0; + } + // if (yytjInfo.value.nmr_list.length == 1 && yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") { + // // 体检时间没选择 + // if(index = -1){ + // // 点击医生 + // }else{ + // // 点击体检时间 + // } + // nmrIndex.value = 1; + // moreTime(null, 1); + // return; + // } + yytjInfo.value.nmrIndex = i; console.log(yytjInfo.value); uni.setStorageSync("yytjInfoS", yytjInfo.value); $store.setYytjInfo(yytjInfo.value); + if (yytjInfo.value.doctor_date && i == -1) { + uni.navigateTo({ + url: `/pages/main/selectDoctor/selectDoctor?date=${yytjInfo.value.doctor_date}`, + }); + return; + } } uni.navigateTo({ url: url, @@ -625,9 +649,7 @@ const toRouter = (url, status, index) => { @@ -643,7 +665,7 @@ const toRouter = (url, status, index) => { 体检医生 {{ diff --git a/h5/pages/main/yytjsj/yytjsj.vue b/h5/pages/main/yytjsj/yytjsj.vue index ab079e3..3d2bea8 100755 --- a/h5/pages/main/yytjsj/yytjsj.vue +++ b/h5/pages/main/yytjsj/yytjsj.vue @@ -76,13 +76,22 @@ const getnmrList = async () => { }); } nmrIndex.value = yytjInfo.value.nmrIndex; - console.log(yytjInfo.value.nmr_list[nmrIndex.value]); - xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value); + if (nmrIndex.value == -1) { + // 选择医生 + if (yytjInfo.value.doctor_date) { + currentDate.value = yytjInfo.value.doctor_date; + } + clickDoctor(1); + } else { + // 选择体检时间和核磁时间 + xmmcClick(yytjInfo.value.nmr_list[nmrIndex.value], nmrIndex.value); + } uni.hideLoading(); }); }; const moreTime = async (m, status) => { + uni.showLoading({ title: "加载中" }); isClickDoctor.value = status; // 日历 const [year, month, day] = currentDate.value.split("-"); @@ -128,6 +137,7 @@ const moreTime = async (m, status) => { console.log(rlArr); rl_list.value = rlArr; calendarShow.value = true; + uni.hideLoading(); }); }; @@ -196,7 +206,7 @@ const getTjTimeList = async (val) => { time_list.value.forEach((item) => { console.log(item.date); - item.newTime = item.time.slice(0, 5); + item.newTime = item?.time.slice(0, 5); item.date = currentDate.value; }); date_list.value.forEach((item) => { @@ -232,11 +242,36 @@ const changerl = (e) => { uni.navigateTo({ url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`, }); + return; } if (date_list.value[3]?.date == e.fulldate) { calendarShow.value = false; return; } + if ( + nmrIndex.value == yytjInfo.value.nmr_list.length - 1 && + yytjInfo.value.doctor_date + ) { + console.log("切换体检时间"); + uni.showModal({ + title: "提示", + content: "已选择医生,切换日期将重新选择医生,是否继续", + showCancel: true, + success: ({ confirm }) => { + if (confirm) { + currentDate.value = e.fulldate; + time.value = ""; + timeIndex.value = null; + yytjInfo.value.nmr_list[nmrIndex.value].time = ""; + yytjInfo.value.nmr_list[nmrIndex.value].id = ""; + yytjInfo.value.doctor_name = ""; // 每次切换都清空医生 + getTjTimeList(yytjInfo.value.nmr_list[nmrIndex.value]); + calendarShow.value = false; + } + }, + }); + return; + } // uni.showLoading({ // title: "加载中", // }); @@ -263,6 +298,42 @@ const getCurrentClick = (item, i) => { return; } if (i != 3) { + if ( + nmrIndex.value == yytjInfo.value.nmr_list.length - 1 && + yytjInfo.value.doctor_date + ) { + console.log("切换体检时间"); + uni.showModal({ + title: "提示", + content: "已选择医生,切换日期将重新选择医生,是否继续", + showCancel: true, + success: ({ confirm }) => { + console.log(confirm); + if (confirm) { + if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) { + yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => { + return { + ...val, + time: "", + id: "", + }; + }); + } + time.value = ""; + timeIndex.value = null; + yytjInfo.value.nmr_list[nmrIndex.value].time = ""; + yytjInfo.value.nmr_list[nmrIndex.value].id = ""; + yytjInfo.value.doctor_name = ""; // 每次切换都清空医生 + yytjInfo.value.doctor_date = ""; // 每次切换都清空医生 + $store.setYytjInfo(yytjInfo.value); + status.value = 0; + currentDate.value = item.date; + getTjTimeList(item); //带着选中的日期重新选择 + } + }, + }); + return; + } if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) { yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => { return { @@ -305,14 +376,16 @@ const xmmcClick = (val, index, status) => { if ( yytjInfo.value.nmr_list.length > 1 && index != 0 && - yytjInfo.value.nmr_list[0].time == "" + yytjInfo.value.nmr_list[0]?.time == "" ) { - uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间"); + uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0]?.name + "时间"); return; } nmrIndex.value = index; time.value = ""; timeIndex.value = null; + isClickDoctor.value = 0; + calendarShow.value = false; if (val.time) { currentDate.value = val.time.split(" ")[0]; } else { @@ -331,23 +404,29 @@ const xmmcClick = (val, index, status) => { getTjTimeList(val); }; -const clickDoctor = () => { +const clickDoctor = (s) => { //选择医生 + console.log(yytjInfo.value.nmr_list[0]?.time); + console.log(yytjInfo.value.nmr_list[0]?.name); if ( yytjInfo.value.nmr_list.length > 1 && - yytjInfo.value.nmr_list[0].time == "" + yytjInfo.value.nmr_list[0]?.time == "" ) { - uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间"); + uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0]?.name + "时间"); return; } - if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") { - nmrIndex.value = yytjInfo.value.nmr_list?.length - 1; - moreTime(null, 1); + // if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1]?.time == "") { + // nmrIndex.value = yytjInfo.value.nmr_list?.length - 1; + nmrIndex.value = -1; + moreTime(null, 1); + // return; + // } + if (s) { return; } status.value = 0; let date = - yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time?.split( + yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1]?.time?.split( " " )[0]; yytjInfo.value.doctor_date = date; @@ -460,7 +539,7 @@ onShow(() => { /> 您好, - {{ groupInfo.name }} + {{ groupInfo?.name }} @@ -536,135 +615,130 @@ onShow(() => { @monthSwitch="monthSwitch" /> - + + + + 确定 + +