Authored by hongweigao

Merge branch 'feature/new-product-detail' of http://git.yoho.cn/fe/yohobuy-node

…into feature/new-product-detail
... ... @@ -11,7 +11,7 @@ const url = require('url');
const findBySkn = (skn) => {
return api.getProductBySknAsync(skn).then((result) => {
if (result.code === 200 && result.data.product_url) {
if (result && result.code && result.code === 200 && result.data.product_url) {
return {
url: url.parse(_.get(result, 'data.product_url', '')).path
};
... ... @@ -23,7 +23,7 @@ const findBySkn = (skn) => {
const findBySku = (sku) => {
return api.getProductBySkuAsync(`[${sku}]`).then((result) => {
if (result.code === 200 && !_.isEmpty(result.data)) {
if (result && result.code && result.code === 200 && !_.isEmpty(result.data)) {
let product = _.head(result.data) || {};
let skn = product.erpProductId || '';
... ...
... ... @@ -127,10 +127,7 @@
{{else}}
{{!-- 各颜色下所有尺码均售罄则只显示售罄按钮 --}}
{{#unless soldOut}}
{{# buyNow}}
<span id="buy-now" class="buy-btn buy-now item-buy{{#if dis}} dis{{/if}}"
data-base="{{buyNowBase}}">立即购买</span>
{{/ buyNow}}
{{# openSoon}}
<span id="open-soon" class="buy-btn item-buy dis">即将开售</span>
{{/ openSoon}}
... ... @@ -141,6 +138,12 @@
<span id="add-to-cart" class="buy-btn item-buy add-to-cart"> <i class="iconfont">
&#xe61b;</i> 加入购物车 </span>
{{/if}}
{{# buyNow}}
<span id="buy-now" class="item-buy buy-now{{#if dis}} dis{{/if}}"
data-base="{{buyNowBase}}">立即购买</span>
{{/ buyNow}}
{{/unless}}
{{/if}}
... ...
... ... @@ -20,8 +20,8 @@ module.exports = {
// test2
singleApi: 'http://192.168.102.27:8092/brower',
// api: 'http://api-test2.yohops.com:9999/',
// service: 'http://service-test2.yohops.com:9999/',
api: 'http://api-test2.yohops.com:9999/',
service: 'http://service-test2.yohops.com:9999/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
... ...
... ... @@ -448,7 +448,7 @@ bindEvent.add(function() {
$descColor.text($this.data('color'));
// 切换尺码显示
$sizes.not('.hide').addClass('hide');
$sizes.not('.hide').addClass('hide').children('li').removeClass('focus');
$sizes.eq(index).removeClass('hide');
// 是否展览票
... ...
... ... @@ -729,8 +729,8 @@
.buy-ticket {
display: inline-block;
margin-right: 10px;
height: 48px;
line-height: 48px;
height: 46px;
line-height: 46px;
width: 180px;
text-align: center;
color: #fff;
... ... @@ -748,18 +748,38 @@
}
}
.buy-now {
display: inline-block;
margin-right: 10px;
height: 44px;
line-height: 44px;
width: 180px;
text-align: center;
color: black;
font-size: 16px;
cursor: pointer;
border: 1px solid #222;
background: white;
&.dis {
background: #ccc;
border: 1px solid #ccc;
color: white;
}
}
.collect-product,
.keep-shopping {
display: inline-block;
width: 120px;
height: 48px;
height: 44px;
text-align: center;
line-height: 48px;
line-height: 44px;
background: #fff;
color: #222;
border: 1px solid #ccc;
font-weight: bold;
font-size: 16px;
cursor: pointer;
... ...