diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php index 63aae10..a8d332d 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/OrderController.php @@ -37,6 +37,16 @@ class OrderController extends Controller { $id = request('id'); $order = DB::table('orders')->where(['id' => $id])->first(); + if(isset($order->youxiaoqi_end) and $order->status==2){ //1有效期内2过期0 + if( $order->youxiaoqi_end>= date('Y-m-d')) { + $order->youxiaoqi_status=1; + }else{ + $order->youxiaoqi_status=2; + } + }else{ + $order->youxiaoqi_status=0; + } + return \Yz::Return(true, "查询完成", ['info' => $order]); } diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 6949221..0089ca3 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -61,14 +61,20 @@ class ComboController extends Controller if (!$person) return \Yz::echoError1("请选择就诊人"); //用户绑定就诊人数量 $personCount = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->count(); + $sql = ''; $canshu = []; if(isset($combo_sex)){ - $canshu[]=$combo_sex; + if($combo_sex<>0){ + $sql = " and a.sex in(?,0) "; + $canshu[]=$combo_sex; + } + }else{ + $sql = " and a.sex in(?,0) "; $canshu[]=$person->sex; } - $sql = ''; + if (isset($combo_price) and !isset($price_range)) { $price_list = [ "1" => [0, 299], @@ -78,12 +84,12 @@ class ComboController extends Controller "5" => [3000, 999999], ]; - $sql = " and (a.price>=? and a.price<=?) "; + $sql = $sql . " and (a.price>=? and a.price<=?) "; $canshu[] = $price_list[$combo_price][0]; $canshu[] = $price_list[$combo_price][1]; } if (isset($price_range) and !isset($combo_price)) { - $sql = " and (a.price>=? and a.price<=?) "; + $sql = $sql . " and (a.price>=? and a.price<=?) "; $canshu[] = $price_range[0]; $canshu[] = $price_range[1]; } @@ -178,7 +184,7 @@ class ComboController extends Controller $combos = DB::select("select * from combos as a LEFT JOIN ( select combo_id as c_id,count(*) as count from combo_items where status in(1) group by combo_id -) as b on a.combo_id=b.c_id where a.status=1 and a.sex in(?,0) " . $sql ." ", $canshu); +) as b on a.combo_id=b.c_id where a.status=1 " . $sql ." ", $canshu); foreach ($combos as $key => $combo) { $combo->count=$combo->count?$combo->count:0; diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index 3e1a5f5..4b67037 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -9,6 +9,7 @@ use App\Http\Controllers\API\PEISApiController; use App\Lib\Tools; use App\Services\ConfigService; use App\Services\OrderService; +use App\Services\SanFangCodeService; use DateTime; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; @@ -125,7 +126,7 @@ class OrderController extends Controller $jifen = request('jifen', 0); //使用的积分数量 $yucunkuan = request('yucunkuan', 0);//使用的预存款数量 $erxian_info= request('erxian_info');//使用的预存款数量 - + $sanfang_code=request('sanfang_code'); //第三方code $wj_flag = request('wj'); //问卷标记 @@ -212,6 +213,20 @@ class OrderController extends Controller $TJ_Leixing_id = $checkup_type_id; $price += $combo_info->price; + //如果使用了第三方券 + $cha_sanfang_code=false; + if(isset($sanfang_code) and isset($sanfang_code['code_num'])){ + if($sanfang_code['combo_id']<>$combo_id) return \Yz::echoError1("转赠码与套餐不匹配"); + //校验有效性,临时抵消套餐价格 + if($sanfang_code['qudao_type']==1){ + $cha_sanfang_code = DB::table('transfer_code')->where(['code' => $sanfang_code['code_num'], 'status' => 1, 'is_del' => 0])->first(); + if (!$cha_sanfang_code) return \Yz::echoError1("此转赠码不可用"); + $price=$price-$cha_sanfang_code->price; + if($price<0){ + $price=0; + } + } + } $title = $combo_info->name; $buy_info['combo'] = [ 'id' => $combo_info->combo_id, @@ -571,7 +586,12 @@ class OrderController extends Controller ]; $youhuiquan_dikou_status = $AspNet::YouHuiQuan($data); } - + //核销三方券码(转赠码等) + if(!!$cha_sanfang_code){ + $s= new SanFangCodeService(); + $hexiao=$s->HeXiaoSanFangCode($sanfang_code['qudao_type'],$cha_sanfang_code->code,$insert); + if($hexiao['status']===false) return \Yz::echoError1($hexiao['msg']); + } } if ($insert and $up_plan and $jifen_dikou_status and $yucunkuan_dikou_status and $youhuiquan_dikou_status) { diff --git a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php index 2796c1a..f29590a 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php @@ -26,6 +26,11 @@ class OrderNewController extends Controller $peiou_info = request('peiou_info');//配偶信息 $sanfang_code=request('sanfang_code'); //第三方code + $configs_youxiaoqi=DB::table('configs')->where(['label'=>"订单有效期"])->first(); + $date = new DateTime(); + $date->modify('+'.$configs_youxiaoqi['value'].' days'); + $youxiaoqi_end=$date->format('Y-m-d'); + if (count($item_ids) != 0 and $item_ids[0] == "") { $item_ids = []; } @@ -343,7 +348,8 @@ class OrderNewController extends Controller '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 + 'paycheck_time' => $now_datetime, + 'youxiaoqi_end' => $youxiaoqi_end ]; @@ -434,6 +440,10 @@ class OrderNewController extends Controller $plan_check = $plan->CheckPlan($plan_id, $order->hospital_id, $order->type, $order->sex, $order->price, $order->checkup_type_id); if ($plan_check['status'] === false) return \Yz::echoError1($plan_check['msg']); $plan = $plan_check['plan']; + //校验号源日期是否超过订单有效期 + if(isset($order->youxiaoqi_end) and $plan->date > $order->youxiaoqi_end){ + return \Yz::echoError1("请预约".$order->youxiaoqi_end."之前的日期"); + } $plan_nmr_appointment_info=[]; //如果有二线号源,根据体检时间查询二线可用号源,区分上下午,二线需预约体检时间1小时后 $plan_nmr_info=[]; @@ -603,7 +613,8 @@ class OrderNewController extends Controller 'birthday' => $this->formatDate($person['Patbdate']), 'married' => 0, 'created_at' => $now_datetime, - 'paycheck_time' => $now_datetime + 'paycheck_time' => $now_datetime, + 'youxiaoqi_end' => $order->youxiaoqi_end ]; $i_order_id=DB::table('orders')->insertGetId($data); $u=DB::table('orders')->where(['id'=>$order->id])->update(['transfer_type'=>1,'transfer_link'=>$i_order_id,'status'=>6]); diff --git a/admin/.env.development b/admin/.env.development index 6501e21..c35cf71 100644 --- a/admin/.env.development +++ b/admin/.env.development @@ -1,3 +1,3 @@ ENV = 'development' VITE_APP_API = '/api/' -VITE_APP_FILE = 'https://api.hainan2024.sa0.online' \ No newline at end of file +VITE_APP_FILE = 'http://124.225.137.54:39081' \ No newline at end of file diff --git a/admin/.env.production b/admin/.env.production index 895cd7d..408d4e9 100644 --- a/admin/.env.production +++ b/admin/.env.production @@ -1,4 +1,4 @@ ENV = 'production' -VITE_APP_API = 'https://tj-h5.hnxdfe.com/api/' -VITE_APP_FILE = 'https://tj-h5.hnxdfe.com' +VITE_APP_API = 'http://124.225.137.54:39081/api/' +VITE_APP_FILE = 'http://124.225.137.54:39081' diff --git a/admin/src/views/OrderMngr/Order.vue b/admin/src/views/OrderMngr/Order.vue index 4a1396d..49f5ed4 100644 --- a/admin/src/views/OrderMngr/Order.vue +++ b/admin/src/views/OrderMngr/Order.vue @@ -31,13 +31,14 @@ - + 待支付 - 已预约 + 已支付 交易关闭 已完成 已退款 + 已转赠 @@ -87,7 +88,7 @@ 预约成功:{{Info.appointment_number}} - 预约失败 + 未预约 待支付 @@ -99,14 +100,15 @@ 已完成 已退款 - + 已转赠 + 仅退款 取消预约、退款 - 待检 - 已到检 + 待检 + 已到检 {{Info.pay_time}} diff --git a/admin/vite.config.js b/admin/vite.config.js index ffc777f..723049c 100644 --- a/admin/vite.config.js +++ b/admin/vite.config.js @@ -24,7 +24,7 @@ export default defineConfig({ port: 5174, proxy: { '/api': { - target: 'https://api.hainan2024.sa0.online/api/', // 实际的API服务器地址 + target: 'http://124.225.137.54:39081/api/', // 实际的API服务器地址 changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') // 如果API地址有前缀,可以进行转写 } diff --git a/h5/common/WeeklyCalendar.vue b/h5/common/WeeklyCalendar.vue index eaa3b97..88da766 100644 --- a/h5/common/WeeklyCalendar.vue +++ b/h5/common/WeeklyCalendar.vue @@ -6,7 +6,7 @@ {{item.date.split('-').slice(1).join('/')}} {{ item.xingqi.replace('星期', '周').replace('日', '天')}} - 余号{{item.count}} + 余{{item.count}} @@ -153,16 +153,15 @@ .zhou_title { font-size: 28rpx; - font-weight: 500; margin-top: 6rpx; } .yu { - background-color: #EFEFEF; + background-color: #E0F5F6; margin-top: 8rpx; - border-radius: 10rpx; - padding: 2rpx 8rpx; - font-size: 18rpx; + border-radius: 6rpx; + padding: 2rpx 20rpx; + font-size: 20rpx; color: #239EA3; } @@ -209,14 +208,14 @@ .time { font-size: 28rpx; - width: 104rpx; + text-align: center; margin-top: 40rpx; border-radius: 14rpx; - padding: 8rpx 0rpx; + padding: 10rpx 16rpx; flex: 0 0 calc(16.3% - 32rpx); /* 假设一行有4个项目,减去想要的间隔 */ - margin-right: 40rpx; + /* 设置右侧边距 */ color: #008F96; diff --git a/h5/pages/buy/done/done.vue b/h5/pages/buy/done/done.vue index 2397e90..4e8819c 100644 --- a/h5/pages/buy/done/done.vue +++ b/h5/pages/buy/done/done.vue @@ -121,7 +121,7 @@ {{ order_info.order_number }} - 类型: + 体检类型: 个检团检 diff --git a/h5/pages/components/goHome.vue b/h5/pages/components/goHome.vue index f898106..9ccd828 100644 --- a/h5/pages/components/goHome.vue +++ b/h5/pages/components/goHome.vue @@ -6,7 +6,7 @@ @mousedown="dragButton" @touchstart="dragButton" > - + @@ -65,10 +65,10 @@ const dragButton = (event) => { position: fixed; cursor: pointer; /* 其他样式 */ - right: 20px; - top: 45%; - width: 100rpx; - height: 100rpx; + right: 20rpx; + top: 14rpx; + width: 60rpx; + height: 60rpx; border-radius: 50%; background-color: #cdcdcd; display: flex; diff --git a/h5/pages/main/combo/combo(旧).vue b/h5/pages/main/combo/combo(旧).vue index 17260ac..f353d6e 100644 --- a/h5/pages/main/combo/combo(旧).vue +++ b/h5/pages/main/combo/combo(旧).vue @@ -184,7 +184,7 @@ const getComboList = async (e) => { const response = await $api("ComboList", obj); uni.hideLoading(); $response(response, () => { - + combo_list.value = response.data; diff --git a/h5/pages/main/combo/combo.vue b/h5/pages/main/combo/combo.vue index 3af505a..0b4ef1e 100644 --- a/h5/pages/main/combo/combo.vue +++ b/h5/pages/main/combo/combo.vue @@ -133,6 +133,7 @@ popup.value.close(); }; const selectDone = async () => { + if (priceIndex.value === null) { delete screenObj.value.combo_price; } else { @@ -146,6 +147,7 @@ } await getComboList(); popup_new.value.close(); + shaixuan_popup_status.value=false; }; @@ -171,7 +173,8 @@ $response(response, async () => { combo_select.value = response.data; combo_select.value.sort_sale_count=[{id:1,name:"销量从低到高"},{id:2,name:"销量从高到低"}] - combo_select.value.sort_price=[{id:1,name:"价格从低到高"},{id:2,name:"价格从高到低"}] + // combo_select.value.sort_price=[{id:1,name:"价格从低到高"},{id:2,name:"价格从高到低"}] + combo_select.value.sort_price=[{id:2,name:"价格从高到低"}] if ("sort_list" in combo_select.value) { selectKey.value = "sort_list"; sortIndex.value = 0; @@ -192,8 +195,9 @@ name: "", }, }); - + let random=ref(0); const combo_list_computed = computed(() => { + random.value=Math.random() let list = []; for (let i in combo_list.value.list) { let push = false; @@ -219,10 +223,12 @@ list.push(combo_list.value.list[i]); } } + return list; }); let combo_list_k = ref(null) const getComboList = async (e) => { + uni.showLoading(); let obj = { doctor: $store.save.doctor, @@ -244,6 +250,7 @@ const response = await $api("ComboList", obj); uni.hideLoading(); $response(response, () => { + combo_list.value = response.data; price_max_min.value=combo_list.value.price_max_min }); @@ -285,14 +292,21 @@ }); }; let shaixuan_popup_status=ref(false);//筛选窗口打开状态 + let tiaojian_poput_status=ref(false); const open = (key) => { if (key) { // 点击三个筛选条件 + if(tiaojian_poput_status.value===true){ + popup.value.close(); + tiaojian_poput_status.value=false + return false + } selectKey.value = key; - popup.value.close(); + popup_new.value.close(); let time = setTimeout(() => { popup.value.open("top"); + tiaojian_poput_status.value=true clearTimeout(time); }, 400); } else { @@ -464,8 +478,8 @@ price_max_min.value=value console.log(price_max_min.value); } - const combosex_change=()=>{ - + const combosex_change=(value)=>{ + screenObj.value.combo_sex=value } const tabsClickFunc=(value)=>{ tabs_active_id.value=value @@ -551,12 +565,12 @@ }" class="mx-20rpx center text-#2f2f2f text-26rpx"> 筛选 - + - + @@ -669,13 +683,24 @@ 性别 - + + + 不限 + + + 男 + + + 女 + + + 套餐类型 @@ -685,7 +710,7 @@ 价格区间 - + 适用人群 diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 06a9b66..5d66f6a 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -295,7 +295,7 @@ - 02261310 + 02272247 diff --git a/h5/pages/main/tj/tjzx.vue b/h5/pages/main/tj/tjzx.vue index 865edbb..06b199d 100644 --- a/h5/pages/main/tj/tjzx.vue +++ b/h5/pages/main/tj/tjzx.vue @@ -499,18 +499,18 @@ - { - tabIndex = index; - rightLeft = item.children; - headImg = item.head_img; - } - "> - {{ item.title }} + + { + tabIndex = index; + rightLeft = item.children; + headImg = item.head_img; + }" v-if="item.title != '材料费'"> + {{ item.title }} + + diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue index ab88510..23395ee 100644 --- a/h5/pages/main/tjyy/tjyy.vue +++ b/h5/pages/main/tjyy/tjyy.vue @@ -30,6 +30,7 @@ let yucunkuan = ref(0); // 计算后的预存款 let jifen = ref(0); // 计算后的可用积分 let keyong_jifen = ref(0); // 可用积分 let erxianInfo=ref(null); +let zixuan_item_show=ref(false); const mountedAction = async () => { uni.showLoading({ @@ -375,6 +376,26 @@ const configRef = (e) => { mountedAction(); } }; +const DelItem=(item)=>{ + uni.showModal({ + title: '提示', + content: '确定删除 '+item.name+" 吗?", + success: function (res) { + if (res.confirm) { + let index = buyInfo.value.item_ids.indexOf(item.id); + + if (index > -1) { + buyInfo.value.item_ids.splice(index, 1); + $store.setBuyInfo(buyInfo.value) + getnmrList() + } + + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); +} onShow(() => { if (!!config_ref.value) { @@ -528,7 +549,7 @@ const toRouter = (url, status, index) => { - {{ + {{ userInfo.name }} @@ -551,7 +572,8 @@ const toRouter = (url, status, index) => { - + + @@ -664,14 +686,14 @@ const toRouter = (url, status, index) => { - + - - - 自选项目 - - + + 自选项目 + + + ¥{{ itemsInfo.price }} @@ -688,7 +710,7 @@ const toRouter = (url, status, index) => { 自选项目 { ¥{{v.original_price }} + + @@ -722,7 +746,7 @@ const toRouter = (url, status, index) => { > 确认支付 - diff --git a/h5/pages/main/yytjsj/yytjsj_new.vue b/h5/pages/main/yytjsj/yytjsj_new.vue index 1e0ca38..c727931 100644 --- a/h5/pages/main/yytjsj/yytjsj_new.vue +++ b/h5/pages/main/yytjsj/yytjsj_new.vue @@ -99,6 +99,7 @@ let amount = ref(0) let person_name = ref('') let combo_name = ref('') + let combo_id=ref(null); //查询体检号源 const GetDayPlanListFunc = async () => { uni.showLoading(); @@ -109,7 +110,7 @@ use_type: use_type.value, checkup_type_id: checkup_type_id.value, amount: amount.value, - combo_id:orderInfo.value.combo_id + combo_id:combo_id.value } const response = await $api("GetDayPlanList", data); uni.hideLoading(); @@ -166,6 +167,7 @@ amount.value = orderInfo.value.true_price person_name.value = orderInfo.value.name combo_name.value = orderInfo.value.title + combo_id.value=orderInfo.value.combo_id GetDayPlanListFunc() }); @@ -348,8 +350,8 @@ } //点击提交 const StartYuYue = () => { - if (buyInfo.value.group_id) { - //如果是团检则创建订单 + if (buyInfo.value.group_id || buyInfo.value.sanfang_code?.code_num) { + //如果是团检则创建订单 /三方订单 comfrimyy() } else { //先前已经创建订单,单纯进行预约 @@ -397,7 +399,8 @@ coupon_id: yytjInfo.value?.couponId || null, wj: buyInfo.value.wj, erxian_info: yytjInfo.value.erxianInfo, - peiou_info: $store.getPeiOuUser() //配偶信息 + peiou_info: $store.getPeiOuUser(), //配偶信息 + sanfang_code:buyInfo.value.sanfang_code?.code_num?buyInfo.value.sanfang_code:null }; console.log(obj); const response = await $api("OrderCreate", obj); @@ -522,6 +525,7 @@ $store.getGroupInfo()?.checkup_type_id : $store.getCheckupTypeId()?.id, hospital_id.value = buyInfo.value.hospital, person_id.value = buyInfo.value.person_id, + combo_id.value=buyInfo.value.combo_id, use_type.value = buyInfo.value.group_id ? 2 : 1, person_name.value = buyInfo.value.group_id ? $store.getGroupInfo()?.name : '', combo_name.value = buyInfo.value.group_id ? $store.getGroupInfo()?.group_name : '', diff --git a/h5/static/assets/shaixuan_active1@2x.png b/h5/static/assets/shaixuan_active1@2x.png new file mode 100644 index 0000000..9e7eaee Binary files /dev/null and b/h5/static/assets/shaixuan_active1@2x.png differ