From efca93d403ff255f8b7b55501f5f889abff63a05 Mon Sep 17 00:00:00 2001 From: yanzai Date: Thu, 26 Sep 2024 14:30:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=86=E8=8A=82=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E8=BD=AC=20=E6=8A=A5=E5=91=8A=E8=A7=A3=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/H5/ComboController.php | 16 +++--- .../Controllers/API/H5/HomeController.php | 4 +- .../Controllers/API/H5/OrderController.php | 5 +- .../Controllers/API/H5/UserController.php | 10 ++++ h5/pages/main/index/index.vue | 9 +++- h5/pages/main/order/CheckPay.vue | 3 ++ h5/pages/main/order/order.vue | 8 ++- h5/pages/main/order/src/order.vue | 49 ++++++++++++++----- 8 files changed, 77 insertions(+), 27 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 6eab0e9..4e1c38c 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -200,7 +200,7 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group $group_id = request('group_id'); //团检登记id if (!isset($hospital_id)) return \Yz::echoError1("医院id不能为空"); $hospital = DB::table('hospitals')->where(['id' => 1, 'status' => 1, 'is_del' => 0])->first(); - $combo_info = [];//套餐信息 + $combo_info = false;//套餐信息 $pay_item_count = 0;//需自费项目个数 $all_original_price = 0; $true_price = 0; @@ -254,7 +254,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4) $pay_item_count += $combo->item_count; $true_price += $combo_info['price']; } - $items_info = [];//自选项目信息 + $items_info = false;//自选项目信息 if (isset($item_ids) and !empty($item_ids)) { $price = 0; $items_original_price = 0; @@ -350,13 +350,13 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4) 'group_info' => $group_info, 'combo_info' => $combo_info, 'items_info' => $items_info, - 'integral_money' => $integral_money, - 'save_money' => $save_money, - 'coupon_money' => $coupon_money, - 'true_price' => $true_price,//需要用户支付的金的 - 'original_price' => $all_original_price,//总原价 + 'integral_money' => number_format($integral_money, 2, '.', ''), + 'save_money' =>number_format($save_money, 2, '.', ''), + 'coupon_money' => number_format($coupon_money, 2, '.', ''), + 'true_price' =>number_format($true_price, 2, '.', ''),//需要用户支付的金的 + 'original_price' =>number_format($all_original_price, 2, '.', '') ,//总原价 'pay_item_count' => $pay_item_count,//需要付费的项目数量 - 'lose_price'=>$lose_price,//剩余的不用就会浪费的金额 + 'lose_price'=>number_format($lose_price, 2, '.', ''),//剩余的不用就会浪费的金额 'nmr_list' => [[ 'item_id' => "1", "name" => "磁共振平扫(腰椎)" diff --git a/Laravel/app/Http/Controllers/API/H5/HomeController.php b/Laravel/app/Http/Controllers/API/H5/HomeController.php index b17aea2..2b37280 100644 --- a/Laravel/app/Http/Controllers/API/H5/HomeController.php +++ b/Laravel/app/Http/Controllers/API/H5/HomeController.php @@ -58,9 +58,9 @@ class HomeController extends Controller 'jump' => '/pages/main/cjwt/cjwt', 'icon' => '/assets/h5/changjianwenti.png' ], [ - 'message' => '暂未开放', + 'message' => '', 'name' => '预检咨询', - 'jump' => '/pages/main/cjwt/cjwt', + 'jump' => 'XCX/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1035&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904', 'icon' => '/assets/h5/changjianwenti.png' ], [ 'message' => '暂未开放', diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index 9a57ae2..20cf846 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -102,6 +102,7 @@ class OrderController extends Controller $group_id = request('group_id');//团检id $item_ids = request('item_ids');//自选item的ids $plan_id = request('plan_id');//号源id + $plan_nmr_id = request('plan_nmr_id');//核磁号源id if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空'); if (!isset($openid)) return \Yz::echoError1('openid不能为空'); @@ -294,7 +295,7 @@ class OrderController extends Controller //如果是免费的,直接去预约 $yuyue= self::Finish($order_num); if($yuyue['status']===true){ - return \Yz::return(true, "操作成功", ['action' => $action]); + return \Yz::return(true, "操作成功", ['action' => $action,'orderid'=>$insert]); }else{ return \Yz::echoError1($yuyue['msg']); } @@ -303,7 +304,7 @@ class OrderController extends Controller //如果大于0则提示前端去支付 $action="pay"; } - return \Yz::return(true, "操作成功", ['action' => $action]); + return \Yz::return(true, "操作成功", ['action' => $action,'orderid'=>$insert]); } else { DB::rollBack(); return \Yz::echoError1('操作失败'); diff --git a/Laravel/app/Http/Controllers/API/H5/UserController.php b/Laravel/app/Http/Controllers/API/H5/UserController.php index 5ea4349..9e348f5 100644 --- a/Laravel/app/Http/Controllers/API/H5/UserController.php +++ b/Laravel/app/Http/Controllers/API/H5/UserController.php @@ -145,6 +145,16 @@ class UserController extends Controller 'birthday' => '1990-01-01', 'patientType' => '1', 'marriage' => '1', + ], + [ + 'ghzid' => 'ghz22555', + 'idNumber'=>'411329199901052356', + 'name' => '信息科1', + 'phone' => '222222222', + 'sex' => '1', + 'birthday' => '1990-01-01', + 'patientType' => '1', + 'marriage' => '1', ] ]; } diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 3e9cbb4..4b38830 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -37,7 +37,12 @@ if ('message' in info && !!info.message) { uni.$lu.toast(info.message) } else { - if (info.jump.indexOf('http') !== -1) { + if (info.jump.indexOf('XCX') !== -1) { + let url =info.jump.slice(3) + wx.miniProgram.navigateTo({ + url: url + }) + }else (info.jump.indexOf('http') !== -1) { window.location.href = info.jump } else { if (switch_arr.includes(info.jump)) { @@ -255,7 +260,7 @@ - + 09261052 diff --git a/h5/pages/main/order/CheckPay.vue b/h5/pages/main/order/CheckPay.vue index 7581c64..9385f49 100644 --- a/h5/pages/main/order/CheckPay.vue +++ b/h5/pages/main/order/CheckPay.vue @@ -30,6 +30,9 @@ uni.showToast({ title: '支付成功' }); + uni.redirectTo({ + url: '/pages/main/order/order' + }); } }) } diff --git a/h5/pages/main/order/order.vue b/h5/pages/main/order/order.vue index 646c06e..30271db 100644 --- a/h5/pages/main/order/order.vue +++ b/h5/pages/main/order/order.vue @@ -7,7 +7,8 @@ import { ref, computed, - nextTick + nextTick, + provide } from 'vue' import { $api, @@ -88,6 +89,11 @@ status_active.value = status }) } + provide('ReLoadOrderList', (value) => { + if(value=="orderUpdate"){ + getOrderList() + } + }); onShow(() => { if (!!config_ref.value) { diff --git a/h5/pages/main/order/src/order.vue b/h5/pages/main/order/src/order.vue index 197a154..d99439a 100644 --- a/h5/pages/main/order/src/order.vue +++ b/h5/pages/main/order/src/order.vue @@ -6,7 +6,8 @@ */ import { ref, - onMounted + onMounted, + inject } from 'vue' import { $api, @@ -15,7 +16,7 @@ import { onShow } from '@dcloudio/uni-app' -import wx from 'weixin-js-sdk' + import wx from 'weixin-js-sdk' const $props = defineProps({ info: { type: Object, @@ -52,24 +53,45 @@ import wx from 'weixin-js-sdk' order_info.value.status = 3 } } - const StartPay=async(id)=>{//继续支付 + const StartPay = async (id) => { //继续支付 uni.showLoading() - const response = await $api('StartPay' ,{ + const response = await $api('StartPay', { openid: localStorage.getItem('OPENID'), id: id, }) uni.hideLoading() $response(response, () => { - if(response.status){ - let info=response.data.info - let p='&appid='+info.appid+'&sub_org_code='+info.sub_org_code+'&ghzid='+info.ghzid+'&orderid='+info.orderid+'&order_desc='+info.order_desc+'&amount='+info.amount+'¬ify_url='+info.notify_url+'×tamp='+info.timestamp+'&nonce='+info.nonce+'&signature='+info.signature; + if (response.status) { + let info = response.data.info + let p = '&appid=' + info.appid + '&sub_org_code=' + info.sub_org_code + '&ghzid=' + info + .ghzid + '&orderid=' + info.orderid + '&order_desc=' + info.order_desc + '&amount=' + + info.amount + '¬ify_url=' + info.notify_url + '×tamp=' + info.timestamp + + '&nonce=' + info.nonce + '&signature=' + info.signature; console.log(p); wx.miniProgram.navigateTo({ - url: '/pages/other/entry/index?path=/pages/physical-examination/payment/index'+p + url: '/pages/other/entry/index?path=/pages/physical-examination/payment/index' + + p }) } }) } + const ReLoadOrderList = inject('ReLoadOrderList'); + const Refound = async (id) => { + uni.showLoading() + const response = await $api('Refund', { + openid: localStorage.getItem('OPENID'), + id: id, + }) + uni.hideLoading() + $response(response, () => { + if (response.status) { + uni.showToast({ + title: '退款完成' + }); + ReLoadOrderList("orderUpdate"); + } + }) + } onMounted(() => { deepInfo() @@ -136,9 +158,12 @@ import wx from 'weixin-js-sdk' - 继续付款 - 改约 - 退款 + 继续付款 + + 改约 + 退款 查看报告 @@ -232,7 +257,7 @@ import wx from 'weixin-js-sdk' line-height: 1; margin-top: 28rpx; text-align: right; - margin-right: 30rpx; + margin-right: 30rpx; font-size: 26rpx; }