作者 sgj
1 个管道 的构建 通过 耗费 3 秒

修改预约提交逻辑

... ... @@ -314,7 +314,6 @@ class YuyueController extends UserBaseController
$res = Db::name('yuyue')->insert($data);
if ($res) {
$stu_info = Db::name('user')->where(['id' => $data['uid']])->find();
$tea_info = Db::name('user')->where(['id' => $data['teach_id']])->find();
$msg = "您好!您已成功预约:{$data['yuyue_day']}/{$data['yuyue_begin']}:00 - {$data['yuyue_end']}:00 时间段{$tea_info['user_nickname']}的课程,请按时上课,教练电话:{$tea_info['mobile']},如有问题可直接与教练或您的学车顾问进行联系。【悠乐驾】";
... ... @@ -353,9 +352,6 @@ class YuyueController extends UserBaseController
$res = $tool->wxtemsg_send($param1);
$res = $tool->wxtemsg_send($param2);
return json(['code' => '1', 'msg' => '预约成功']);
} else {
return json(['code' => '0', 'msg' => '抱歉,预约失败']);
... ...
... ... @@ -204,7 +204,7 @@
<!--弹跳框-->
<div class="full_bg"></div>
<div class="yu_tan">
<div class="yu_tan" data-qr="1">
<div class="yu_tan_box">
<img src="/static/image/tan_car1.png" class="tan_car"/>
<h1 class="tan_text">您确定要预约08:00~09:00张教练的课程吗</h1>
... ... @@ -354,6 +354,9 @@
}
});
$("#btn_yuyue").click(function () {
var data_qr = $('.yu_tan').attr("data-qr");
if (data_qr == 1) {
var list = $('.time_bg_icon');
var day1 = $('.day_bg i').text();
var week = $('.day_bg b').text();
... ... @@ -374,11 +377,14 @@
}, success: function (res) {
console.log(res);
if (res.code == "1") {
$('.yu_tan').attr("data-qr", "2");
tankuang();
window.location.href = "/user/yuyue/coach_list";
}
}
})
}
}
});
});
</script>
... ...