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
f368b2696eb3d980207a2ff731f9334875e53afb
1 parent
112aa9f4
预售商品增减时不显示预售提示
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
11 deletions
apps/cart/controllers/cart.js
apps/cart/models/cart-helper.js
mix/mix/cart/cart-item.hbs
mix/mix/cart/cart-list.hbs
public/js/cart/cart-action.js
public/js/cart/cart-api.js
apps/cart/controllers/cart.js
View file @
f368b26
...
...
@@ -203,7 +203,6 @@ const cart = (req, res, next) => {
req
.
ctx
(
service
).
getCartData
(
uid
,
shoppingKey
)
.
then
(
ret
=>
{
return
res
.
render
(
'cart'
,
{
title
:
'购物车 | '
+
(
res
.
locals
.
title
||
''
),
module
:
'cart'
,
...
...
apps/cart/models/cart-helper.js
View file @
f368b26
...
...
@@ -119,7 +119,6 @@ const getCartDelList = (req, res, addsStr, delSkuId) => {
* @return array 处理之后的购物车商品数据
*/
const
formatCartGoods
=
(
cartGoods
,
isAdvanceCart
,
inValid
,
isOffShelves
,
analysis
)
=>
{
return
_
.
map
(
cartGoods
,
(
it
)
=>
{
let
goods
=
{
id
:
it
.
product_sku
,
...
...
@@ -142,7 +141,8 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys
productSubtotal
:
transPrice
(
it
.
last_vip_price
*
it
.
buy_number
),
promotionId
:
it
.
promotion_id
||
0
,
isLimitSkn
:
it
.
is_limit_skn
===
'Y'
,
// is_limit_skn=Y 不支持7天无理由退货
isAdvance
:
isAdvanceCart
isAdvance
:
isAdvanceCart
,
saleTimeStr
:
!!
it
.
sale_time_str
};
// 划线的价格
...
...
@@ -435,7 +435,6 @@ const formatPoolPromotionInfos = (infoList, selectedGiftsList) => {
* 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中
*/
const
formatSubPromotionPools
=
(
pools
,
selectedGiftsList
,
isAdvance
,
analysis
)
=>
{
let
goodsListPool
=
_
.
map
(
pools
,
p
=>
{
let
pool
=
{
poolType
:
p
.
pool_type
,
...
...
@@ -539,7 +538,6 @@ const formatSoldOutPools = (pools, selectedGiftsList, isAdvance, analysis) => {
};
const
formatCart
=
(
cartDataRet
,
uid
,
shoppingKey
,
cartDelList
)
=>
{
let
analysisData
=
{
ids
:
[],
criteo
:
[]
...
...
mix/mix/cart/cart-item.hbs
View file @
f368b26
<li
class=
"pre-sell-box tr
{{#
saleTimeStr
}}
presale
{{/
saleTimeStr
}}
{{#
isChecked
}}
active
{{/
isChecked
}}
{{#
inValid
}}
tr-disabled
{{#
unless
sku
}}
tr-disabled-none
{{/
unless
}}{{/
inValid
}}
{{#
isSamebrandWithNext
}}
tr-group
{{/
isSamebrandWithNext
}}
"
...
...
@@ -25,7 +26,7 @@
{{#if
inValid
}}
<i
class=
"cart-item-disabled iconfont"
></i>
{{else}}
<i
class=
"cart-item-check iconfont
{{#
isChecked
}}
cart-item-checked
{{/
isChecked
}}
"
<i
class=
"cart-item-check iconfont
{{#
isChecked
}}
cart-item-checked
{{/
isChecked
}}
{{#
saleTimeStr
}}
presale
{{/
saleTimeStr
}}
"
data-role=
"cart-item-check"
data-goodstype=
"
{{
goodsType
}}
"
{{#
isTipNoStore
}}
data-tipnostore=
"true"
{{/
isTipNoStore
}}
...
...
mix/mix/cart/cart-list.hbs
View file @
f368b26
...
...
@@ -90,6 +90,7 @@
</div>
{{#
pools
}}
<div
class=
"promotion-pool
{{#
unless
@first
}}
mt20
{{/
unless
}}
"
data-role=
"promotion-pool"
>
{{#
eq
poolType
3
}}
{{>
mix
/
cart
/
cart-pool-title
}}
...
...
public/js/cart/cart-action.js
View file @
f368b26
...
...
@@ -471,7 +471,6 @@ Cart = {
var
oprType
=
$this
.
hasClass
(
'minus'
)
?
'decreaseNum'
:
'increaseNum'
;
countJSON
[
oprType
]
=
1
;
if
(
$this
.
siblings
(
'input'
).
val
()
===
'1'
&&
$this
.
hasClass
(
'minus'
))
{
return
false
;
}
...
...
@@ -479,14 +478,14 @@ Cart = {
if
(
$this
.
hasClass
(
'disabled'
))
{
return
;
}
console
.
log
(
$btn
[
0
]);
capi
.
cartItemNumChg
(
$
.
extend
(
countJSON
,
{
sku
:
$item
.
data
(
'id'
),
batch_no
:
$item
.
data
(
'batch-no'
),
activity_id
:
$item
.
data
(
'pool-id'
)
}));
if
(
!
$btn
.
hasClass
(
'cart-item-checked'
))
{
if
(
!
$btn
.
hasClass
(
'cart-item-checked'
)
&&
!
$btn
.
hasClass
(
'presale'
)
)
{
$btn
.
click
();
}
},
...
...
public/js/cart/cart-api.js
View file @
f368b26
...
...
@@ -140,7 +140,7 @@ function refreshCart(data) {
// checkbox提交ajax
function
choiceOut
(
items
)
{
console
.
log
(
items
);
var
skuList
=
$
.
isArray
(
items
)
?
items
:
[
items
];
var
hasPromotion
=
false
;
...
...
@@ -238,7 +238,6 @@ cartItemNumChg = (function() {
url
:
'/cart/cart/modifyNum'
,
data
:
data
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
refreshCart
(
d
.
data
);
}
else
{
...
...
Please
register
or
login
to post a comment