Commit be131c32 by 朱继来

调整拼单发货

parent 66957556
...@@ -470,6 +470,8 @@ Class AddOrderController extends Controller ...@@ -470,6 +470,8 @@ Class AddOrderController extends Controller
$data['address_id'] = $request->input('address_id', 0); $data['address_id'] = $request->input('address_id', 0);
$data['cart_id'] = $request->input('cart_ids', ''); $data['cart_id'] = $request->input('cart_ids', '');
$data['user_coupon_id'] = $request->input('user_coupon_id', 0); $data['user_coupon_id'] = $request->input('user_coupon_id', 0);
$data['send_type'] = $request->input('zy_delivery_type', 1); // 发货方式
if ($is_online == 0) { if ($is_online == 0) {
$data['type'] = 3; // 自营线下 $data['type'] = 3; // 自营线下
} else if ($is_online == 2) { } else if ($is_online == 2) {
......
...@@ -892,6 +892,27 @@ ...@@ -892,6 +892,27 @@
layer.msg('请先添加商品'); layer.msg('请先添加商品');
} }
}) })
// 发货方式
$('.zy_delivery_type').change(function() {
var coupon_id = $('#user_coupon').val();
var address_id = $('.address_id').val();
var user_id = $('.user_id').val();
var cart_ids = [];
$('.shop-table tbody').find('tr').each(function() {
var cid = $(this).data('cid');
cart_ids.push(cid);
})
if (coupon_id) {
$('.user_coupon_id').val(coupon_id);
} else {
$('.user_coupon_id').val('');
}
loading.confirm(user_id, address_id, cart_ids, coupon_id, goods_type, is_online); // 确认订单信息
})
}, },
// 购物车商品列表 // 购物车商品列表
...@@ -1054,6 +1075,7 @@ ...@@ -1054,6 +1075,7 @@
confirm: function(user_id, address_id, cart_ids, user_coupon_id, goods_type, is_online=1) { confirm: function(user_id, address_id, cart_ids, user_coupon_id, goods_type, is_online=1) {
var self = this; var self = this;
var business_type = $('#business_type'); // 自营其他业务 var business_type = $('#business_type'); // 自营其他业务
var zy_delivery_type = $('.zy_delivery_type').val(); // 发货方式
if (business_type.length > 0) { if (business_type.length > 0) {
business_type = business_type.val(); business_type = business_type.val();
...@@ -1064,7 +1086,7 @@ ...@@ -1064,7 +1086,7 @@
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: '/ajax/confirm', url: '/ajax/confirm',
data: {uid: user_id, address_id: address_id, cart_ids: cart_ids, user_coupon_id: user_coupon_id, goods_type: goods_type, is_online: is_online, business_type: business_type}, data: {uid: user_id, address_id: address_id, cart_ids: cart_ids, user_coupon_id: user_coupon_id, goods_type: goods_type, is_online: is_online, business_type: business_type, zy_delivery_type: zy_delivery_type},
dataType: "json", dataType: "json",
success: function(resp){console.log(resp); success: function(resp){console.log(resp);
if (resp.errcode == 0) { if (resp.errcode == 0) {
......
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