diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue index b74dc0d..a8f45f2 100755 --- a/h5/pages/main/tjyy/tjyy.vue +++ b/h5/pages/main/tjyy/tjyy.vue @@ -363,11 +363,11 @@ const toRouter = (url, status) => { > {{ val.name }} {{ val.time }} - {{ val.time ? "重新预约" : "预约时间" }} + {{ val.time ? "重新预约" : "预约时间" }} 体检医生 - {{ yytjInfo?.doctor_name || "选择医生" }} + {{ yytjInfo?.doctor_name || "选择医生" }} diff --git a/h5/pages/main/yytjsj/yytjsj.vue b/h5/pages/main/yytjsj/yytjsj.vue index 482d943..e9f1e7b 100755 --- a/h5/pages/main/yytjsj/yytjsj.vue +++ b/h5/pages/main/yytjsj/yytjsj.vue @@ -10,14 +10,11 @@ import { $api, $response, $image } from "@/api"; import { onShow } from "@dcloudio/uni-app"; import { useStore } from "@/store"; const $store = useStore(); -const dqDate = ref(""); -const doctor_name = ref(""); let date_list = ref(false); let time_list = ref(false); let currentDate = ref(0); let currentTime = ref(0); -let currentXmmcObj = ref(false); //当前选中体检项目对象 let buyInfo = ref({}); // 购买信息 let yytjInfo = ref({}); // 购买信息 let groupInfo = ref({}); @@ -28,6 +25,8 @@ let nmrIndex = ref(0); // 当前选中项目索引 let time = ref(""); // 时分 let timeIndex = ref(null); // 当前选中时间索引 let status = ref(0); // 1:点了确定 2:未点确定 +let calendarShow = ref(false); // 日历显示 +const rl_list = ref(false); //日历插槽 const mountedAction = async () => { uni.showLoading({ @@ -47,6 +46,7 @@ onBeforeUnmount(() => { }); const getnmrList = async () => { + // 获取项目列表 const response = await $api("BuyInfo", buyInfo.value); $response(response, () => { if (buyInfo.value.group_id && response.data.group_info.length) { @@ -78,6 +78,45 @@ const getnmrList = async () => { uni.hideLoading(); }); }; + +const moreTime = async (m) => { + // 日历 + const [year, month, day] = currentDate.value.split("-"); + let dqmonth = m || `${year}-${month}`; //年 月份 + let obj = { + hospital: buyInfo.value.hospital, + person_id: buyInfo.value.person_id, + month: dqmonth, //月份 + 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("GetMonthPlanCount", obj); + $response(response, () => { + console.log(response.data.list, "response.data.list"); + let rlArr = []; + response.data.list.forEach((item) => { + let o = { + date: item.date, + info: "余号" + item.count, + }; + rlArr.push(o); + }); + rl_list.value = rlArr; + calendarShow.value = true; + }); +}; + +const monthSwitch = (e) => { + let [year, month] = getToday().split("-"); + if (e.year >= year && e.month >= month) { + console.log(e, "monthSwitch"); + let str = `${e.year}-${e.month}`; + moreTime(str); + } +}; const getToday = () => { // 获取当前日期 var today = new Date(); @@ -144,6 +183,22 @@ const getTjTimeList = async (val) => { }); }; +const changerl = (e) => { + // 选中某天日期 + console.log(e, "changerl"); + let num = e.extraInfo.info ? e.extraInfo.info.substring(2) : 0; + if (num == 0) { + uni.$lu.toast("当前余号剩余0"); + } else if (num > 0) { + uni.showLoading({ + title: "加载中", + }); + currentDate.value = e.fulldate; + getTjTimeList(yytjInfo.value.nmr_list[nmrIndex.value]); + calendarShow.value = false; + } +}; + const getCurrentClick = (item, i) => { console.log(item, i); //当前日期和星期 if (item.count < 0) { @@ -369,112 +424,140 @@ onShow(() => { - - - {{ currentXmmcObj.name || "" }} - - + + + -