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
Plain Diff
Browse Files
Authored by
yyq
8 years ago
Commit
9b3cace7634280283f6b589d50c26294130ada79
2 parents
e00e9b22
7b80b0a4
Merge branch 'feature/shoppingCart' of git.yoho.cn:fe/yohobuy-node into feature/shoppingCart
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
apps/cart/models/cart-helper.js
apps/cart/models/cart-service.js
mix/mix/cart/cart-item.hbs
public/scss/cart/_cart.css
apps/cart/models/cart-helper.js
View file @
9b3cace
...
...
@@ -42,9 +42,6 @@ const getShoppingKeyByCookie = (req) => {
const
transPrice
=
(
price
)
=>
{
return
price
?
(
price
*
1
).
toFixed
(
2
)
:
'0.00'
;
};
const
trans
=
(
x
)
=>
{
return
x
*
1
;
};
/**
* 生成公开的TOKEN凭证
...
...
@@ -424,10 +421,9 @@ const formatPromotion = (it, selectedGiftsList) => {
}
tipTxt
=
'<span style=\'color:#ff575c\'>'
+
tipTxt
+
'</span>'
;
info
.
promotionTitle
=
'还差'
+
tipTxt
+
'满足'
+
' '
+
info
.
promotionTitle
;
info
.
promotionTitle
=
'还差'
+
tipTxt
+
'满足 '
+
info
.
promotionTitle
;
}
else
if
(
status
===
10
)
{
info
.
promotionTitle
=
'已满足
'
+
'
'
+
info
.
promotionTitle
;
info
.
promotionTitle
=
'已满足 '
+
info
.
promotionTitle
;
}
if
(
info
.
giftGoodsList
)
{
...
...
apps/cart/models/cart-service.js
View file @
9b3cace
...
...
@@ -19,6 +19,17 @@ const productAPI = require('./product-api');
const
cartApi
=
require
(
'./cart-api'
);
const
chelper
=
require
(
'./cart-helper'
);
/**
* 转换价格
*
* @param float|string $price 价格
* @return float|string 转换之后的价格
*/
const
transPrice
=
(
price
)
=>
{
return
price
?
(
price
*
1
).
toFixed
(
2
)
:
'0.00'
;
};
const
_getProductIntroAsync
=
(
productSkn
)
=>
{
return
co
(
function
*
()
{
let
result
=
yield
Promise
.
props
({
...
...
@@ -990,7 +1001,7 @@ const getMiniCartData = (uid, shoppingKey) => {
product_name
:
g
.
product_name
,
factory_goods_name
:
g
.
factory_goods_name
,
size_name
:
g
.
size_name
,
show_price
:
g
.
real_price
,
show_price
:
transPrice
(
g
.
real_price
)
,
buy_number
:
g
.
buy_number
,
goods_incart_id
:
g
.
shopping_cart_id
,
product_sku
:
g
.
product_sku
,
...
...
mix/mix/cart/cart-item.hbs
View file @
9b3cace
...
...
@@ -64,10 +64,10 @@
<span
class=
"sale-info-title"
>
促销信息
<i></i></span>
<ul
class=
"none"
>
{{#
promotionInfos
}}
<li>
{{
promotionTitle
}}
<li>
{{
{
promotionTitle
}
}}
{{>
mix
/
cart
/
cart-promotion-btn
}}
{{#if
isNotReach
}}
<a
class=
"btn-clear blue order-pay-link"
target=
"_blank"
href=
"
{{
promotionPageUrl
}}
"
>
去凑单
</a>
<a
class=
"btn-clear blue order-pay-link"
target=
"_blank"
href=
"
{{
promotionPageUrl
}}
"
>
去凑单
</a>
{{/if}}
</li>
{{/
promotionInfos
}}
...
...
public/scss/cart/_cart.css
View file @
9b3cace
...
...
@@ -1039,6 +1039,9 @@
left
:
22%
;
z-index
:
21
;
}
.tip-message
{
margin-top
:
-2px
;
}
}
.sale-info
{
&.active
{
...
...
Please
register
or
login
to post a comment