Commit cdc083c1 by 朱继来

下单页面添加自提配送

parent 9989a072
......@@ -674,16 +674,18 @@ Class AddOrderController extends Controller
public function create(Request $request)
{
if ($request->isMethod('post')) {
$data['type'] = $request->input('type');
$data['inv_com_id'] = $request->input('inv_com_id', 0);
$data['uid'] = $request->input('uid');
$data['sale_id'] = $request->user->userId;
$data['address_id'] = $request->input('address_id');
$data['cart_id'] = implode(',', $request->input('cart_ids'));
$data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', '');
$data['shipping_type'] = $request->input('shipping_type', 1);
$data['type'] = $request->input('type');
$data['inv_com_id'] = $request->input('inv_com_id', 0);
$data['uid'] = $request->input('uid');
$data['sale_id'] = $request->user->userId;
$data['address_id'] = $request->input('address_id');
$data['cart_id'] = implode(',', $request->input('cart_ids'));
$data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', '');
$data['shipping_type'] = $request->input('shipping_type', 1);
$data['self_consignee'] = $request->input('self_consignee', '');
$data['self_mobile'] = $request->input('self_mobile', '');
if ($data['type'] == 3) { // 自营线下订单
$data['address_name'] = $request->input('address_name');
......
......@@ -120,9 +120,13 @@
if (shipping_type == 2) {
$('.select-addr').hide();
$('.address-content').hide();
$('.address-content-self').show();
$('.address_id').val(1);
} else {
$('.select-addr').show();
$('.address-content-self').hide();
$('#address').val('');
$('.address_id').val('');
}
var coupon_id = $('#user_coupon').val();
......@@ -775,12 +779,34 @@
var inv_type = $('input[name=inv_type]:checked').val();
var user_coupon_id = $('.user_coupon_id').val();
var zy_delivery_type = $('.zy_delivery_type').val();
var self_consignee = $('.self_consignee').val() || '';
var self_mobile = $('.self_mobile').val() || '';
if (!address_id) {
layer.msg('请选择快递信息');
return false;
}
if (shipping_type == 2 && !self_consignee) {
layer.msg('请填写自提联系人');
return false;
}
if (shipping_type == 2 && !self_mobile) {
layer.msg('请填写自提联系电话');
return false;
}
// if (self_mobile && !(/^1[3456789]\d{9}$/.test(self_mobile))) {
// layer.msg('自提联系电话-手机号码格式错误');
// return false;
// }
if (self_mobile && !(/^((\d{3,4})|\d{3,4}\-|\s)?\d{7,14}$/.test(self_mobile))) {
layer.msg('自提联系电话格式错误');
return false;
}
if (!zy_delivery_type) {
layer.msg('请选择发货方式');
return false;
......@@ -854,6 +880,8 @@
datax.tax_id = tax_id;
datax.user_coupon_id = user_coupon_id;
datax.zy_delivery_type = zy_delivery_type;
datax.self_consignee = self_consignee;
datax.self_mobile = self_mobile;
}
// 自营线上
......
......@@ -102,7 +102,34 @@
</div>
</div>
</div>
</div>
</div>
<!-- 自提展示 -->
<div class="address-content-self" style="display: none;">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span><i class="error">*</i> 联系人:</span>
<input type="text" name="self_consignee" class="self_consignee">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span><i class="error">*</i> 联系电话:</span>
<input type="text" name="self_mobile" class="self_mobile">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>收货地址:</span>
<span class="address-detail">{{ Config('params.joint_addr') }}</span>
</div>
</div>
</div>
</div>
</div>
<div class="shipping-info">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment