Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0db3351d
authored
Jan 08, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
后台下单-自营购物车检查购买数量,按倍数处理
parent
113abe40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
public/js/add_order.js
public/js/add_order.js
View file @
0db3351d
...
...
@@ -762,6 +762,42 @@
var
address_id
=
$
(
'.address_id'
).
val
();
self
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
}
// 自营商品检查数量
if
(
goods_type
==
2
)
{
var
changeGoods
=
[];
var
myajax
;
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
goods_id
=
$
(
this
).
find
(
'.goods_id'
).
text
();
var
num
=
Number
(
$
(
this
).
find
(
'.goods_num'
).
val
());
var
mpl
=
Number
(
$
(
this
).
find
(
'.goods_mpl'
).
text
());
var
cart_id
=
$
(
this
).
data
(
'cid'
);
var
type
=
$
(
this
).
data
(
'type'
);
if
(
num
%
mpl
!=
0
)
{
num
=
Math
.
ceil
(
num
/
mpl
)
*
mpl
;
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/changeNum'
,
data
:
{
uid
:
user_id
,
num
:
num
,
cart_id
:
cart_id
,
type
:
type
,
goods_type
:
goods_type
},
dataType
:
"json"
,
async
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
changeGoods
.
push
(
goods_id
);
}
},
})
}
})
if
(
changeGoods
.
length
>
0
)
{
layer
.
alert
(
'已按倍数调整购买数量,商品ID:'
+
changeGoods
.
join
(
', '
));
self
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
}
}
}
else
{
$
(
'.shop-lists'
).
hide
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment