From 8276fe00d13131fd62c9a587ac5b4ff7d7bd11e9 Mon Sep 17 00:00:00 2001 From: yanzai Date: Wed, 5 Feb 2025 15:27:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/API/ApiMapController.php | 2 + .../API/H5/CheckUpTypeController.php | 11 +- .../Controllers/API/H5/HomeController.php | 25 + .../Controllers/API/H5/OrderController.php | 16 +- .../Controllers/API/H5/OrderNewController.php | 408 +++ Laravel/routes/web.php | 2 + h5/common/Top.vue | 158 ++ h5/config.js | 3 +- h5/manifest.json | 11 + h5/pages.json | 40 +- h5/pages/buy/choose/choose.vue | 12 +- h5/pages/main/combo/combo(旧).vue | 1068 ++++++++ h5/pages/main/combo/combo.vue | 2204 +++++++++-------- h5/pages/main/combo/combo_new.vue | 1170 --------- h5/pages/main/order/order_new.vue | 193 ++ h5/pages/main/tj/tjxq(旧).vue | 559 +++++ h5/pages/main/tj/tjxq.vue | 410 +-- h5/pages/main/tj/tjxq_new.vue | 567 ----- h5/pages/main/tj/tjzx(旧).vue | 595 +++++ h5/pages/main/tj/tjzx.vue | 1121 +++++---- h5/pages/main/tj/tjzx_new.vue | 626 ----- .../main/tjyy/{tjyy_new.vue => tjyy(旧).vue} | 331 ++- h5/pages/main/tjyy/tjyy.vue | 343 +-- 23 files changed, 5337 insertions(+), 4538 deletions(-) create mode 100644 Laravel/app/Http/Controllers/API/H5/OrderNewController.php create mode 100644 h5/common/Top.vue create mode 100644 h5/pages/main/combo/combo(旧).vue delete mode 100644 h5/pages/main/combo/combo_new.vue create mode 100644 h5/pages/main/order/order_new.vue create mode 100644 h5/pages/main/tj/tjxq(旧).vue delete mode 100644 h5/pages/main/tj/tjxq_new.vue create mode 100644 h5/pages/main/tj/tjzx(旧).vue delete mode 100644 h5/pages/main/tj/tjzx_new.vue rename h5/pages/main/tjyy/{tjyy_new.vue => tjyy(旧).vue} (67%) diff --git a/Laravel/app/Http/Controllers/API/ApiMapController.php b/Laravel/app/Http/Controllers/API/ApiMapController.php index 83274bd..e08b6d4 100644 --- a/Laravel/app/Http/Controllers/API/ApiMapController.php +++ b/Laravel/app/Http/Controllers/API/ApiMapController.php @@ -86,6 +86,8 @@ class ApiMapController extends Controller 'SendMsgCode' => $base_url . '/api/H5/SendMsgCode', // 发送验证码 'CheckMsgCode' => $base_url . '/api/H5/CheckMsgCode', // 验证验证码 'CheckEnableNmrTime' => $base_url . '/api/H5/CheckEnableNmrTime', // 查询是否有可用核磁号源 + 'BaseInfo' => $base_url . '/api/H5/BaseInfo', // 基础信息 + 'CreateNewOrder' => $base_url . '/api/H5/CreateNewOrder', // 创建订单(新) ]; } diff --git a/Laravel/app/Http/Controllers/API/H5/CheckUpTypeController.php b/Laravel/app/Http/Controllers/API/H5/CheckUpTypeController.php index ab06b7a..4237bd7 100644 --- a/Laravel/app/Http/Controllers/API/H5/CheckUpTypeController.php +++ b/Laravel/app/Http/Controllers/API/H5/CheckUpTypeController.php @@ -11,7 +11,16 @@ class CheckUpTypeController extends Controller //H5获取体检类型名称和logo public function GetList() { - $list=DB::table('checkup_type')->where(['status'=>1,'is_del'=>0])->get(); + $ids = [7,1,4]; + $sortedIds = implode(',', array_map('intval', $ids)); + $list=DB::table('checkup_type')->where(['status'=>1,'is_del'=>0]) + ->orderByRaw("FIELD(id, {$sortedIds})") + ->get(); + foreach($list as $k=>$v){ + if($v->name=='健康体检'){ + $v->name='预约体检'; + } + } return \Yz::Return(true,"查询完成",['list'=>$list]); } } diff --git a/Laravel/app/Http/Controllers/API/H5/HomeController.php b/Laravel/app/Http/Controllers/API/H5/HomeController.php index 5eea537..b16b9a4 100644 --- a/Laravel/app/Http/Controllers/API/H5/HomeController.php +++ b/Laravel/app/Http/Controllers/API/H5/HomeController.php @@ -18,6 +18,31 @@ class HomeController extends Controller 'version' => $version ]); } + //获取基础信息 + public function BaseInfo(){ + $openid = request('openid'); + $hospital_id = request('hospital_id'); + $user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first(); + if (!$user) return \Yz::echoError1("openid对应用户不存在"); + $person = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0, 'is_default' => 1])->first(); + if (!$person) return \Yz::echoError1("请选择就诊人"); + $personCount = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->count(); + $hospital=DB::table('hospitals')->where(['id' => $hospital_id])->first(); + if (!$hospital) { + return \Yz::echoError1("医院不存在"); + } + $info =[ + 'person' => [ + 'name' => $person->name, + 'sex' => $person->sex, + 'count' => $personCount + ], + 'hospital' => [ + 'name' => $hospital->name, + ] + ] ; + return \Yz::Return(true, '获取成功', $info); + } // 获取配置更新时间 public function config() diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index 6902163..d0cae45 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -20,15 +20,25 @@ class OrderController extends Controller { // status 1-待支付 2-已预约 3-交易关闭 4-已完成 5-已退款 $openid = $request->post('openid'); + $searchInfo = $request->post('searchInfo'); $user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first(); if (!$user) return \Yz::echoError1("openid对应用户不存在"); $persons_sfz = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray(); + $where=['web_user_id' => $user->id]; + if(isset($searchInfo['status'])){ + $where['status'] = $searchInfo['status']; + } - $OrderList = DB::table('orders') + $OrderList = DB::table('orders'); + $OrderList=$OrderList ->select('id', 'title','buy_info', 'checkup_type_id','hunjian_status','status', 'name','appointment_date as date', 'appointment_time as time', 'order_number as order','appointment_number', DB::raw("CASE WHEN type = 1 THEN '个检' WHEN type = 2 THEN '团检' ELSE 'unknown' END as type"), - 'price', 'true_price', 'pay_time', 'refund_time', 'created_at') - ->where(['web_user_id' => $user->id]) + 'price', 'true_price', 'pay_time', 'refund_time', 'created_at'); + if(isset($searchInfo['dateRange'])){ + $OrderList=$OrderList->whereBetween('appointment_date', [$searchInfo['dateRange'][0], $searchInfo['dateRange'][1]]); + } + $OrderList=$OrderList + ->where($where) ->orWhere(function ($query) use ($persons_sfz) { $query->WhereIn('id_number', $persons_sfz) ->where('person_id', 0); diff --git a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php new file mode 100644 index 0000000..ecf41b0 --- /dev/null +++ b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php @@ -0,0 +1,408 @@ +where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first(); + if (!$user) return \Yz::echoError1('用户不存在'); + $person = DB::table('web_user_person')->where(['id' => $person_id, 'is_del' => 0])->first(); + if (!$person) return \Yz::echoError1('体检人不存在'); + $title = "自选项目"; + $price = 0; + $quanInfo = false; + $true_price = 0;//订单真实支付金额 + $buy_info = [ + 'combo' => [ + 'id' => 0, + 'name' => $title, + 'price' => 0, + ], + 'items' => [], + 'group' => [ + 'id' => '', + ], + 'nmr_list' => [], + 'peiou_info' => [], + ]; + if (!empty($peiou_info)) { + $buy_info['peiou_info'] = $peiou_info; + } + //如果是套餐 + $Nx1_arrInfo = []; + $TJ_Leixing_id = 1;//存储用体检类型 + $checkup_type_id = false; //体检类型id + if (isset($combo_id) and $combo_id <> 0) { + $combo_info = DB::table('combos')->where(['combo_id' => $combo_id, 'status' => 1])->first(); + if (!$combo_info) return \Yz::echoError1("套餐不存在"); + if (!isset($combo_info->checkup_type_id)) return \Yz::echoError1("套餐未关联体检类型"); + $checkup_type_id = $combo_info->checkup_type_id; + + //构建多选一数据 + if (isset($duo_xuan_yi) and !empty($duo_xuan_yi)) { + $combo_Nx1 = json_decode($combo_info->duo_xuan_yi, true); + foreach ($duo_xuan_yi as $r_k => $r_v) { + foreach ($combo_Nx1 as $k => $n1v) { + if ($r_v['zu_name'] == $n1v['组名称']) { + foreach ($n1v['包含项目'] as $k2 => $v2) { + if ($v2['Id'] == $r_v['item_id']) { + if ($v2['科室名称'] == '影像科') { + $buy_info['nmr_list'][] = [ + 'item_id' => $v2['Id'], + 'name' => $v2['名称'], + ]; + } + $Nx1_arrInfo[] = [ + 'id' => $v2['Id'], + 'name' => $v2['名称'], + 'price' => 0 + ]; + } + } + } + } + } + } + + $TJ_Leixing_id = $checkup_type_id; + $price += $combo_info->price; + $title = $combo_info->name; + $buy_info['combo'] = [ + 'id' => $combo_info->combo_id, + 'name' => $combo_info->name, + 'price' => $combo_info->price, + ]; + //如果有影像科,则存储在nmr_list字段 + $comboItem = DB::table('combo_items')->where(['combo_id' => $combo_id, 'status' => 1, 'keshi_name' => '影像科'])->get(); + if (count($comboItem) > 0) { + foreach ($comboItem as $item) { + $buy_info['nmr_list'][] = [ + 'item_id' => $item->item_id, + 'name' => $item->name, + ]; + } + } + } + + //如果有自选项目 + $items_list = []; + if (count($item_ids) != 0) { + $items_list = DB::table('items')->whereIn('item_id', $item_ids)->where(['status' => 1])->get(); + $existingIds = []; + $item_price = 0; + foreach ($items_list as $item) { + $item_price += $item->price; + $existingIds[] = $item->item_id; + $buy_info['items'][] = [ + 'id' => $item->item_id, + 'name' => $item->name, + 'price' => $item->price + ]; + //如果有影像科,则存储在nmr_list字段 + if ($item->keshi_name == '影像科') { + $buy_info['nmr_list'][] = [ + 'item_id' => $item->item_id, + 'name' => $item->name, + ]; + } + } + if (isset($wj_flag) and $wj_flag == 1) { + $item_price = $item_price * $wj_zhekou; + } + + + $price += $item_price; + $missingIds = array_diff($item_ids, $existingIds); + if (count($missingIds) > 0) return \Yz::echoError1("部分自选项目不可用,Id:" . implode(', ', $missingIds)); + } + //如果有 多选一项目 + if (!empty($Nx1_arrInfo)) { + $buy_info['items'] = array_merge($buy_info['items'], $Nx1_arrInfo); + } + $true_price = $price; + + //如果是团检 + $group_info = false; + if ($type == 2) { + $P = new PersonController(); + $data = [ + '电话号码' => null, + '证件号码' => null, + '预约Id' => $group_id + ]; + $group_info = $P->group_info($hospital_id, $data); + $group_info = $group_info[0]; + + //如果有多选一项目 + //构建多选一数据 + $Nx1_arrInfo = []; + if (isset($duo_xuan_yi) and !empty($duo_xuan_yi)) { + foreach ($duo_xuan_yi as $r_k => $r_v) { + $Nx1_arrInfo[] = [ + 'id' => $r_v['item_id'], + 'name' => $r_v['item_name'], + ]; + } + } + $group_info['items'] = array_merge($group_info['items'], $Nx1_arrInfo); //合并多选一 + + $buy_info['group'] = [ + 'id' => $group_id, + 'combo_name' => $group_info['combo_name'], + 'combo_id' => $group_info['combo_id'], + 'group_name' => $group_info['group_name'], + 'items' => $group_info['items'], + 'group_id' => $group_info['group_id'], + 'have_Nx1' => !empty($Nx1_arrInfo) + ]; + $TJ_Leixing_id = $group_info['checkup_type_id']; + $title = "单位团检" . $group_info['combo_name']; + $price = $price + $group_info['sixi_zong_ji_jin_e']; + $need_pay = ($price - $group_info['tongshou_xiane']) > 0 ? $price - $group_info['tongshou_xiane'] : 0; + //团检订单金额为减去统收后的金的 + $price = $need_pay; + $true_price = $need_pay; + + + //如果有影像科,则存储在nmr_list字段 + $all_items = DB::table('items')->where(['status' => 1, 'keshi_name' => '影像科'])->get(); + foreach ($group_info['items'] as $item) { + foreach ($all_items as $it) { + if ($it->item_id == $item['id']) { + $buy_info['nmr_list'][] = [ + 'item_id' => $it->item_id, + 'name' => $it->name, + ]; + } + } + } + + } + + //调用思信接口判断各个项目是否可用 + $check_items = []; + foreach ($item_ids as $item_id) { + $check_items[] = ['Id' => $item_id]; + } + if ((isset($combo_id) and $combo_id <> 0) || count($check_items) != 0) { + $item_check = self::item_check($hospital_id, [ + '人员信息列表' => [[ + "序号" => 0, + "性别" => $person->sex == 1 ? '男' : '女', + "年龄" => floor((time() - strtotime($person->birthday)) / 86400 / 360), + "婚姻状态" => $person->married == 1 ? '已婚' : '未婚', + ]], + '套餐Id' => $combo_id == 0 ? null : $combo_id, + '可选项目信息' => $check_items, + ]); + if (count($item_check['data']) != 1) { + return \Yz::echoError1("体检系统提示:" . $item_check['message']); + } + } + + + $plan_nmr_appointment_info = []; + //校验积分和预存款 + $env = config('app.globals.Env'); + $AspNet = new AspNetZhuanController(); + if ($env == 'pro') { //如果是正式环境, 测试环境不抵扣 + if ($jifen > 0) { + $all_jifen = $AspNet::GetJiFen_YuCunKuan(1, $person->ghzid); + if ($jifen > $all_jifen) return \Yz::echoError1("用户剩余积分不足"); + } + if ($yucunkuan > 0) { + // return \Yz::echoError1("暂不支持预存款"); + $all_yucunkuan = $AspNet::GetJiFen_YuCunKuan(2, $person->ghzid); + if ($yucunkuan > $all_yucunkuan) return \Yz::echoError1("用户剩余预存款不足"); + } + $true_price = $true_price - ($jifen + $yucunkuan); + if ($true_price < -1) return \Yz::echoError1("预抵扣金额超过订单金额,操作失败"); + if ($true_price < 0) $true_price = 0; +//如果有二线号源,根据体检时间查询二线可用号源,区分上下午,二线需预约体检时间1小时后 + $plan_nmr_info = []; + if (isset($erxian_info) and !empty($erxian_info)) { + foreach ($erxian_info as $erxian_item) { + $temp_date = [ + "item_id" => $erxian_item['item_id'], + "name" => $erxian_item['name'], + "price" => $erxian_item['price'], + ]; + $plan_nmr_info[] = $temp_date; + } + + } + + //使用优惠券 + if (isset($coupon_id) and !empty($coupon_id)) { + if ($true_price == 0) return \Yz::echoError1("金额为0,无需使用优惠券"); + $use_quan = $this->useYouHuiQuan($true_price, $person, $coupon_id); + $quanInfo = $use_quan['quanInfo']; + $true_price = $use_quan['price']; + } + $now_datetime = date('Y-m-d H:i:s'); + //构建订单号 + $order_num = $this->generateOrderNumber(); + + $data = [ + 'title' => $title, + 'type' => $type, + 'web_user_id' => $user->id, + 'checkup_type_id' => $TJ_Leixing_id, + 'person_id' => $person->id, + 'name' => $person->name, + 'id_number' => $person->id_number, + 'buy_info' => json_encode($buy_info, JSON_UNESCAPED_UNICODE), + 'price' => $price, + 'true_price' => number_format($true_price, 2, '.', ''), + 'jifen' => $jifen, + 'yucunkuan' => $yucunkuan, + 'order_number' => $order_num, + 'status' => 99, //先标记为异常,方法最底部更新为正常状态 + 'erxian_appointment_info' => json_encode($plan_nmr_info, JSON_UNESCAPED_UNICODE), + 'combo_id' => $combo_id, + 'hospital_id' => $hospital_id, + 'doctor' => $doctor, + 'phone' => $person->phone, + 'sex' => $person->sex, + 'birthday' => $person->birthday, + 'married' => $person->married, + 'wj_flag' => $wj_flag, + 'youhuiquan' => $quanInfo === false ? '' : json_encode(['id' => $quanInfo['DZJID'], 'name' => $quanInfo['DZJLBMC']], JSON_UNESCAPED_UNICODE), + 'created_at' => $now_datetime, + 'paycheck_time' => $now_datetime + ]; + + + $insert = DB::table('orders')->insertGetId($data); + + + //调用接口扣除积分和预存款、优惠券 + $jifen_dikou_status = true; + $yucunkuan_dikou_status = true; + $youhuiquan_dikou_status = true; + + if ($env == 'pro') { //如果是正式环境 + + + $nowDateTime = date('Y-m-d H:i:s'); + + if ($jifen > 0) { + $jifen_dikou_status = false; + $jifen_dikou_status = $AspNet::UseJiFen($person->ghzid, -$jifen, $yyid, $insert, 'tj_h5', '抵扣体检H5订单', $now_datetime); + } + if ($yucunkuan > 0) { + $yucunkuan_dikou_status = false; + $yucunkuan_dikou_status = $AspNet::UseYuCunKuan($person->ghzid, -$yucunkuan, $yyid, 0, $insert, 'tj_h5', '抵扣体检H5订单', $now_datetime); + } + + //核销优惠券 + if (isset($coupon_id) and !empty($coupon_id)) { + $youhuiquan_dikou_status = false; + $data = [ + 'action' => 3, + 'ghzid' => $person->ghzid, + 'dzjid' => $coupon_id, + 'hxbz' => "抵扣体检H5订单", + 'yyid' => $yyid + ]; + $youhuiquan_dikou_status = $AspNet::YouHuiQuan($data); + } + + } + + if ($insert and $jifen_dikou_status and $yucunkuan_dikou_status and $youhuiquan_dikou_status) { + //中途未报错,更新订单为待支付 + DB::table('orders')->where('id', $insert)->update([ + 'status' => 1 //标记为待支付 + ]); + $action = false; + if ($true_price == 0) { + DB::table('orders')->where('id', $insert)->update([ + 'status' => 2 //标记为已支付 + ]); + } + if ($true_price > 0) { + //如果大于0则提示前端去支付 + $action = "pay"; + } + return \Yz::return(true, "操作成功", ['action' => $action, 'orderid' => $insert]); + } else { + return \Yz::echoError1('操作失败'); + } + } + + } + public function item_check($hospital, $data) + { + $peis = new PEISApiController(); + $check = $peis::Post('套餐项目检查', $hospital, $data); + return $check; + } + + public function generateOrderNumber() + { + // 获取当前时间的时间戳(精确到毫秒) + $timestamp = round(microtime(true) * 1000); + + // 生成一个随机数(可以根据需要调整长度) + $randomPart = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 6); + + // 拼接时间戳和随机部分 + $orderNumber = date("YmdHis", $timestamp / 1000) . substr($timestamp % 1000, -3) . $randomPart; + + return $orderNumber; + } +} diff --git a/Laravel/routes/web.php b/Laravel/routes/web.php index 27d482b..148cfee 100644 --- a/Laravel/routes/web.php +++ b/Laravel/routes/web.php @@ -77,6 +77,8 @@ Route::group(['middleware' => ['log'],'prefix' => 'api/H5'], function () { Route::post('/SendMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@SendMsgCode');//发送验证码 Route::post('/CheckMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@CheckMsgCode');//验证验证码 Route::post('/CheckEnableNmrTime', 'App\Http\Controllers\API\H5\NMRController@CheckEnableNmrTime');//查询是否有可用核磁号源 + Route::post('/BaseInfo', 'App\Http\Controllers\API\H5\HomeController@BaseInfo');//基础信息 + Route::post('/CreateNewOrder', 'App\Http\Controllers\API\H5\OrderNewController@CreateNewOrder');//创建新订单 diff --git a/h5/common/Top.vue b/h5/common/Top.vue new file mode 100644 index 0000000..bd63fd4 --- /dev/null +++ b/h5/common/Top.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/h5/config.js b/h5/config.js index c936f2b..ac2205a 100644 --- a/h5/config.js +++ b/h5/config.js @@ -1,6 +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="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/manifest.json b/h5/manifest.json index 29327de..231f47c 100644 --- a/h5/manifest.json +++ b/h5/manifest.json @@ -57,6 +57,17 @@ }, "vueVersion" : "3", "h5" : { + "devServer": { + "proxy": { + "/api": { + "target": "http://124.225.137.54:39081", + "changeOrigin": true, + "pathRewrite": { + "^/api": "" + } + } + } + }, "router" : { "base" : "/h5/" }, diff --git a/h5/pages.json b/h5/pages.json index 6c1b0cc..7aec0f8 100644 --- a/h5/pages.json +++ b/h5/pages.json @@ -14,14 +14,6 @@ "navigationBarTextStyle": "white" } }, - { - "path": "pages/main/combo/combo_new", - "style": { - "navigationBarTitleText": "套餐", - "navigationBarBackgroundColor": "#239EA3", - "navigationBarTextStyle": "white" - } - }, { "path": "pages/main/combo/tcdb", "style": { @@ -75,16 +67,8 @@ "style": { "navigationBarTitleText": "套餐详情" } - }, - { - "path": "pages/main/tj/tjzx", - "style": { - "navigationBarTitleText": "体检套餐加项", - "navigationBarBackgroundColor": "#D8EDF2", - "navigationBarTextStyle": "black" - } },{ - "path": "pages/main/tj/tjzx_new", + "path": "pages/main/tj/tjzx", "style": { "navigationBarTitleText": "体检套餐加项", "navigationBarBackgroundColor": "#D8EDF2", @@ -115,13 +99,6 @@ "navigationBarBackgroundColor": "#239EA3", "navigationBarTextStyle": "white" } - },{ - "path": "pages/main/tj/tjxq_new", - "style": { - "navigationBarTitleText": "套餐详情", - "navigationBarBackgroundColor": "#239EA3", - "navigationBarTextStyle": "white" - } }, { "path": "pages/main/questionnaire/index", @@ -211,12 +188,7 @@ "style": { "navigationBarTitleText": "体检预约" } - },{ - "path": "pages/main/tjyy/tjyy_new", - "style": { - "navigationBarTitleText": "体检预约" - } - }, + }, { "path": "pages/user/pick/pick", "style": { @@ -322,6 +294,14 @@ "navigationBarTitleText" : "", "enablePullDownRefresh" : false } + }, + { + "path" : "pages/main/order/order_new", + "style" : + { + "navigationBarTitleText" : "", + "enablePullDownRefresh" : false + } } ], diff --git a/h5/pages/buy/choose/choose.vue b/h5/pages/buy/choose/choose.vue index 00619ce..1df4ac8 100644 --- a/h5/pages/buy/choose/choose.vue +++ b/h5/pages/buy/choose/choose.vue @@ -103,7 +103,7 @@ diff --git a/h5/pages/main/combo/combo.vue b/h5/pages/main/combo/combo.vue index 17260ac..8cd713d 100644 --- a/h5/pages/main/combo/combo.vue +++ b/h5/pages/main/combo/combo.vue @@ -1,1068 +1,1170 @@ + .tishi_main{ + background-color: #fff; + padding: 40rpx 50rpx; + width:600rpx; + border-radius: 40rpx; + } + .tishi_button{ + width: 365rpx; + background-color: #009da5; + color:#fff; + text-align: center; + padding-top: 10rpx; + padding-bottom: 10rpx; + border-radius: 40rpx; + margin: 40rpx auto 10rpx auto; + } + .tishi_title{ + text-align: center; + font-size: 30rpx; + font-weight: 600; + color:#2b2827; + } + .tishi_title2{ + font-size: 28rpx; + margin-top: 30rpx; + font-weight: 600; + color:#3a3635; + border-left: 3px solid #009da5; + padding-left: 5rpx; + } + .tishi_content{ + font-size: 28rpx; + margin-top: 30rpx; + color:#474241; + } + .select_done_wrapper { + color: #ffffff; + background: #239ea3; + width: calc(100% - 60rpx); + margin: 50rpx auto 0; + height: 50rpx; + line-height: 50rpx; + text-align: center; + border-radius: 6rpx; + } + + .select_group_item_wrapper { + padding: 10rpx 20rpx; + border: 1rpx solid #239ea3; + font-size: 22rpx; + margin: 20rpx 20rpx 0 0; + border-radius: 6rpx; + color: #239ea3; + } + + .select_group_item_wrapper.active { + color: #ffffff; + background: #239ea3; + } + + .select_group_line_wrapper { + display: flex; + align-items: center; + flex-wrap: wrap; + } + + .select_group_wrapper { + margin: 20rpx; + } + + .list_wrapper { + padding-top: 30rpx; + height: calc(100vh - 100rpx - 10rpx - 70rpx - 80rpx - 30rpx - 30rpx); + width: 750rpx; + overflow-y: auto; + padding-bottom: 30rpx; + margin: 0 auto; + overflow-x: hidden; + -ms-overflow-style: none; + scrollbar-width: none; + overflow: -moz-scrollbars-none; + overflow-y: scroll; + background-color: #fff; + } + + .list_wrapper::-webkit-scrollbar { + display: none; + } + + .combo_line_wrapper { + width: 710rpx; + height: 1rpx; + background: #e1ecee; + margin: 26rpx 0rpx 0rpx 0; + } + + .combo_pick_button_wrapper { + width: 160rpx; + height: 60rpx; + background: #e1ecee; + border-radius: 30rpx; + font-weight: 400; + font-size: 28rpx; + color: #239ea3; + text-align: center; + line-height: 60rpx; + } + + .combo_buy_button_wrapper { + width: 160rpx; + height: 60rpx; + background: #239ea3; + border-radius: 30rpx; + font-weight: 400; + font-size: 28rpx; + color: #ffffff; + text-align: center; + line-height: 60rpx; + } + + .combo_button_wrapper { + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + + } + + .combo_count_wrapper { + font-weight: 500; + font-size: 18rpx; + color: #8b8b8b; + line-height: 1; + } + + .combo_original_price_wrapper { + font-weight: 500; + font-size: 18rpx; + color: #8b8b8b; + line-height: 1; + text-decoration-line: line-through; + margin-left: 10rpx; + } + .combo_original_price_wrapper2 { + font-weight: 500; + font-size: 18rpx; + color: #8b8b8b; + line-height: 1; + margin-left: 10rpx; + } + + .combo_true_price_wrapper { + font-weight: 500; + font-size: 18rpx; + color: #ec3d15; + line-height: 1; + } + + .combo_true_price_number_wrapper { + font-size: 38rpx; + } + + .combo_price_wrapper { + display: flex; + align-items: end; + justify-content: space-between; + margin-top: 21rpx; + } + + .combo_price_box_wrapper { + display: flex; + align-items: end; + } + + .combo_wrapper { + /* height: 196rpx; */ + width: calc(750rpx - 80rpx); + margin: 0 auto; + background-color: #fff; + padding: 0rpx 40rpx 30rpx 40rpx; + } + + .combo_tags_wrapper { + display: flex; + align-items: center; + margin-top: 13rpx; + } + + .combo_desc_wrapper { + font-weight: 500; + font-size: 20rpx; + color: #8b8b8b; + line-height: 1; + margin-top: 18rpx; + } + + .combo_tag_wrapper { + padding-left: 13rpx; + padding-right: 13rpx; + height: 30rpx; + line-height: 30rpx; + border-radius: 5rpx; + font-weight: 400; + font-size: 18rpx; + color: #47abd8; + margin: 10rpx 8rpx 10rpx 0rpx; + border: 1rpx solid #009da5; + } + + .combo_name_wrapper { + font-weight: 400; + font-size: 32rpx; + color: #0e0e0e; + line-height: 32rpx; + + } + + .combo_content_wrapper { + margin-left: 30rpx; + width: calc(750rpx - 190rpx - 30rpx - 20rpx - 55rpx); + } + + .combo_info_wrapper { + display: flex; + align-items: center; + width: 750rpx; + margin: 0 auto; + } + + .combo_cover_wrapper { + width: 190rpx; + height: 190rpx; + margin-left: 20rpx; + } + + .combo_cover_wrapper image { + width: 190rpx; + height: 190rpx; + display: block; + object-fit: contain; + } + + .select_item_line_wrapper { + position: absolute; + width: 95rpx; + height: 10rpx; + background: linear-gradient(to bottom, #ffffff00, #1b9a9f); + border-radius: 5rpx; + bottom: 0; + left: 50%; + transform: translateX(calc(-50% - 8px)); + opacity: 0; + } + + .select_wrapper { + display: flex; + align-items: center; + justify-content: space-between; + width: 750rpx; + height: 80rpx; + background: #eef7f7; + box-shadow: 0rpx -1rpx 1rpx 0rpx rgba(0, 0, 0, 0.1); + margin: 0 auto; + position: relative; + z-index: 998; + } + + .select_item_icon_wrapper { + width: 18rpx; + height: 9rpx; + margin-left: 9rpx; + filter: grayscale(100%); + } + + .select_item_icon_wrapper image { + width: 18rpx; + height: 9rpx; + display: block; + object-fit: contain; + } + + .select_item_icon2_wrapper { + width: 26rpx; + height: 23rpx; + margin-left: 7rpx; + } + + .select_item_icon2_wrapper image { + width: 26rpx; + height: 23rpx; + display: block; + object-fit: contain; + } + + .select_item_name_wrapper { + font-weight: 400; + font-size: 26rpx; + color: #2f2f2f; + line-height: 1; + } + + .select_item_wrapper { + width: 25%; + display: flex; + align-items: center; + justify-content: center; + position: relative; + height: 80rpx; + } + + .select_item_wrapper.active .select_item_name_wrapper { + color: #239ea3; + font-weight: bold; + } + + .select_item_wrapper.active .select_item_icon_wrapper { + filter: grayscale(0%); + } + + .select_item_wrapper.active .select_item_line_wrapper { + opacity: 1; + } + + .doctor_name_wrapper { + font-weight: 400; + font-size: 24rpx; + line-height: 1; + color: #ffffff; + border-bottom: 1rpx solid #ffffff; + } + + .doctor_tip_wrapper { + font-weight: 400; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + } + + .doctor_wrapper { + display: flex; + align-items: center; + width: 710rpx; + height: 70rpx; + background: #239ea3; + border-radius: 15rpx 15rpx 0rpx 0rpx; + padding-left: 24rpx; + } + + .user_choose_wrapper { + width: 50rpx; + height: 50rpx; + margin-left: 30rpx; + } + + .user_choose_wrapper image { + width: 50rpx; + height: 50rpx; + display: block; + object-fit: contain; + } + + .user_title_wrapper { + font-weight: 400; + font-size: 26rpx; + color: #fff; + line-height: 1; + } + + .user_name_wrapper { + font-weight: 400; + font-size: 26rpx; + color: #fff; + line-height: 1; + } + + .user_wrapper { + height: 60rpx; + padding-left: 40rpx; + padding-right: 20rpx; + margin-right: 20rpx; + background: #009ea7; + border-radius: 40rpx; + display: flex; + align-items: center; + justify-content: center; + } + + .header_wrapper { + display: flex; + align-items: center; + justify-content: space-between; + width: 710rpx; + height: 90rpx; + background: #d8edf2; + margin: 0 auto; + position: relative; + + background-color: #fff; + margin-left: 20rpx; + margin-right: 20rpx; + border-radius: 20rpx; + } + + .hospital_wrapper { + display: flex; + align-items: center; + width: 40%; + } + + .hospital_icon_wrapper { + width: 48rpx; + height: 48rpx; + margin-left: 20rpx; + } + + .hospital_icon_wrapper image { + width: 48rpx; + height: 48rpx; + display: block; + object-fit: contain; + } + + .hospital_name_wrapper { + font-weight: 400; + font-size: 28rpx; + color: #484747; + margin-left: 9rpx; + line-height: 1; + } + + .hospital_select_wrapper { + width: 24rpx; + height: 14rpx; + margin-left: 19rpx; + } + + .hospital_select_wrapper image { + width: 24rpx; + height: 14rpx; + display: block; + object-fit: contain; + } + + .popup_new_main { + background-color: #fff; + border-radius: 0rpx 0rpx 20rpx 20rpx; + padding: 40rpx 20rpx 20rpx 20rpx; + } + + .top_button_row { + display: flex; + justify-content: space-between; + padding-left: 20rpx; + padding-right: 20rpx; + } + + .top_button { + color: #666; + background-color: #fff; + padding: 6rpx 40rpx; + border-radius: 15rpx; + margin-top: -6rpx; + margin-bottom: 8rpx; + font-size: 28rpx; + width: 140rpx; + text-align: center; + } + + .top_button_active { + background-color: #009ea7; + color: #fff; + } + + .search {} + + .shaixuan_title { + font-size: 26rpx; + margin-top: 20rpx; + margin-bottom: 10rpx; + } + + .shaixuan_button { + font-size: 24rpx; + padding-left: 10rpx; + background-color: #ccc; + margin: 10rpx; + padding: 5rpx 10rpx; + border-radius: 5rpx; + background-color: #f3f3f3; + color: #1e1a19; + } + .shaixuan_button_active{ + background-color: #009da5; + color: #fff; + } + + \ No newline at end of file diff --git a/h5/pages/main/combo/combo_new.vue b/h5/pages/main/combo/combo_new.vue deleted file mode 100644 index 24ed467..0000000 --- a/h5/pages/main/combo/combo_new.vue +++ /dev/null @@ -1,1170 +0,0 @@ - - - \ No newline at end of file diff --git a/h5/pages/main/order/order_new.vue b/h5/pages/main/order/order_new.vue new file mode 100644 index 0000000..f49cbab --- /dev/null +++ b/h5/pages/main/order/order_new.vue @@ -0,0 +1,193 @@ + + + + + + diff --git a/h5/pages/main/tj/tjxq(旧).vue b/h5/pages/main/tj/tjxq(旧).vue new file mode 100644 index 0000000..05059ce --- /dev/null +++ b/h5/pages/main/tj/tjxq(旧).vue @@ -0,0 +1,559 @@ + + + \ No newline at end of file diff --git a/h5/pages/main/tj/tjxq.vue b/h5/pages/main/tj/tjxq.vue index 05059ce..98f1179 100644 --- a/h5/pages/main/tj/tjxq.vue +++ b/h5/pages/main/tj/tjxq.vue @@ -31,6 +31,7 @@ let personId = ref(""); // 患者id let groupId = ref(""); // 团检id let tabIndex = ref(-1); // 标签索引 + let total_original_price=ref(0); let totalPrice = ref(0); // 总折扣价格 let groupInfo = ref({}); // 团检信息 let status = ref(0); // 1个检套餐 2个检自选 3团检套餐 4团检自选 @@ -38,6 +39,9 @@ let notice = ref({}); // 体检须知 let losePrice = ref(0); // 剩余金额 let popupTip = ref(null); // 剩余额度提示弹窗 + let contentInfo=ref([])//详情信息 + let active_keshi=ref([]); + let popupXuZhi=ref(null); const GetReadmeDetails = async () => { const response = await $api("GetReadme"); @@ -83,7 +87,13 @@ default: "", }, }); - + const opendDetail=(index)=>{ + if(active_keshi.value.indexOf(index)!== -1){ + active_keshi.value.splice(active_keshi.value.indexOf(index), 1); + }else{ + active_keshi.value.push(index) + } + } const mountedAction = async () => { selectIds.value = $props.itemIds ? $props.itemIds.split(",") : []; wj.value = $props.wj || ""; @@ -125,16 +135,17 @@ getBuyInfo(); // 获取购买信息 }; - const buy = () => { + const buy = async (step=0) => { - if (tabIndex.value == 0) { + if (step == 1) { if (losePrice.value > 0 && groupId.value.length>0) { popupTip.value.open("center"); // 弹剩余额度提醒 return; } - GetReadmeDetails(); + await GetReadmeDetails(); + popupXuZhi.value.open(); } - if (tabIndex.value == 1 && buyText.value == "立即购买") { + if (step == 2) { $store.setBuyInfo({ combo_id: comboId.value, person_id: personId.value, @@ -162,7 +173,6 @@ const getBuyInfo = async () => { // 获取购买信息 - console.log("看看有没有hospital",$store.save_info); let obj = { item_ids: selectIds.value, combo_id: comboId.value, @@ -182,6 +192,7 @@ status.value = 3; } if(groupInfo.value.items?.length){ + contentInfo.value.push(groupInfo.value.items) groupInfo.value.itemscount=0; let itemscount=0 groupInfo.value.items.forEach((v,i)=>{ @@ -193,8 +204,12 @@ } losePrice.value = response.data.lose_price; comboInfo.value = response.data.combo_info; + if(comboInfo.value.items?.length){ + contentInfo.value.push(comboInfo.value.items) + } itemsInfo.value = response.data.items_info; if(itemsInfo.value.items?.length){ + contentInfo.value.push(itemsInfo.value.items) itemsInfo.value.itemscount=0; let itemscount=0 itemsInfo.value.items.forEach((v,i)=>{ @@ -204,8 +219,10 @@ itemsInfo.value.itemscount=itemscount } totalPrice.value = response.data.true_price; + total_original_price.value=response.data.original_price tabIndex.value = 0; - + contentInfo.value=contentInfo.value.flat() + }); }; @@ -275,55 +292,17 @@ - + + + + 项目自选 + {{ comboInfo.combo_name }} + + - - - - - - {{ comboInfo.combo_name }} - - - - - {{ val }} - - - ¥ - {{ - comboInfo.price - }} - {{ - comboInfo.original_price - }} - 已售{{ comboInfo.sale_count }} - - - - - - - 适用人群: - {{ comboInfo.crowd_name }} - - - 适用院区: - {{ comboInfo.hospital_name }} - - - + + + @@ -355,169 +334,119 @@ - - - 套餐内容 - 自选内容 - 体检须知 + + + + 套餐项目 + {{ comboInfo?.tags[0]?.text }} + {{ itemsInfo?.itemscount }} + + - + - + - 套餐项目({{ comboInfo?.tags[0]?.text }}) - - 检查项目 - 检查指标意义 + + + 体检流程 + 检查项目 - + - - - {{ val.keshi_name }}({{ val.children.length }}) + + {{index+1}}.{{ val.keshi_name }} + {{ val.children.length }}个项目 + 查看详情>> - - - {{ v.name }} + + + + + + {{ v.name }} + + ? + + + {{ v.desc || "-" }} - {{ - v.desc || "-" - }} + - - - - 套餐项目({{ groupInfo.itemscount }}项) - - 检查项目 - 检查指标意义 - - - - - - {{ val.keshi_name }}({{ val.children.length }}) + + + + + + + + 体检须知 + + + + 体检须知 + + + + + + 选购套餐 - - - {{ v.name }} - - {{ - v.desc || "-" - }} + + - - - - - - - 自选项目({{ itemsInfo.itemscount }}项) - - 检查项目 - 检查指标意义 - - - - - - {{ val.keshi_name }}({{ val.children.length }}) + + + 预约体检 - - - {{ v.name }} - - {{ v.desc || "-" }} + + + + + + 前往体检 + + + + + + + 领取报告 - - - - - - - - - 体检须知 - - - - 体检须知 - - - - - - 选购套餐 - - - - - - - 预约体检 - - - - - - - 前往体检 - - - - - - - 领取报告 + + + 体检注意事项 - - - - 体检注意事项 - - + + + 我已知晓 - + + - + - - 套餐价格 - ¥ {{ comboInfo.price }} - - - 自选项目价格 - ¥ {{ itemsInfo.price || 0 }} - - - 合计费用 - ¥ - {{ + + ¥ {{ total_original_price }} + + + ¥{{ totalPrice }} - - @@ -527,17 +456,9 @@ .comboInfo { position: relative; z-index: 1; - - &::after { - content: ""; - width: 100%; - height: 50rpx; - background-color: #239ea3; - position: absolute; - left: 0; - top: 0; - z-index: -1; - } + background-color: #fff; + min-height: calc(100vh - 200rpx); + .active { color: #239ea3; @@ -556,4 +477,91 @@ } } } + + \ No newline at end of file diff --git a/h5/pages/main/tj/tjxq_new.vue b/h5/pages/main/tj/tjxq_new.vue deleted file mode 100644 index 98f1179..0000000 --- a/h5/pages/main/tj/tjxq_new.vue +++ /dev/null @@ -1,567 +0,0 @@ - - - - \ No newline at end of file diff --git a/h5/pages/main/tj/tjzx(旧).vue b/h5/pages/main/tj/tjzx(旧).vue new file mode 100644 index 0000000..5b75db9 --- /dev/null +++ b/h5/pages/main/tj/tjzx(旧).vue @@ -0,0 +1,595 @@ + + + diff --git a/h5/pages/main/tj/tjzx.vue b/h5/pages/main/tj/tjzx.vue index 5b75db9..8f5c8dd 100644 --- a/h5/pages/main/tj/tjzx.vue +++ b/h5/pages/main/tj/tjzx.vue @@ -1,384 +1,419 @@ + \ No newline at end of file diff --git a/h5/pages/main/tj/tjzx_new.vue b/h5/pages/main/tj/tjzx_new.vue deleted file mode 100644 index 8f5c8dd..0000000 --- a/h5/pages/main/tj/tjzx_new.vue +++ /dev/null @@ -1,626 +0,0 @@ - - - - \ No newline at end of file diff --git a/h5/pages/main/tjyy/tjyy_new.vue b/h5/pages/main/tjyy/tjyy(旧).vue similarity index 67% rename from h5/pages/main/tjyy/tjyy_new.vue rename to h5/pages/main/tjyy/tjyy(旧).vue index 9461037..f0fae13 100644 --- a/h5/pages/main/tjyy/tjyy_new.vue +++ b/h5/pages/main/tjyy/tjyy(旧).vue @@ -30,7 +30,7 @@ let yucunkuan = ref(0); // 计算后的预存款 let jifen = ref(0); // 计算后的可用积分 let keyong_jifen = ref(0); // 可用积分 let erxianInfo=ref(null); - +let TiShiPopupRef=ref(null); const mountedAction = async () => { uni.showLoading({ title: "加载中", @@ -266,6 +266,19 @@ const getnmrList = async () => { }); }; + +let checkup_type_id=$store.getCheckupTypeId()?.id +let NextStatus=ref(true) +const toNext=()=>{ + NextStatus.value=true + if(checkup_type_id==4){ + NextStatus.value=false; + TiShiPopupRef.value.open(); + return false; + } + comfrimyy() +} + const comfrimyy = async () => { let plan_id = ""; let plan_nmr_id = ""; @@ -278,6 +291,7 @@ const comfrimyy = async () => { return; } } + if (yytjInfo.value?.nmr_list?.length > 1) { plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id; @@ -426,6 +440,14 @@ const toRouter = (url, status, index) => { diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue index f0fae13..26d986f 100644 --- a/h5/pages/main/tjyy/tjyy.vue +++ b/h5/pages/main/tjyy/tjyy.vue @@ -30,7 +30,7 @@ let yucunkuan = ref(0); // 计算后的预存款 let jifen = ref(0); // 计算后的可用积分 let keyong_jifen = ref(0); // 可用积分 let erxianInfo=ref(null); -let TiShiPopupRef=ref(null); + const mountedAction = async () => { uni.showLoading({ title: "加载中", @@ -266,32 +266,12 @@ const getnmrList = async () => { }); }; - -let checkup_type_id=$store.getCheckupTypeId()?.id -let NextStatus=ref(true) -const toNext=()=>{ - NextStatus.value=true - if(checkup_type_id==4){ - NextStatus.value=false; - TiShiPopupRef.value.open(); - return false; - } - comfrimyy() -} - const comfrimyy = async () => { let plan_id = ""; 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; - } - } - + if (yytjInfo.value?.nmr_list?.length > 1) { plan_nmr_id = yytjInfo.value?.nmr_list[0]?.id; @@ -324,7 +304,7 @@ const comfrimyy = async () => { peiou_info:$store.getPeiOuUser()//配偶信息 }; console.log(obj); - const response = await $api("OrderCreate", obj); + const response = await $api("CreateNewOrder", obj); $response(response, () => { if (response.status) { if (response.data.action == "pay") { @@ -440,14 +420,6 @@ const toRouter = (url, status, index) => {