diff --git a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php index 5c4427f..a950cb6 100644 --- a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php +++ b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php @@ -13,27 +13,29 @@ class FenzhenController extends Controller // 这里放 弃检逻辑 return \Yz::Return(true, "弃检成功"); } + public function check() { // 这里放 检查是否有 体检引导的数据 - $id_number =request('id_number'); - $list=DB::table('orders')->where(['id_number'=>$id_number])->whereIn('status',[2,4])->get(); - return \Yz::Return(true, "弃检成功",['list'=>$list]); + $id_number = request('id_number'); + $list = DB::table('orders')->where(['id_number' => $id_number])->whereIn('status', [2, 4])->get(); + return \Yz::Return(true, "弃检成功", ['list' => $list]); } public function list() { - $id =request('id'); - $info=DB::table('orders')->where(['id'=>$id])->whereIn('status',[2,4])->get(); - if(!$info) return \Yz::echoError1("查询就诊人订单失败"); + $id = request('id'); + $info = DB::table('orders')->where(['id' => $id])->whereIn('status', [2, 4])->first(); + if (!$info) return \Yz::echoError1("查询就诊人订单失败"); + $end_time = date('H:i', strtotime($info->appointment_date . ' ' . $info->appointment_time) + (60 * 60 * 0.54)); return \Yz::Return(true, "获取成功", [ 'info' => [ 'name' => $info->name, 'sex' => $info->sex, 'combo_name' => $info->title, 'check_date' => $info->appointment_date, - 'start_time' => $info->appointment_time, - 'end_time' => '10:25', + 'start_time' => $info->appointment_time, + 'end_time' => $end_time, 'qrcode' => '', 'code' => $info->appointment_number, // 体检条码 ], @@ -43,18 +45,21 @@ class FenzhenController extends Controller 'status' => 4, 'desc' => '已完成', 'tip' => '体检登记 2024-08-09 08:25:30', + 'more' => 0 ], [ 'time' => '08:30', 'name' => '体格检查', 'status' => 4, 'desc' => '已完成', 'tip' => '体格检查 2024-08-09 08:30:33', + 'more' => 0 ], [ 'time' => '08:50', 'name' => '超声科', 'status' => 2, 'desc' => '第5位,预计等待 11 分钟', 'tip' => '腹部彩超', + 'more' => 0 ], [ 'time' => '09:20', 'name' => '心电图', @@ -63,36 +68,42 @@ class FenzhenController extends Controller 'tip' => '剩余5项正在排队中,', 'more' => 1 ], [ - 'time' => '10:03', + 'time' => $end_time, 'name' => '体检结束', 'status' => -1, - 'desc' => '早餐时间 10:03' + 'desc' => '用餐时间 ' . $end_time, + 'tip' => '', + 'more' => 0 ], [ 'time' => '', 'name' => '出具报告', 'status' => -1, - 'desc' => '预计 9月23日 出具体检报告' + 'desc' => '预计 9月23日 出具体检报告', + 'tip' => '', + 'more' => 0 ], [ 'time' => '', 'name' => '报告解读', 'status' => -1, - 'desc' => '预计 9月24日 可以预约报告解读' + 'desc' => '预计 9月24日 可以预约报告解读', + 'tip' => '', + 'more' => 0 ]], ]); } public function info() { - $id =request('id'); - $info=DB::table('orders')->where(['id'=>$id])->whereIn('status',[2,4])->get(); - if(!$info) return \Yz::echoError1("查询就诊人订单失败"); + $id = request('id'); + $info = DB::table('orders')->where(['id' => $id])->whereIn('status', [2, 4])->get(); + if (!$info) return \Yz::echoError1("查询就诊人订单失败"); return \Yz::Return(true, "获取成功", [ 'info' => [ 'name' => $info->name, 'sex' => $info->sex, 'combo_name' => $info->title, 'check_date' => $info->appointment_date, - 'start_time' => $info->appointment_time, + 'start_time' => $info->appointment_time, 'end_time' => '10:25', 'qrcode' => '', 'code' => $info->appointment_number, // 体检条码 diff --git a/h5/pages/user/fenzhen/fenzhen.vue b/h5/pages/user/fenzhen/fenzhen.vue index dd2f9db..5ae6f71 100644 --- a/h5/pages/user/fenzhen/fenzhen.vue +++ b/h5/pages/user/fenzhen/fenzhen.vue @@ -18,9 +18,27 @@ useStore } from '@/store' const $store = useStore() + const $props = defineProps({ + id: { + type: String, + default: '0' + } + }); - const mountedAction = () => { + const fenzhen_list = ref(false) + const getFenzhenList = async () => { + uni.showLoading() + const response = await $api('FenzhenList', { + id: $props.id + }) + uni.hideLoading() + $response(response, () => { + fenzhen_list.value = response.data + }) + } + const mountedAction = () => { + getFenzhenList() } const config_ref = ref(null) @@ -31,6 +49,30 @@ } } + const timeShow = (time) => { + let time_array = time.split(':') + return `${time_array[0]}:${time_array[1]}` + } + + const tip_show = ref(false) + const tip_content = ref("") + const getTipContent = async () => { + uni.showLoading() + const response = await $api('GetReadme') + uni.hideLoading() + $response(response, () => { + tip_content.value = response.data.content + tip_show.value = true + }) + } + const tipShowClick = () => { + if (!!tip_content.value) { + tip_show.value = true + } else { + getTipContent() + } + } + onShow(() => { if (!!config_ref.value) { mountedAction() @@ -42,8 +84,466 @@ + + + + + + + + + + + + {{ fenzhen_list.info.name }} + {{ fenzhen_list.info.sex === 1 ? '男士' : '女士' }} + + + + 体检套餐: + {{ fenzhen_list.info.combo_name }} + + + 体检日期: + {{ fenzhen_list.info.check_date }} + + + + 体检注意事项 + + + + + 开始体检时间 + {{ timeShow(fenzhen_list.info.start_time) }} + — 预计结束时间 + {{ timeShow(fenzhen_list.info.end_time) }} + + + + + + 尊敬的客户,为了使您的体检流程更加顺畅,请按以下步骤提 示顺序逐项完成体检。 + + + + 自助导检 + + + + {{ i.time }} + + + + + + + + + + {{ k + 1 }}.{{ i.name }} + {{ i.desc }} + + + + {{ i.tip }} + 查看详情>> + + + + + + \ No newline at end of file diff --git a/h5/pages/user/pick/pick.vue b/h5/pages/user/pick/pick.vue index 8772cdb..136d56d 100644 --- a/h5/pages/user/pick/pick.vue +++ b/h5/pages/user/pick/pick.vue @@ -39,12 +39,33 @@ getPersonList(); } }; - const choosePersonClick = async (info) => { - uni.navigateTo({ - url: '/pages/user/fenzhen/fenzhen' + uni.showLoading() + const response = await $api('FenzhenCheck', { + id_number: info.id_number }) - }; + uni.hideLoading() + $response(response, () => { + if (response.data.list.length > 0) { + let id = 0 + for (let i in response.data.list) { + let datetime = `${response.data.list[i].appointment_date} ${response.data.list[i].appointment_time}` + if (id === 0 && (new Date(datetime) / 1) > (new Date() / 1)) { + id = response.data.list[i].id + break + } + } + if (id === 0) { + id = response.data.list[response.data.list.length - 1].id + } + uni.navigateTo({ + url: `/pages/user/fenzhen/fenzhen?id=${id}` + }) + } else { + uni.$lu.toast('暂无体检信息') + } + }) + } onShow(() => { if (!!config_ref.value) {