婚检订单倒计时、婚检去掉先选医生

main
yanzai 11 months ago
parent 5f8a5bb90b
commit 9990e128ce

@ -24,7 +24,7 @@ class OrderController extends Controller
$persons_sfz = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
$OrderList = DB::table('orders')
->select('id', 'title', 'status', 'name','appointment_date as date', 'appointment_time as time', 'order_number as order','appointment_number',
->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])
@ -42,6 +42,22 @@ class OrderController extends Controller
$list->status = 3;
}
}
if($list->checkup_type_id==4 and $list->status==2 and $list->hunjian_status==0 and !empty($list->appointment_number)){
//查询配偶是否预约
$buy_info=json_decode($list->buy_info,true);
if(isset($buy_info['peiou_info']['sfz'])){
$peiou_check= DB::select("select * from orders where id_number=?
and checkup_type_id = 4
and status in(2,4)
and appointment_number is not null
", [$buy_info['peiou_info']['sfz']]);
if(count($peiou_check)==0){
$datetime = new DateTime($list->created_at);
$timestamp = $datetime->getTimestamp();
$list->end_time = $timestamp + (60 * config('app.globals.WaitingHunJianPeiOuTime'));
}
}
}
}
return \Yz::Return(true, '获取成功', [

@ -5,6 +5,7 @@ return [
'WxAppid' => 'wx526430047d34c85c', //岚科公众号
'WxAppSecret' => '975b8a8b627b1bde71bbe49149134549', //岚科公众号
'WaitingPaymentTime'=>20, //等待支付时间,单位分钟
'WaitingHunJianPeiOuTime'=>15, //等待婚检配偶下单时间,单位分钟
'PayNotifyUrl' =>"http://124.225.137.54:39080/h5/#/pages/main/order/CheckPay",//支付完成后小程序跳转H5路径
// 'Env'=>'pro',
'Env'=>'dev',

@ -37,7 +37,7 @@
const countdown = ref(null);
const checkStatus = () => {
if (order_info.value.status === 1) {
if (order_info.value.status === 1 || (order_info.value.status===2 && order_info.value.checkup_type_id==4 && order_info.value.end_time)) {
countdown.value = setInterval(() => {
countdownRun();
}, 500);
@ -51,8 +51,8 @@
let minutes = Math.floor(
(order_info.value.end_time - new Date() / 1000) / 60
);
count_down_text.value = `${minutes}${seconds}`;
if (order_info.value.end_time <= new Date() / 1000) {
count_down_text.value =minutes>=0? `${minutes}${seconds}`:"限制时间";
if (order_info.value.end_time <= new Date() / 1000 && order_info.value.status === 1) {
clearInterval(countdown.value);
order_info.value.status = 3;
}
@ -284,6 +284,11 @@
<text class="time_red">{{ count_down_text }}</text>
<text>内完成支付</text>
</view>
<view style="margin-top: 4rpx;" v-if="[2].includes(order_info.status) && order_info.checkup_type_id==4 && order_info.end_time">
<text>请让您的配偶在</text>
<text class="time_red">{{ count_down_text }}</text>
<text>内完成婚检预约</text>
</view>
<view v-if="[2, 4].includes(order_info.status)">
<view>支付时间</view>
<view>{{ order_info.pay_time }}</view>

@ -310,8 +310,8 @@
})
$response(response, () => {
uni.navigateTo({
// url: '/pages/main/combo/combo',
url: '/pages/main/selectDoctor/selectDoctor?month=all'
url: '/pages/main/combo/combo',
// url: '/pages/main/selectDoctor/selectDoctor?month=all'
})
})
}

Loading…
Cancel
Save