diff --git a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php index 472743a..18598a0 100644 --- a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php +++ b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php @@ -73,6 +73,7 @@ class FenzhenController extends Controller "more" => 0, "name" => $item['name'], "status" => 1, + 'count' => -1, "time" => "$in_time", "tip" => "剩余{$item_count}项正在排队中," ] @@ -88,6 +89,7 @@ class FenzhenController extends Controller "more" => 0, "name" => "体检结束", "status" => -1, + 'count' => -1, "time" => "$in_time", "tip" => "" ] @@ -111,101 +113,109 @@ class FenzhenController extends Controller $now_time = time(); // $now_time = strtotime('2024-11-07 00:00:00'); if (!!$res['data']['report']) { - $report_time = strtotime($res['data']['report'] . ' 00:00:00') + (60 * 60 * 24 * $report_day); - $report_time_show = date('m月d日', $report_time); - $report_status = false; - // 这里补充 获取 出具报告 时间的逻辑 - if ($report_time < $now_time) { - $report_status = true; - } - if (!$report_status) { - $time_line[] = [ - 'time' => '', - 'name' => '出具报告', - 'status' => -1, - 'desc' => "预计 $report_time_show 出具体检报告", - 'tip' => '', - 'more' => 0 - ]; - } else { - $time_line[] = [ - 'time' => '', - 'name' => '出具报告', - 'status' => -1, - 'desc' => "已出具体检报告 $report_time_show", - 'tip' => '', - 'more' => 0 - ]; - } - $check_report_time = $report_time + (60 * 60 * 24); - $check_report_status = 0; - // $check_report_status = '2024年10月11日'; - // 这里补充 获取 报告解读 时间的逻辑 - if ($check_report_time < $now_time) { - if (!!$info->person_id) { - $user_info = DB::table('web_user_person')->where(['id' => $info->person_id])->first(); - if (!!$user_info) { - $hospital_map = [ - 'h1' => '6', - 'h4' => '2' - ]; - $dnet = new AspNetZhuanController(); - $hid = $info->hospital_id; - $report_res = $dnet->GetReportAnalysis([ - "yyrq" => date('Y-m-d', $check_report_time), - "ghzid" => $user_info->ghzid, - "yyid" => $hospital_map["h$hid"], - "action" => "1" - ]); - switch ($report_res['code']) { - case '200': - $check_report_status = 2; - $show_date = date('m-d', strtotime($report_res['yyrq'])); - $time_line[] = [ - 'time' => '', - 'name' => '报告解读', - 'status' => -1, - 'desc' => "已预约 $show_date 报告解读", - 'tip' => '', - 'more' => 0 - ]; - break; - case '199': - case '201': - $check_report_status = 1; - $time_line[] = [ - 'time' => '', - 'name' => '报告解读', - 'status' => -1, - 'desc' => "可以预约报告解读", - 'tip' => '', - 'more' => 0 - ]; - break; - case '202': - $check_report_status = 0; - $time_line[] = [ - 'time' => '', - 'name' => '报告解读', - 'status' => 1, - 'desc' => "已完成报告解读", - 'tip' => '', - 'more' => 0 - ]; - break; + if ($report_day !== false) { + $report_status = false; + $report_time = strtotime($res['data']['report'] . ' 00:00:00') + (60 * 60 * 24 * $report_day); + $report_time_show = date('m月d日', $report_time); + // 这里补充 获取 出具报告 时间的逻辑 + if ($report_time < $now_time) { + $report_status = true; + } + if (!$report_status) { + $time_line[] = [ + 'time' => '', + 'name' => '出具报告', + 'status' => -1, + 'count' => -1, + 'desc' => "预计 $report_time_show 出具体检报告", + 'tip' => '', + 'more' => 0 + ]; + } else { + $time_line[] = [ + 'time' => '', + 'name' => '出具报告', + 'status' => -1, + 'count' => -1, + 'desc' => "已出具体检报告 $report_time_show", + 'tip' => '', + 'more' => 0 + ]; + } + $check_report_time = $report_time + (60 * 60 * 24); + $check_report_status = 0; + // $check_report_status = '2024年10月11日'; + // 这里补充 获取 报告解读 时间的逻辑 + if ($check_report_time < $now_time) { + if (!!$info->person_id) { + $user_info = DB::table('web_user_person')->where(['id' => $info->person_id])->first(); + if (!!$user_info) { + $hospital_map = [ + 'h1' => '6', + 'h4' => '2' + ]; + $dnet = new AspNetZhuanController(); + $hid = $info->hospital_id; + $report_res = $dnet->GetReportAnalysis([ + "yyrq" => date('Y-m-d', $check_report_time), + "ghzid" => $user_info->ghzid, + "yyid" => $hospital_map["h$hid"], + "action" => "1" + ]); + switch ($report_res['code']) { + case '200': + $check_report_status = 2; + $show_date = date('m-d', strtotime($report_res['yyrq'])); + $time_line[] = [ + 'time' => '', + 'name' => '报告解读', + 'status' => -1, + 'count' => -1, + 'desc' => "已预约 $show_date 报告解读", + 'tip' => '', + 'more' => 0 + ]; + break; + case '199': + case '201': + $check_report_status = 1; + $time_line[] = [ + 'time' => '', + 'name' => '报告解读', + 'status' => -1, + 'count' => -1, + 'desc' => "可以预约报告解读", + 'tip' => '', + 'more' => 0 + ]; + break; + case '202': + $check_report_status = 0; + $time_line[] = [ + 'time' => '', + 'name' => '报告解读', + 'status' => 1, + 'count' => -1, + 'desc' => "已完成报告解读", + 'tip' => '', + 'more' => 0 + ]; + break; + } } } + } else { + $check_report_time_show = date('m月d日', $check_report_time); + $time_line[] = [ + 'time' => '', + 'name' => '报告解读', + 'status' => -1, + 'count' => -1, + 'desc' => "预计 $check_report_time_show 可以预约报告解读", + 'tip' => '', + 'more' => 0 + ]; } - } else { - $check_report_time_show = date('m月d日', $check_report_time); - $time_line[] = [ - 'time' => '', - 'name' => '报告解读', - 'status' => -1, - 'desc' => "预计 $check_report_time_show 可以预约报告解读", - 'tip' => '', - 'more' => 0 - ]; } } $res['data']['end_time'] = date('H:i', $last_time); diff --git a/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php b/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php index f37c085..fdabb93 100644 --- a/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php +++ b/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php @@ -88,6 +88,7 @@ class QuestionnairesLogsController extends Controller $person_info = json_decode($log_info->person_info, true); $age = !!$person_info['birthday'] ? date('Y') - date('Y', strtotime($person_info['birthday'])) : 0; + $sex = !!$person_info['sex'] ? $person_info['sex'] : 1; $weight = !!$log_info->weight ? $log_info->weight : 0; $height = !!$log_info->height ? $log_info->height : 0; $items_ids = json_decode($log_info->check_items, true); @@ -109,6 +110,7 @@ class QuestionnairesLogsController extends Controller } return \Yz::Return(true, '操作完成', [ 'date' => date('Y-m-d', strtotime($log_info->created_at)), + 'sex' => $sex, 'age' => $age, 'weight' => $wh, 'items' => $items, @@ -119,6 +121,11 @@ class QuestionnairesLogsController extends Controller 'tuijian' => self::sum_items($items, $check_items_array['tuijian']), 'gaoduan' => self::sum_items($items, $check_items_array['gaoduan']), ], + 'original_price' => [ + 'jichu' => self::sum_items($items, $check_items_array['jichu'], false), + 'tuijian' => self::sum_items($items, $check_items_array['tuijian'], false), + 'gaoduan' => self::sum_items($items, $check_items_array['gaoduan'], false), + ], 'count' => [ 'jichu' => self::item_count($items, $check_items_array['jichu']), 'tuijian' => self::item_count($items, $check_items_array['tuijian']), @@ -154,7 +161,7 @@ class QuestionnairesLogsController extends Controller return $ic; } - public function sum_items($items, $check_items) + public function sum_items($items, $check_items, $zk = true) { if (count($items)) { $sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price'); @@ -173,7 +180,11 @@ class QuestionnairesLogsController extends Controller $combo = 0; } + if (!!$zk) { $zhekou = config('app.globals.Wj_ZheKou'); + } else { + $zhekou = 1; + } return number_format((($combo + $sum + $check_sum) * $zhekou), 2, '.', ''); } public function submit(Request $request) diff --git a/h5/pages/main/question/done/done.vue b/h5/pages/main/question/done/done.vue index 554a994..9782910 100644 --- a/h5/pages/main/question/done/done.vue +++ b/h5/pages/main/question/done/done.vue @@ -99,7 +99,8 @@ - + + diff --git a/h5/pages/main/question/info/info.vue b/h5/pages/main/question/info/info.vue index 5420905..00b87f1 100644 --- a/h5/pages/main/question/info/info.vue +++ b/h5/pages/main/question/info/info.vue @@ -81,10 +81,10 @@ ...question_info.value.check_items_array[type].combo_items, ])] if (mergedArray.length !== 0) { - let query = "?wj=1&itemIds=" + mergedArray.join(','); - uni.navigateTo({ - url: "/pages/main/tj/tjxq" + query, - }); + let query = "?wj=1&itemIds=" + mergedArray.join(','); + uni.navigateTo({ + url: "/pages/main/tj/tjxq" + query, + }); } } @@ -118,7 +118,10 @@ 本方案根据您的身体状况进行基础检查,经济实用,避免过度检查 - ¥ {{ question_info.price.jichu }} + + ¥ {{ question_info.price.jichu }} + 原价 ¥{{ question_info.original_price.jichu }} + 查看详细方案 @@ -138,7 +141,10 @@ 本方案根据您的身体状况进行基础检查,经济实用,避免过度检查 - ¥ {{ question_info.price.tuijian }} + + ¥ {{ question_info.price.tuijian }} + 原价 ¥{{ question_info.original_price.tuijian }} + 查看详细方案 @@ -158,7 +164,10 @@ 本方案根据您的身体状况进行基础检查,经济实用,避免过度检查 - ¥ {{ question_info.price.gaoduan }} + + ¥ {{ question_info.price.gaoduan }} + 原价 ¥{{ question_info.original_price.gaoduan }} + 查看详细方案 @@ -196,6 +205,14 @@ line-height: 1; margin-top: 40rpx; margin-left: 37rpx; + display: flex; + align-items: center; + } + + .original_price_wrapper { + margin-left: 20rpx; + text-decoration: line-through; + opacity: 0.8; } .items_tip_wrapper { diff --git a/h5/pages/main/question/question/question.vue b/h5/pages/main/question/question/question.vue index 13f1b2e..978d485 100644 --- a/h5/pages/main/question/question/question.vue +++ b/h5/pages/main/question/question/question.vue @@ -5,6 +5,7 @@ * date:2024年9月11日 19:24:50 */ import { + nextTick, ref } from 'vue' import { @@ -48,6 +49,9 @@ question_list.value = response.data.list question_active.value = 0 start_time.value = new Date() / 1000 + nextTick(() => { + localGet() + }) }) } @@ -144,6 +148,26 @@ .value = value break } + localSave() + } + const localSave = () => { + let data = { + info: question_info.value, + list: question_list.value + } + uni.setStorageSync('QUESTION_SAVE', JSON.stringify(data)) + } + const localGet = () => { + let local_get = uni.getStorageSync('QUESTION_SAVE') + if (!!local_get) { + let local_data = JSON.parse(local_get) + if (JSON.stringify(local_data.info) === JSON.stringify(question_info.value)) { + question_list.value = local_data.list + submitClick(false) + } else { + uni.removeStorageSync('QUESTION_SAVE') + } + } } onShow(() => { @@ -152,7 +176,7 @@ } }) - const submitClick = () => { + const submitClick = (submit = true) => { let value_array = [] let list = question_list.value for (let i in list) { @@ -226,7 +250,9 @@ } } } - QuestionSubmit(value_array) + if (!!submit) { + QuestionSubmit(value_array) + } } const QuestionSubmit = async (content) => { @@ -237,6 +263,7 @@ use_time: new Date() / 1000 - start_time.value }) $response(response, () => { + uni.removeStorageSync('QUESTION_SAVE') uni.redirectTo({ url: '/pages/main/question/done/done?id=' + response.data.id }) diff --git a/h5/pages/user/fenzhen/fenzhen.vue b/h5/pages/user/fenzhen/fenzhen.vue index a2671d8..cec4fdc 100644 --- a/h5/pages/user/fenzhen/fenzhen.vue +++ b/h5/pages/user/fenzhen/fenzhen.vue @@ -28,14 +28,22 @@ }); const fenzhen_list = ref(false); - const getFenzhenList = async () => { - uni.showLoading(); + const getFenzhenList = async (loading = true) => { + if (!!loading) { + uni.showLoading(); + } const response = await $api("FenzhenList", { id: $props.id, }); uni.hideLoading(); $response(response, () => { fenzhen_list.value = response.data; + console.log(window.location.href) + setTimeout(() => { + if (!!window.location.href.includes('/pages/user/fenzhen/fenzhen')) { + getFenzhenList(false) + } + }, 1000 * 10) }); }; @@ -189,7 +197,7 @@ - + 预约解读 @@ -277,6 +285,7 @@ line-height: 1; text-decoration-line: underline; margin-right: 19rpx; + flex-shrink: 0; } .time_line_item_text_wrapper { @@ -285,8 +294,7 @@ color: #6e6e6e; line-height: 1; margin-left: 42rpx; - - width: calc(100% - 210rpx); + /* width: calc(100% - 210rpx); */ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -302,6 +310,7 @@ .time_line_item_box_wrapper { width: 400rpx; + margin-left: 20rpx; height: 40rpx; background: #5a75ca30; border-radius: 5rpx; @@ -314,7 +323,7 @@ } .time_line_item_title_wrapper { - width: 140rpx; + /* width: 140rpx; */ font-weight: bold; font-size: 28rpx; color: #0d0d0d; @@ -324,6 +333,7 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + flex-shrink: 0; } .time_line_item_flex_wrapper { diff --git a/h5/pages/user/fenzhen/qijian.vue b/h5/pages/user/fenzhen/qijian.vue index d6910b5..569b09f 100644 --- a/h5/pages/user/fenzhen/qijian.vue +++ b/h5/pages/user/fenzhen/qijian.vue @@ -1,5 +1,5 @@