From d5c9ee5f7969b0740884b4793ed03a041f3f69bb Mon Sep 17 00:00:00 2001 From: yanzai Date: Fri, 7 Feb 2025 15:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/API/H5/PayController.php | 11 +++- h5/pages/buy/done/yuyue_done.vue | 2 +- h5/pages/main/order/CheckPay.vue | 13 +++- h5/pages/main/tjyy/tjyy.vue | 2 + h5/pages/main/yytjsj/yytjsj_new.vue | 62 ++++++++++++++++--- 5 files changed, 73 insertions(+), 17 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/PayController.php b/Laravel/app/Http/Controllers/API/H5/PayController.php index f1a9a0d..ea39124 100644 --- a/Laravel/app/Http/Controllers/API/H5/PayController.php +++ b/Laravel/app/Http/Controllers/API/H5/PayController.php @@ -93,11 +93,16 @@ class PayController extends Controller 'status' => 2, 'pay_time' => date('Y-m-d H:i:s'), ]); - $Finish = new OrderController();//预约体检 - $Finish->Finish($order_number); + $is_yuyue=false;//是否已经勾选号源 + if(!!$order->plan_id){ + $is_yuyue=true; + $Finish = new OrderController();//预约体检 + $Finish->Finish($order_number); + } + } - return \Yz::Return(true, "支付成功", ['id' => $order->id]); + return \Yz::Return(true, "支付成功", ['id' => $order->id,'is_yuyue'=>$is_yuyue]); } else { return \Yz::echoError1("支付失败" . $res['data']['trade_state']); } diff --git a/h5/pages/buy/done/yuyue_done.vue b/h5/pages/buy/done/yuyue_done.vue index d047c9f..c04a159 100644 --- a/h5/pages/buy/done/yuyue_done.vue +++ b/h5/pages/buy/done/yuyue_done.vue @@ -140,7 +140,7 @@ --> - + 查看预约记录 diff --git a/h5/pages/main/order/CheckPay.vue b/h5/pages/main/order/CheckPay.vue index e25a8bc..ed44725 100644 --- a/h5/pages/main/order/CheckPay.vue +++ b/h5/pages/main/order/CheckPay.vue @@ -30,9 +30,16 @@ uni.showToast({ title: '支付成功' }); - uni.redirectTo({ - url: '/pages/buy/done/done?id='+response.data.id - }); + if(response.data.is_yuyue){ + uni.redirectTo({ + url: '/pages/buy/done/yuyue_done?id='+response.data.id + }); + }else{ + uni.redirectTo({ + url: '/pages/buy/done/done?id='+response.data.id + }); + } + } }) } diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue index 27e1dc2..6e417b5 100644 --- a/h5/pages/main/tjyy/tjyy.vue +++ b/h5/pages/main/tjyy/tjyy.vue @@ -196,6 +196,7 @@ const getnmrList = async () => { itemsInfo.value = response.data.items_info; truePrice.value = response.data.true_price; erxianInfo.value=response.data.nmr_list2; + yytjInfo.value.erxianInfo=erxianInfo.value; netReceiptsPrice.value = response.data.true_price; if(itemsInfo.value.items?.length){//合并显示材料费 let cailiao_price=0 @@ -264,6 +265,7 @@ const getnmrList = async () => { } uni.hideLoading(); }); + $store.setYytjInfo(yytjInfo.value); }; const toPlan=async ()=>{ uni.navigateTo({ diff --git a/h5/pages/main/yytjsj/yytjsj_new.vue b/h5/pages/main/yytjsj/yytjsj_new.vue index ad8fb39..6c642c4 100644 --- a/h5/pages/main/yytjsj/yytjsj_new.vue +++ b/h5/pages/main/yytjsj/yytjsj_new.vue @@ -358,13 +358,13 @@ let plan_nmr_id = ""; uni.showLoading(); console.log(yytjInfo.value?.nmr_list); - for (let i = 0; i < yytjInfo.value?.nmr_list?.length; i++) { - if (!yytjInfo.value?.nmr_list[i].id) { - uni.$lu.toast("请完善预约时间"); - uni.hideLoading(); - return; - } - } + // for (let i = 0; i < yytjInfo.value?.nmr_list?.length; i++) { + // if (!yytjInfo.value?.nmr_list[i].id) { + // uni.$lu.toast("请完善预约时间"); + // uni.hideLoading(); + // return; + // } + // } if (yytjInfo.value?.nmr_list?.length > 1) { @@ -383,7 +383,7 @@ group_id: buyInfo.value.group_id, combo_id:buyInfo.value.group_id?"":buyInfo.value?.combo_id, item_ids: buyInfo.value.item_ids, - plan_id: plan_id, + plan_id: tj_plan_id.value, plan_nmr_info:yytjInfo.value?.nmr_list || null, doctor: yytjInfo.value?.doctor_name || "", duo_xuan_yi: $store.getDuoXuanYi(), @@ -391,7 +391,7 @@ yucunkuan: yytjInfo.value.prepaidPrice?yytjInfo.value.prepaidPrice:0, coupon_id:yytjInfo.value?.couponId || null, wj: buyInfo.value.wj, - erxian_info:erxianInfo.value, + erxian_info:yytjInfo.value.erxianInfo, peiou_info:$store.getPeiOuUser()//配偶信息 }; console.log(obj); @@ -402,7 +402,7 @@ StartPay(response.data.orderid); } else { uni.navigateTo({ - url: "/pages/buy/done/done?id=" + response.data.orderid, + url: "/pages/buy/done/yuyue_done?id=" + response.data.orderid, }); } } @@ -440,6 +440,48 @@ } }); } + //跳转支付 + const StartPay = async (id) => { + //继续支付 + uni.showLoading(); + 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; + console.log(p); + wx.miniProgram.navigateTo({ + url: + "/pages/other/entry/index?path=/pages/physical-examination/payment/index" + + p, + }); + } + }); + }; //改变日期 const DateChange = (date) => { selectedDate.value = date