Commit be131c32 by 朱继来

调整拼单发货

parent 66957556
......@@ -465,11 +465,13 @@ Class AddOrderController extends Controller
public function confirm(Request $request)
{
if ($request->isMethod('post')) {
$is_online = $request->input('is_online');
$data['uid'] = $request->input('uid', 0);
$data['address_id'] = $request->input('address_id', 0);
$data['cart_id'] = $request->input('cart_ids', '');
$is_online = $request->input('is_online');
$data['uid'] = $request->input('uid', 0);
$data['address_id'] = $request->input('address_id', 0);
$data['cart_id'] = $request->input('cart_ids', '');
$data['user_coupon_id'] = $request->input('user_coupon_id', 0);
$data['send_type'] = $request->input('zy_delivery_type', 1); // 发货方式
if ($is_online == 0) {
$data['type'] = 3; // 自营线下
} else if ($is_online == 2) {
......
......@@ -892,6 +892,27 @@
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); // 确认订单信息
})
},
// 购物车商品列表
......@@ -1053,7 +1074,8 @@
// 确认订单信息
confirm: function(user_id, address_id, cart_ids, user_coupon_id, goods_type, is_online=1) {
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) {
business_type = business_type.val();
......@@ -1064,7 +1086,7 @@
$.ajax({
type: 'post',
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",
success: function(resp){console.log(resp);
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