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
刘传洋
8 years ago
Commit
ddcaed5b9087e44af04796e6ef2a11d9e6930447
1 parent
4c766cf1
m
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
7 deletions
apps/cart/models/cart-service.js
public/hbs/cart/cart-gifts-win-tpl.hbs
public/hbs/cart/cart-product-info-tpl.hbs
public/js/cart/cart-goods-win.js
apps/cart/models/cart-service.js
View file @
ddcaed5
...
...
@@ -967,6 +967,11 @@ const queryUserPromotionGift = (promotionId, uid, shoppingKey) => {
// 获取选中商品的数据详情
if
(
currentProduct
&&
currentProduct
.
id
)
{
promotionGifts
.
data
.
productInfo
=
yield
getProductInfoAsync
(
currentProduct
.
id
);
// 价格为活动价
if
(
promotionGifts
.
data
.
productInfo
)
{
promotionGifts
.
data
.
productInfo
.
salePrice
=
'¥'
+
currentProduct
.
subjoinPrice
;
}
}
return
promotionGifts
;
...
...
public/hbs/cart/cart-gifts-win-tpl.hbs
View file @
ddcaed5
...
...
@@ -16,8 +16,9 @@
<li
class=
"img-item
{{#if
active
}}
active
{{/if}}
"
data-id=
"
{{
id
}}
"
data-skn=
"
{{
skn
}}
"
data-ispricegift=
"
{{
isPriceGift
}}
"
data-isgift=
"
{{
isGift
}}
"
>
{{#if
subjoinPrice
}}
data-subjoinprice=
"
{{
subjoinPrice
}}
"
{{/if}}
{{#if
isPriceGift
}}
data-ispricegift=
"
{{
isPriceGift
}}
"
{{/if}}
{{#if
isGift
}}
data-isgift=
"
{{
isGift
}}
"
{{/if}}
>
<span
class=
"hide goods-id"
>
{{
goods_id
}}
</span>
<div
class=
"good"
>
<a
href=
"javascript:void(0)"
target=
"_blank"
>
{{!--{{link}}--}}
...
...
public/hbs/cart/cart-product-info-tpl.hbs
View file @
ddcaed5
...
...
@@ -29,15 +29,15 @@
</div>
<div
class=
"price"
>
{{#if
salePrice
}}
<span
class=
"newprice"
>
现价:
<b
class=
"promotion-price"
>
¥
{{
salePrice
}}
</b></span>
<span
class=
"oldprice"
>
活动价:
<del>
¥
{{
marketPrice
}}
</del></span>
<span
class=
"newprice"
>
现价:
<b
class=
"promotion-price"
>
{{
salePrice
}}
</b></span>
<span
class=
"oldprice"
>
活动价:
<del>
{{
marketPrice
}}
</del></span>
{{^}}
<span
class=
"newprice
{{#
presalePrice
}}
none
{{/
presalePrice
}}
"
>
原价:
<b
class=
"promotion-price"
>
¥
{{
marketPrice
}}
</b></span>
<span
class=
"newprice
{{#
presalePrice
}}
none
{{/
presalePrice
}}
"
>
原价:
<b
class=
"promotion-price"
>
{{
marketPrice
}}
</b></span>
{{/if}}
{{#if
presalePrice
}}
<span
class=
"oldprice"
>
原价:
<del>
¥
{{
marketPrice
}}
</del></span>
<span
class=
"newprice"
>
预售价:
<b
class=
"promotion-price"
>
¥
{{
presalePrice
}}
</b></span>
<span
class=
"oldprice"
>
原价:
<del>
{{
marketPrice
}}
</del></span>
<span
class=
"newprice"
>
预售价:
<b
class=
"promotion-price"
>
{{
presalePrice
}}
</b></span>
{{/if}}
{{#
arrivalDate
}}
<span
class=
"arrivalDate"
>
上市期:
{{
arrivalDate
}}
</span>
...
...
public/js/cart/cart-goods-win.js
View file @
ddcaed5
...
...
@@ -91,6 +91,16 @@ GoodsWinAction = {
$this
.
addClass
(
'active'
);
capi
.
getProductInfo
(
id
,
skn
).
then
(
res
=>
{
// 赠品价格为 0, 加价购价格为 活动价
if
(
$this
.
data
(
'isgift'
))
{
res
.
salePrice
=
0
;
}
else
if
(
$this
.
data
(
'ispricegift'
))
{
if
(
$this
.
data
(
'subjoinprice'
))
{
res
.
salePrice
=
'¥'
+
$this
.
data
(
'subjoinprice'
);
}
}
$goodsSelWin
.
find
(
'.product-detail-info'
).
empty
().
append
(
productInfoTpl
(
res
));
});
},
...
...
Please
register
or
login
to post a comment