From 2f2a1104f389b2fb135487a57e8df76f099f8c4d Mon Sep 17 00:00:00 2001 From: yanzai Date: Thu, 7 Nov 2024 00:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8C=BB=E7=94=9F=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=EF=BC=88=E5=B7=AE=E8=B0=83=E6=A0=B7=E5=BC=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/H5/DoctorController.php | 68 +++- h5/pages.json | 6 + h5/pages/main/combo/combo.vue | 7 + h5/pages/main/selectDoctor/selectDoctor.vue | 102 +++--- h5/pages/main/ysdate/ysdate_new.vue | 329 ++++++++++++++++++ 5 files changed, 468 insertions(+), 44 deletions(-) create mode 100644 h5/pages/main/ysdate/ysdate_new.vue diff --git a/Laravel/app/Http/Controllers/API/H5/DoctorController.php b/Laravel/app/Http/Controllers/API/H5/DoctorController.php index 18dd268..9c25ad6 100644 --- a/Laravel/app/Http/Controllers/API/H5/DoctorController.php +++ b/Laravel/app/Http/Controllers/API/H5/DoctorController.php @@ -13,22 +13,51 @@ class DoctorController extends Controller { $date = request('date'); $hospital = request('hospital'); + $month = request('month'); + $doctor_id = request('doctor_id'); + $hospital_map = [ 'h1' => '6', 'h4' => '2', ]; + $datesArray = []; + if (isset($date)) { + $datesArray[] = $date; + } + if (isset($month) and $month == 'all') { + // 循环30次,每次获取一天后的日期 + for ($i = 0; $i < 31; $i++) { + // 使用strtotime函数计算$i天后的日期,然后用date函数格式化日期 + $datesArray[] = date('Y-m-d', strtotime("+$i days")); + } + } + if (isset($month) and (strlen($month) == 7 or strlen($month) == 6)) { + $firstDay = strtotime($month . '-01'); +// 获取该月的最后一天 + $lastDay = strtotime('+1 month', $firstDay) - 86400; // 减去一天的秒数(86400秒),得到最后一天 +// 从第一天到最后一天,逐天添加到数组中 + $currentDay = $firstDay; + while ($currentDay <= $lastDay) { + $datesArray[] = date('Y-m-d', $currentDay); + $currentDay = strtotime('+1 day', $currentDay); + } + + } + + if (empty($datesArray)) return \Yz::Return(false,"参数错误"); $dnet = new AspNetZhuanController(); $res = $dnet->GetDoctorDateList([ "yyid" => $hospital_map["h$hospital"], - "rq" => $date, + "data" => $datesArray, "action" => "1" ]); $list = []; if ($res['code'] == '200' && count($res['yisheng']) != 0) { foreach ($res['yisheng'] as $key => $value) { $list[] = [ - 'head_img' => 'data:image/jpeg;base64,' . $value['U_IMG'], + 'head_img' => 'data:image/jpeg;base64,' . $value['U_IMG'], 'name' => $value['U_NAME'], + 'id' => $value['U_ID'], 'level' => $value['ZC_NAME'], 'hospital' => '', 'time' => $value['U_GDPB'], @@ -36,6 +65,39 @@ class DoctorController extends Controller ]; } } - return \Yz::Return(true, "查询完成", ['list' => $list]); + $paiban=[]; + $dates=[]; + if(isset($month) and (strlen($month) == 7 or strlen($month) == 6) and isset($doctor_id)){ + $k=0; + + foreach ($res['paiban'] as $key => $date_value) { + foreach ($date_value as $key2 => $value2) { + if($value2['YSID']==$doctor_id){ + $paiban[]=$value2; + } + } + + + } + $firstDay = date("Y-m-d", strtotime($month . "-01")); + // 获取当月的最后一天 + $lastDay = date("Y-m-t", strtotime($month)); + for ($i = $firstDay; $i <= $lastDay; $i = date("Y-m-d", strtotime($i . " +1 day"))) { + + foreach ($paiban as $key => $value) { + if(date('Y-m-d', strtotime($value['PBRQ']))==$i){ + $dates[]=[ + 'date'=>$i, + 'paiban'=>$value, + ]; + } + } + $k++; + } + } + + + return \Yz::Return(true, "查询完成", ['list' => $list, 'paiban' => $dates]); } + } diff --git a/h5/pages.json b/h5/pages.json index 88109d5..a5af751 100644 --- a/h5/pages.json +++ b/h5/pages.json @@ -267,6 +267,12 @@ "style": { "navigationBarTitleText": "预约医生" } + }, + { + "path": "pages/main/ysdate/ysdate_new", + "style": { + "navigationBarTitleText": "预约医生" + } } ], diff --git a/h5/pages/main/combo/combo.vue b/h5/pages/main/combo/combo.vue index 6a0a8b4..30c57cd 100644 --- a/h5/pages/main/combo/combo.vue +++ b/h5/pages/main/combo/combo.vue @@ -272,6 +272,13 @@ onShow(() => { }); const buyClick = async (item) => { + let checkup_type_id=$store.getCheckupTypeId(); + console.log("----",checkup_type_id.id); + if(checkup_type_id.id=="" || checkup_type_id.id==undefined){ + $store.setCheckupTypeId({ + id: item.checkup_type_id + }); + } comboId.value = item.combo_id; if (item.duo_xuan_yi.length > 0) { popupMultiple.value.open("center"); diff --git a/h5/pages/main/selectDoctor/selectDoctor.vue b/h5/pages/main/selectDoctor/selectDoctor.vue index 2c04ad2..a991914 100755 --- a/h5/pages/main/selectDoctor/selectDoctor.vue +++ b/h5/pages/main/selectDoctor/selectDoctor.vue @@ -17,15 +17,27 @@ const $props = defineProps({ type: String, default: "", }, + month: { + type: String, + default: "", + }, }); + const mountedAction = () => { uni.showLoading({ title: "加载中", }); yytjInfo.value = $store.getYytjInfo(); - dqDate.value = $props.date ? $props.date : "2024-08-01"; - if (dqDate.value) { + yytjInfo.value = { + doctor_date: "", + doctor_name: "", + doctor_id:"", + nmrIndex: -1, + ...yytjInfo.value, + } + dqDate.value = $props.date ? $props.date : ""; + if (dqDate.value || $props.month) { getdoctorList(); // 获取医生列表 } }; @@ -36,6 +48,7 @@ const getdoctorList = async () => { let obj = { hospital: $store.save.hospital, date: dqDate.value, + month:$props.month }; const response = await $api("DoctorGetList", obj); $response(response, () => { @@ -53,15 +66,24 @@ const configRef = (e) => { }; const clickDoctor = (item) => { yytjInfo.value.doctor_name = item.name; + yytjInfo.value.doctor_id = item.id; yytjInfo.value.nmrIndex = -1; $store.setYytjInfo(yytjInfo.value); - // 关闭当前页面携带医生名称返回上一个,,并且携带item.name - uni.navigateBack({ - delta: 1, - }); + if($props.month=='all'){ + uni.navigateTo({ + url:'/pages/main/ysdate/ysdate_new' + }) + }else{ + // 关闭当前页面携带医生名称返回上一个,,并且携带item.name + uni.navigateBack({ + delta: 1, + }); + } + }; onShow(() => { + console.log($props.month); if (!!config_ref.value) { mountedAction(); } @@ -79,41 +101,39 @@ onShow(() => { style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)" class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff" > - - - - - - - {{ item.name }} - {{ - item.level - }} - - - {{ item.hospital }}: - {{ item.time }} - - - {{ item.desc }} - - - 预约此医生 - - - - - + + + + + + + {{ item.name }} + {{ + item.level + }} + + + {{ item.hospital }}: + {{ item.time }} + + + {{ item.desc }} + + + 预约此医生 + + + + + + + + 当前日期暂无医生 + + diff --git a/h5/pages/main/ysdate/ysdate_new.vue b/h5/pages/main/ysdate/ysdate_new.vue new file mode 100644 index 0000000..187563a --- /dev/null +++ b/h5/pages/main/ysdate/ysdate_new.vue @@ -0,0 +1,329 @@ + + + \ No newline at end of file