Commit 9febdead by 朱继来

Merge branch 'zjl_create_order_20180813' into development

parents 221f37ac 03a2741f
...@@ -552,9 +552,9 @@ Class AddOrderController extends Controller ...@@ -552,9 +552,9 @@ Class AddOrderController extends Controller
} }
if (!empty($update)) { if (!empty($update)) {
return ['errcode' => 0, 'errmsg' => '审核成功']; return ['errcode' => 0, 'errmsg' => '操作成功'];
} else { } else {
return ['errcode' => -1, 'errmsg' => '审核失败']; return ['errcode' => -1, 'errmsg' => '操作失败'];
} }
} }
} }
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
this.bind(2, 1); this.bind(2, 1);
}, },
offline: function() { // 自营线下订单 offline: function(internal_uid) { // 自营线下订单
this.bind(2, 0); this.bind(2, 0, internal_uid);
this.lists(user_id, 2, 0); this.lists(internal_uid, 2, 0);
}, },
bind: function(goods_type, is_online) { //goods_type:1-联营,2-自营 is_online:是否线上订单 bind: function(goods_type, is_online, internal_uid='') { //goods_type:1-联营,2-自营 is_online:是否线上订单
var loading = this; var loading = this;
// 获取用户信息 // 获取用户信息
...@@ -280,9 +280,15 @@ ...@@ -280,9 +280,15 @@
var goods_min_num = $(this).parents('.sku-info').find('.goods-min-num').text(); var goods_min_num = $(this).parents('.sku-info').find('.goods-min-num').text();
var goods_id = $(this).siblings('.goods_id').val(); var goods_id = $(this).siblings('.goods_id').val();
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆 var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
var user_id = 0;
if (is_online) { // 线上订单 if (is_online) { // 线上订单
var user_id = $('.user_id').val(); user_id = $('.user_id').val();
if (!user_id) {
layer.msg('请先选择用户');
return false;
}
if (goods_type == 1) { // 联营需要选择交货地 if (goods_type == 1) { // 联营需要选择交货地
delivery_place = $('input[name=delivery_place]:checked').val(); delivery_place = $('input[name=delivery_place]:checked').val();
...@@ -294,10 +300,7 @@ ...@@ -294,10 +300,7 @@
} }
} }
if (!user_id) { user_id = internal_uid ? internal_uid : user_id;
layer.msg('请先选择用户');
return false;
}
var datax = { var datax = {
uid: user_id, uid: user_id,
...@@ -325,11 +328,14 @@ ...@@ -325,11 +328,14 @@
var self = $(this); var self = $(this);
var num = self.val(); var num = self.val();
var cart_id = self.parents('tr').data('cid'); var cart_id = self.parents('tr').data('cid');
var user_id = 0;
if (is_online) { if (is_online) {
var user_id = $('.user_id').val(); user_id = $('.user_id').val();
} }
user_id = internal_uid ? internal_uid : user_id;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/ajax/changeNum', url: '/ajax/changeNum',
...@@ -353,11 +359,14 @@ ...@@ -353,11 +359,14 @@
$('.shop-table').delegate('.remove-goods', 'click', function() { $('.shop-table').delegate('.remove-goods', 'click', function() {
var self = $(this); var self = $(this);
var cart_id = self.parents('tr').data('cid'); var cart_id = self.parents('tr').data('cid');
var user_id = 0;
if (is_online) { if (is_online) {
var user_id = $('.user_id').val(); user_id = $('.user_id').val();
} }
user_id = internal_uid ? internal_uid : user_id;
layer.open({ layer.open({
title: '删除提示', title: '删除提示',
content: '确定删除该商品吗?', content: '确定删除该商品吗?',
...@@ -412,11 +421,14 @@ ...@@ -412,11 +421,14 @@
var address_id = $('input[name=address_id]').val(); var address_id = $('input[name=address_id]').val();
var type = $(this).data('type'); var type = $(this).data('type');
var cart_ids = []; var cart_ids = [];
var user_id = 0;
if (is_online) { if (is_online) {
var user_id = $('.user_id').val(); user_id = $('.user_id').val();
} }
user_id = internal_uid ? internal_uid : user_id;
$('.shop-table tbody tr').each(function() { $('.shop-table tbody tr').each(function() {
var cid = $(this).data('cid'); var cid = $(this).data('cid');
cart_ids.push(cid); cart_ids.push(cid);
......
...@@ -216,9 +216,9 @@ ...@@ -216,9 +216,9 @@
</div> </div>
<script> <script>
var user_id = "{{$internal_uid}}"; var internal_uid = "{{$internal_uid}}";
var sale_id = "{{$sale_id}}"; var sale_id = "{{$sale_id}}";
var URL_api = "{{Config('website.api_domain')}}"; var URL_api = "{{Config('website.api_domain')}}";
$.lie.add_order.offline(); $.lie.add_order.offline(internal_uid);
</script> </script>
\ No newline at end of file
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