Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
邱骏
6 years ago
Commit
bc4cf3e2dbe456b969fc998852c34706c153bbf0
1 parent
0775fd77
购物车结算时选择预售商品给予提示
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletions
apps/cart/controllers/cart.js
apps/cart/models/cart-helper.js
public/js/cart/cart-api.js
apps/cart/controllers/cart.js
View file @
bc4cf3e
...
...
@@ -282,6 +282,7 @@ const selectProduct = (req, res, next) => {
req
.
ctx
(
service
).
selectGoods
(
uid
,
productId
,
shoppingKey
,
hasPromotion
,
cartDelList
)
.
then
(
ret
=>
{
console
.
log
(
ret
);
res
.
send
(
ret
);
}).
catch
(
next
);
};
...
...
apps/cart/models/cart-helper.js
View file @
bc4cf3e
...
...
@@ -570,6 +570,10 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
// 移除的商品列表
result
.
deleteShop
=
cartDelList
;
if
(
cartDataRet
.
code
===
500
)
{
result
.
message
=
cartDataRet
.
message
;
}
// 接口异常时,购物车置为空
if
(
!
cartData
)
{
result
.
isEmpty
=
true
;
...
...
@@ -578,7 +582,6 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
return
result
;
}
// 预售购物车,普通购物车 凑单链接
result
.
moreGoodsLink
=
'//list.yohobuy.com/new'
;
...
...
public/js/cart/cart-api.js
View file @
bc4cf3e
...
...
@@ -166,6 +166,8 @@ function choiceOut(items) {
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
refreshCart
(
d
.
data
);
}
else
if
(
d
.
code
===
500
)
{
new
Alert
(
d
.
data
.
message
||
'操作失败!'
).
show
();
}
}).
always
(
function
()
{
$
(
'.loading'
).
hide
();
...
...
Please
register
or
login
to post a comment