From d69ba1b4eb0bf1f0a4f9a2e9c410a3af8aee569d Mon Sep 17 00:00:00 2001 From: yanzai Date: Sat, 1 Mar 2025 20:07:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=84=E7=A7=8D=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Admin/YeWu/OrderController.php | 3 +- .../Controllers/API/H5/ComboController.php | 62 +++++----- .../Controllers/API/H5/OrderController.php | 6 +- .../Controllers/API/H5/OrderNewController.php | 3 + .../Http/Controllers/API/H5/PayController.php | 9 +- .../API/H5/QuestionnaireController.php | 12 +- Laravel/app/Services/OrderService.php | 9 +- admin/.env.production | 4 +- admin/src/views/OrderMngr/Order.vue | 9 ++ h5/common/WeeklyCalendar.vue | 2 +- h5/config.js | 4 +- h5/pages/main/ctime/ctime.vue | 1 + h5/pages/main/index/index.vue | 2 +- h5/pages/main/order/order.vue | 29 +++-- h5/pages/main/order/src/order.vue | 112 ++++++++++++++++-- h5/pages/main/tj/tjxq.vue | 9 +- 16 files changed, 204 insertions(+), 72 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php index a8d332d..8711725 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php @@ -54,7 +54,8 @@ class OrderController extends Controller { $info = request('info'); $date = [ - 'note' => $info['note'] + 'note' => $info['note'], + 'youxiaoqi_end' => $info['youxiaoqi_end'], ]; $u = DB::table('orders')->where(['id' => $info['id']])->update($date); if ($u) { diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 7bf572f..33d25eb 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -116,6 +116,36 @@ class ComboController extends Controller $canshu[] = '%'.$search.'%'; } + + if(isset($keshi_name)){ + $combo_ids=DB::table('combo_items')->where(['status'=>1,'keshi_name'=>$keshi_name]) ->pluck('combo_id')->toArray(); + $count = count($combo_ids); + $placeholders = implode(', ', array_fill(0, $count, '?')); + if(count($combo_ids)>0){ + $sql = $sql . " and a.combo_id in ($placeholders) "; + $canshu =array_merge($canshu, $combo_ids); + }else{ + $sql = $sql . " and a.combo_id in (?) "; + $canshu =array_merge($canshu, [0]); + } + } + if(isset($combo_item)){ + $combo_ids=DB::table('combo_items')->whereIn('item_id',$combo_item)->where(['status'=>1]) + ->groupBy('combo_id') + ->havingRaw('COUNT(DISTINCT item_id) = '.count($combo_item)) + ->pluck('combo_id')->toArray(); + $count = count($combo_ids); + $placeholders = implode(', ', array_fill(0, $count, '?')); + if(count($combo_ids)>0){ + $sql = $sql . " and a.combo_id in ($placeholders) "; + $canshu =array_merge($canshu, $combo_ids); + }else{ + $sql = $sql . " and a.combo_id in (?) "; + $canshu =array_merge($canshu, [0]); + } + + + } if(isset($sort_price) and $sort_price==1) $combo_sort=3; if(isset($sort_price) and $sort_price==2) $combo_sort=4; if(isset($sort_sale_count) and $sort_sale_count==1) $combo_sort=7; @@ -147,39 +177,9 @@ class ComboController extends Controller $sql = $sql . " order by a.sale_count desc"; } } - if (!isset($combo_sort)) { + if (!isset($combo_sort) or $combo_sort == 1) { $sql = $sql . " order by a.order "; } - if(isset($keshi_name)){ - $combo_ids=DB::table('combo_items')->where(['status'=>1,'keshi_name'=>$keshi_name]) ->pluck('combo_id')->toArray(); - $count = count($combo_ids); - $placeholders = implode(', ', array_fill(0, $count, '?')); - if(count($combo_ids)>0){ - $sql = $sql . " and a.combo_id in ($placeholders) "; - $canshu =array_merge($canshu, $combo_ids); - }else{ - $sql = $sql . " and a.combo_id in (?) "; - $canshu =array_merge($canshu, [0]); - } - } - if(isset($combo_item)){ - $combo_ids=DB::table('combo_items')->whereIn('item_id',$combo_item)->where(['status'=>1]) - ->groupBy('combo_id') - ->havingRaw('COUNT(DISTINCT item_id) = '.count($combo_item)) - ->pluck('combo_id')->toArray(); - $count = count($combo_ids); - $placeholders = implode(', ', array_fill(0, $count, '?')); - if(count($combo_ids)>0){ - $sql = $sql . " and a.combo_id in ($placeholders) "; - $canshu =array_merge($canshu, $combo_ids); - }else{ - $sql = $sql . " and a.combo_id in (?) "; - $canshu =array_merge($canshu, [0]); - } - - - } - $combos = DB::select("select * from combos as a LEFT JOIN ( diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index bccbf24..5d784c7 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -914,20 +914,20 @@ class OrderController extends Controller "可选项目信息" => $item_arr, "总计金额" => $order_info->price, ]; - if ($order_info->wj_flag == 1) { + // if ($order_info->wj_flag == 1) { $temp = []; foreach ($item_arr as $k => $item) { $temp[] = [ "Id" => $item['Id'], "已收费" => $item['已收费'], "优惠方式" => "打折", - "优惠值" => config('app.globals.Wj_ZheKou') + "优惠值" => config('app.globals.ZiXuan_ZheKou') ]; } $cad2 = [ "可选项目信息" => $temp, ]; - } + // } $cad = array_merge($cad, $cad2); } else { if(isset($buy_info['group']['items']) and $buy_info['group']['have_Nx1']===true){ diff --git a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php index 9f0a4be..953f73c 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php @@ -548,6 +548,9 @@ class OrderNewController extends Controller 'updated_at' => date('Y-m-d H:i:s') ]; $u = DB::table('orders')->where(['id' => $orderid])->update($data); + $up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([ + 'status' => 2 + ]); if(!$u) return \Yz::echoError1("预约失败"); $Finish = new OrderController();//预约体检 $yuyue= $Finish->Finish($order->order_number); diff --git a/Laravel/app/Http/Controllers/API/H5/PayController.php b/Laravel/app/Http/Controllers/API/H5/PayController.php index 7e0fea7..e8a4d43 100644 --- a/Laravel/app/Http/Controllers/API/H5/PayController.php +++ b/Laravel/app/Http/Controllers/API/H5/PayController.php @@ -54,6 +54,11 @@ class PayController extends Controller $randomPart = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 6); $new_ordernumber=substr($orderInfo->order_number, 0, -6); $new_ordernumber=$new_ordernumber.$randomPart; + DB::table('order_number_change_logs')->insert([ + 'order_id' => $id, + 'old_order_number' => $orderInfo->order_number, + 'new_order_number' => $new_ordernumber, + ]); $u=DB::table('orders')->where(['id' => $id,])->update(['order_number'=>$new_ordernumber]); if(!$u) return \Yz::echoError1("更新订单号失败"); $XCXApi = new XCXApiController(); @@ -116,13 +121,15 @@ class PayController extends Controller //判断订单状态是否是已经支付,判断是否到检, $openid = request('openid'); $id = request('id'); + $yuanyin = request('yuanyin'); + if(!isset($id)) return \Yz::echoError1("id不能为空"); $orderInfo = DB::table('orders')->where(['id' => $id,])->first(); if(!$orderInfo) return \Yz::echoError1("未找到有效订单"); $userInfo = DB::table('web_users')->where(['id' => $orderInfo->web_user_id])->first(); if($openid != $userInfo->openid) return \Yz::echoError1("无权操作此订单"); $service = new OrderService(); - $res=$service->Refund($id); + $res=$service->Refund($id,$yuanyin); if(!$res['status']) return \Yz::echoError1($res['msg']); if($res['status']) return \Yz::Return(true, "退款成功", []); diff --git a/Laravel/app/Http/Controllers/API/H5/QuestionnaireController.php b/Laravel/app/Http/Controllers/API/H5/QuestionnaireController.php index 800f9d1..1c94581 100644 --- a/Laravel/app/Http/Controllers/API/H5/QuestionnaireController.php +++ b/Laravel/app/Http/Controllers/API/H5/QuestionnaireController.php @@ -113,14 +113,14 @@ class QuestionnaireController extends Controller $v = str_replace('${今日日期}',$person->birthday , $v); if ($v == '${省市县}') { $v = [[ - 'value' => '11', - 'text' => '北京市' + 'value' => '46', + 'text' => '海南省' ], [ - 'value' => '1101', - 'text' => '市辖区' + 'value' => '4601', + 'text' => '海口市' ], [ - 'value' => '110101', - 'text' => '东城区' + 'value' => '460105', + 'text' => '秀英区' ]]; } $item_data['value'] = $v; diff --git a/Laravel/app/Services/OrderService.php b/Laravel/app/Services/OrderService.php index dd86aac..df29d1d 100644 --- a/Laravel/app/Services/OrderService.php +++ b/Laravel/app/Services/OrderService.php @@ -193,7 +193,7 @@ class OrderService ]); return true; } - public function Refund($id) + public function Refund($id,$yuanyin='') { $orderInfo = DB::table('orders')->where(['id' => $id])->first(); if (!$orderInfo) return ['status'=>false,'msg'=>"未找到有效订单"]; @@ -235,14 +235,17 @@ class OrderService } } - + $refund_yuanyin="体检H5订单退款"; + if(isset($yuanyin) and!empty($yuanyin)){ + $refund_yuanyin=$yuanyin; + } //如果真实支付大于0 则调用小程序退款 if ($orderInfo->true_price > 0) { $data = [ 'orderid' => $orderInfo->order_number, 'refund_order_id' => 'T' . $orderInfo->order_number, 'refund_amount' => (int)($orderInfo->true_price * 100), - 'refund_reason' => "体检H5订单退款", + 'refund_reason' => $refund_yuanyin, ]; $XCX = new XCXApiController(); $res = $XCX::Post('订单退款', $data); diff --git a/admin/.env.production b/admin/.env.production index 408d4e9..895cd7d 100644 --- a/admin/.env.production +++ b/admin/.env.production @@ -1,4 +1,4 @@ ENV = 'production' -VITE_APP_API = 'http://124.225.137.54:39081/api/' -VITE_APP_FILE = 'http://124.225.137.54:39081' +VITE_APP_API = 'https://tj-h5.hnxdfe.com/api/' +VITE_APP_FILE = 'https://tj-h5.hnxdfe.com' diff --git a/admin/src/views/OrderMngr/Order.vue b/admin/src/views/OrderMngr/Order.vue index 49f5ed4..a910554 100644 --- a/admin/src/views/OrderMngr/Order.vue +++ b/admin/src/views/OrderMngr/Order.vue @@ -113,6 +113,15 @@ {{Info.pay_time}} + + + + {{Info.appointment_date}} {{Info.appointment_time}} diff --git a/h5/common/WeeklyCalendar.vue b/h5/common/WeeklyCalendar.vue index 88da766..6779666 100644 --- a/h5/common/WeeklyCalendar.vue +++ b/h5/common/WeeklyCalendar.vue @@ -4,7 +4,7 @@ {{item.date.split('-').slice(1).join('/')}} - {{ item.xingqi.replace('星期', '周').replace('日', '天')}} + {{ item.xingqi.replace('星期', '周')}} 余{{item.count}} diff --git a/h5/config.js b/h5/config.js index ac2205a..8d29e36 100644 --- a/h5/config.js +++ b/h5/config.js @@ -1,7 +1,7 @@ const app_type = 'gzh' //const base_url = "https://api.hainan2024.sa0.online" //开发环境 -//const base_url="https://tj-h5.hnxdfe.com" //正式环境 -const base_url="http://124.225.137.54:39081" //测试环境 +const base_url="https://tj-h5.hnxdfe.com" //正式环境 +//const base_url="http://124.225.137.54:39081" //测试环境 const config = { api_map_url: base_url + '/api/ApiMap/h5', base_assets_url: base_url, diff --git a/h5/pages/main/ctime/ctime.vue b/h5/pages/main/ctime/ctime.vue index c77be05..3cbc0b5 100644 --- a/h5/pages/main/ctime/ctime.vue +++ b/h5/pages/main/ctime/ctime.vue @@ -86,6 +86,7 @@ use_type: orderInfo.value.type, checkup_type_id: orderInfo.value.checkup_type_id, amount: orderInfo.value.true_price, + combo_id: orderInfo.value.combo_id?orderInfo.value.combo_id:"" } const response = await $api("GetDayPlanList", data); uni.hideLoading(); diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 0d452e9..35b2cff 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -313,7 +313,7 @@ - 02272247 + 03010911 diff --git a/h5/pages/main/order/order.vue b/h5/pages/main/order/order.vue index 5765616..8b4bcbc 100644 --- a/h5/pages/main/order/order.vue +++ b/h5/pages/main/order/order.vue @@ -49,15 +49,28 @@ import DraggableButton from "@/pages/components/goHome.vue"; status_allow = [2] break; case '3': - status_allow = [3, 5] + status_allow = [2] break; case '4': - status_allow = [4,6] + status_allow = [3,4,5,6] break; } for (let i in order_list.value) { + if (status_allow.includes(order_list.value[i].status)) { - list.push(order_list.value[i]) + if(status_active.value=='2' ){ + if (order_list.value[i].appointment_number == null) { + list.push(order_list.value[i]); + } + }else if(status_active.value=='3' ){ + if (order_list.value[i].appointment_number != null && order_list.value[i].appointment_number != '') { + list.push(order_list.value[i]); + } + } + else{ + list.push(order_list.value[i]) + } + } } return list @@ -78,14 +91,14 @@ import DraggableButton from "@/pages/components/goHome.vue"; label: '待支付', value: '1' }, { - label: '进行中', + label: '待预约', value: '2' }, { - label: '已完成', - value: '4' - }, { - label: '已关闭', + label: '进行中', value: '3' + }, { + label: '已结束', + value: '4' }]) const statusClick = (status) => { status_active.value = '-1' diff --git a/h5/pages/main/order/src/order.vue b/h5/pages/main/order/src/order.vue index affa3cf..e1e3b8d 100644 --- a/h5/pages/main/order/src/order.vue +++ b/h5/pages/main/order/src/order.vue @@ -7,7 +7,8 @@ import { ref, onMounted, - defineEmits + defineEmits, + nextTick } from "vue"; import { $api, @@ -100,14 +101,22 @@ }; const emit = defineEmits(); + let tuikuan_tishi=ref(''); + let TuiKuanPopupRef=ref(null); const Refound = async (order) => { - let content='确定要为 '+order.title+' 退款吗?' + + tuikuan_tishi.value='确定要为 '+order.title+' 退款吗?' if(order.appointment_date?.length>0){ - content='您已经预约'+order.appointment_date+'的体检,'+content; + tuikuan_tishi.value='您已经预约'+order.appointment_date+'的体检,'+content; } + + TuiKuanPopupRef.value.open() + + return false; + uni.showModal({ title: '提示', - content: content, + content: tuikuan_tishi.value, success: function (res) { if (res.confirm) { tuikuan(order.id) @@ -118,11 +127,40 @@ }); }; + let tuikuan_yuanyin_list=ref([ + { + name:"不需要了", + value:"不需要了" + }, + { + name:"点错体检项目了", + value:"点错体检项目了" + }, + { + name:"已在其他医院体检", + value:"已在其他医院体检" + }, + { + name:"其他原因", + value:"其他原因" + } + ]) + let tuikuan_yuanyin=ref('') + const tuikuanRadioChange=(evt)=>{ + for (let i = 0; i < tuikuan_yuanyin_list.value.length; i++) { + if (tuikuan_yuanyin_list.value[i].value === evt.detail.value) { + tuikuan_yuanyin.value = tuikuan_yuanyin_list.value[i].value; + break; + } + } + } const tuikuan=async(id)=>{ + console.log(tuikuan_yuanyin.value) uni.showLoading(); const response = await $api("Refund", { openid: localStorage.getItem("OPENID"), id: id, + yuanyin:tuikuan_yuanyin.value }); uni.hideLoading(); $response(response, () => { @@ -298,6 +336,7 @@ }); } + onMounted(() => { deepInfo(); @@ -305,6 +344,30 @@