Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
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
a0e72b53781dadda847e72d0f33ab32bf8164f39
1 parent
70877029
code-better
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
42 deletions
apps/product/models/detail.js
public/hbs/product/detail/infodata.hbs
apps/product/models/detail.js
View file @
a0e72b5
...
...
@@ -709,62 +709,62 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
};
// 显示加入购物车链接
if
(
preSale
)
{
if
(
preSale
)
{
// 预售
dest
.
cartInfo
.
preSale
=
true
;
}
else
if
(
soldOut
)
{
}
else
if
(
soldOut
)
{
// 卖光了
dest
.
cartInfo
.
soldOut
=
true
;
}
else
if
(
notForSale
)
{
}
else
if
(
notForSale
)
{
// 非卖品
dest
.
cartInfo
.
notForSale
=
true
;
}
else
if
(
origin
.
is_deposit_advance
===
'Y'
)
{
}
else
if
(
origin
.
is_deposit_advance
===
'Y'
)
{
// 定金预售
dest
.
cartInfo
.
isDepositAdvance
=
true
;
}
else
{
}
else
if
(
origin
.
isLimitBuy
)
{
// 限购
Object
.
assign
(
dest
.
cartInfo
,
cartInfo
,
{
price
:
dest
.
goodsPrice
.
previousPrice
?
dest
.
goodsPrice
.
previousPrice
:
''
,
salePrice
:
dest
.
goodsPrice
.
currentPrice
?
dest
.
goodsPrice
.
currentPrice
:
''
,
});
// 限购商品
if
(
origin
.
isLimitBuy
)
{
return
api
.
get
(
''
,
{
method
:
'app.limitProduct.productStatus'
,
limitProductCode
:
origin
.
limitProductCode
,
uid
:
uid
,
product_skn
:
origin
.
product_skn
},
{
code
:
200
,
cache
:
true
}).
then
((
result
)
=>
{
if
(
result
.
data
)
{
if
(
!
result
.
data
.
isLimitBuy
)
{
dest
.
cartInfo
.
soldOut
=
true
;
return
resolve
(
dest
);
}
// 是否开售
let
isBeginSale
=
(
result
.
data
.
saleStatus
===
1
);
return
api
.
get
(
''
,
{
method
:
'app.limitProduct.productStatus'
,
limitProductCode
:
origin
.
limitProductCode
,
uid
:
uid
,
product_skn
:
origin
.
product_skn
},
{
code
:
200
,
cache
:
true
}).
then
((
result
)
=>
{
if
(
result
.
data
)
{
if
(
!
result
.
data
.
isLimitBuy
)
{
dest
.
cartInfo
.
soldOut
=
true
;
return
resolve
(
dest
);
}
// 限购商品有关的展示状态
let
showStatus
=
1
;
// 是否开售
let
isBeginSale
=
(
result
.
data
.
saleStatus
===
1
);
origin
.
showStatus
&&
(
showStatus
=
parseInt
(
result
.
data
.
showStatus
,
10
));
// 限购商品有关的展示状态
let
showStatus
=
1
;
// 处理限购商品有关的按钮状态
dest
=
_procShowStatus
(
dest
,
showStatus
,
isBeginSale
);
origin
.
showStatus
&&
(
showStatus
=
parseInt
(
result
.
data
.
showStatus
,
10
));
dest
.
cartInfo
.
limitProductCode
=
origin
.
limitProductCode
;
dest
.
cartInfo
.
limitCodeUrl
=
_getLimitCodeUrl
(
origin
.
limitProductCode
,
origin
.
product_skn
,
ua
);
dest
.
cartInfo
.
limitProductPay
=
helpers
.
urlFormat
(
'/cart/index/orderEnsure'
);
return
resolve
(
dest
);
}
else
{
dest
.
cartInfo
.
soldOut
=
true
;
return
resolve
(
dest
);
}
// 处理限购商品有关的按钮状态
dest
=
_procShowStatus
(
dest
,
showStatus
,
isBeginSale
);
});
}
else
{
dest
.
cartInfo
.
addToCartUrl
=
helpers
.
urlFormat
(
'/product/buy_'
+
origin
.
product_id
+
'_'
+
dest
.
cartInfo
.
limitProductCode
=
origin
.
limitProductCode
;
dest
.
cartInfo
.
limitCodeUrl
=
_getLimitCodeUrl
(
origin
.
limitProductCode
,
origin
.
product_skn
,
ua
);
dest
.
cartInfo
.
limitProductPay
=
helpers
.
urlFormat
(
'/cart/index/orderEnsure'
);
return
resolve
(
dest
);
}
else
{
dest
.
cartInfo
.
soldOut
=
true
;
return
resolve
(
dest
);
}
});
}
else
{
// 除了上面商品之外的普通商品
Object
.
assign
(
dest
.
cartInfo
,
cartInfo
,
{
price
:
dest
.
goodsPrice
.
previousPrice
?
dest
.
goodsPrice
.
previousPrice
:
''
,
salePrice
:
dest
.
goodsPrice
.
currentPrice
?
dest
.
goodsPrice
.
currentPrice
:
''
,
});
dest
.
cartInfo
.
addToCartUrl
=
helpers
.
urlFormat
(
'/product/buy_'
+
origin
.
product_id
+
'_'
+
origin
.
goods_id
+
'.html'
);
}
}
return
resolve
(
dest
);
}).
then
(
result
=>
{
...
...
public/hbs/product/detail/infodata.hbs
View file @
a0e72b5
...
...
@@ -19,7 +19,10 @@
<div
class=
"tip
{{#
unless
@root
.
isCollect
}}
opa
{{/
unless
}}
"
>
{{#if
@root
.
isCollect
}}
已收藏
{{else}}
收藏
{{/if}}
</div>
</a>
{{#if
addToCartUrl
}}
<a
id=
"addtoCart"
href=
"javascript:;"
class=
"addto-cart add-to-cart-url"
>
{{#if
tickets
}}
立即购买
{{else}}
加入购物车
{{/if}}
</a>
<a
id=
"addtoCart"
href=
"javascript:;"
class=
"addto-cart add-to-cart-url"
>
加入购物车
</a>
{{/if}}
{{#if
tickets
}}
<a
id=
"addtoCart"
href=
"javascript:;"
class=
"addto-cart add-to-cart-url"
>
立即购买
</a>
{{/if}}
{{#if
isDepositAdvance
}}
<a
id=
"isDepositAdvance"
href=
"javascript:;"
class=
"addto-cart add-to-cart-url"
>
立即购买
</a>
...
...
Please
register
or
login
to post a comment