Authored by ccbikai

Merge branch 'feature/product-detail' of git.yoho.cn:fe/yohobuywap-node into feature/product-detail

... ... @@ -352,7 +352,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => {
};
allSizeList[sizeName] = (allSizeList[sizeName] === null ||
typeof allSizeList[sizeName] === 'undefined') ? build :
typeof allSizeList[sizeName] === 'undefined') ? build :
allSizeList[sizeName];
colorStorageNum += parseInt(size.goodsSizeStorageNum, 10);
... ... @@ -384,10 +384,10 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => {
sizeGroup[0] = {
size: []
};
_.forEach(allSizeList, function(value) {
_.forEach(allSizeList, function(value, key) {
// 默认尺码
sizeGroup[0].size.push({
name: sizeName,
name: key,
sizeNum: _.toNumber(value.storage) > 0 ? true : false,
id: value.id
});
... ... @@ -400,10 +400,10 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => {
_.forEach(colorList, function(colorArr) {
colorArr.colorNum = 0;
if (colorStorageGroup[colorArr.skcId] &&
colorStorageGroup[colorArr.skcId][sizeName]) {
colorArr.colorNum = colorStorageGroup[colorArr.skcId][sizeName];
colorStorageGroup[colorArr.skcId][key]) {
colorArr.colorNum = colorStorageGroup[colorArr.skcId][key];
}
colorGroup[i].color.push(colorArr);
colorGroup[i].color.push(Object.assign({}, colorArr));
});
colorGroup[i].id = value.id;
... ... @@ -428,6 +428,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => {
++i;
});
// 商品图:多个
if (goodsGroup.length > 1) {
let bannerList = [];
... ... @@ -477,7 +478,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => {
if (origin.isLimitBuy === 'Y') {
// 是否开售
let isBeginSale = (origin.saleStatus !== null && typeof origin.saleStatus !== 'undefined' &&
origin.saleStatus === 1);
origin.saleStatus === 1);
// 限购商品有关的展示状态
let showStatus = 1;
... ... @@ -545,6 +546,28 @@ let _getPromotionInfo = (skn) => {
});
};
/**
* 获取默认咨询列表
*/
const _getCommonConsult = () => {
let params = {
method: 'app.consult.common'
};
return api.get('', params, {
code: 200
}).then(result => {
let data = {};
if (result.data) {
data = result.data;
}
return data;
});
};
let getProductData = (data) => {
let finalResult;
let params = {
... ... @@ -570,7 +593,8 @@ let getProductData = (data) => {
_getPromotionInfo(result.erpProductId),
comment.getCommentInfo({
productId: result.id
})
}),
_getCommonConsult()
]).then((info) => {
result.promotionBoList = info[1];
... ... @@ -579,6 +603,14 @@ let getProductData = (data) => {
Object.assign(finalResult.feedbacks, info[2]);
if (!_.isEmpty(info[3]) && !_.get(info[2], 'feedbacks.consultsNum', 0)) {
Object.assign(finalResult.feedbacks, {
commonConsults: true,
consultsNum: true,
consults: _.take(info[3], 2)
});
}
return finalResult;
});
... ...
<ul id="nav-tab" class="nav-tab clearfix">
<li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li>
<li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
{{#if commonConsults}}
<li class="consult-nav tap-hightlight">常见问题</li>
{{^}}
<li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
{{/if}}
</ul>
<div id="feedback-content" >
<div class="comment-content content ">
... ...
... ... @@ -56,7 +56,7 @@
"uuid": "^2.0.2",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.1.4",
"yoho-node-lib": "0.0.17"
"yoho-node-lib": "0.0.32"
},
"devDependencies": {
"autoprefixer": "^6.3.7",
... ...

6.28 KB | W: | H:

4.79 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -47,17 +47,17 @@ function hiddenTips($ele) {
// }
// }
function wrapElements(selector, count) {
var elArr = null;
// function wrapElements(selector, count) {
// var elArr = null;
$(selector).each(function(idx) {
elArr = $(selector).slice(idx, idx + count);
// $(selector).each(function(idx) {
// elArr = $(selector).slice(idx, idx + count);
if (elArr.length === count && idx % count === 0) {
$(elArr).wrapAll($('<div class="js-wraper"></div>'));
}
});
}
// if (elArr.length === count && idx % count === 0) {
// $(elArr).wrapAll($('<div class="js-wraper"></div>'));
// }
// });
// }
... ... @@ -97,7 +97,7 @@ function search() {
// if (!isFlexSupport()) {
// $('.detail .column').removeClass('column').addClass('oldbox');
// }
wrapElements('.detail .column', 2);
// wrapElements('.detail .column', 2);
searching = false;
end = true;
loading.hideLoadingMask();
... ...
... ... @@ -56,26 +56,28 @@ $basicBtnC: #eb0313;
&.table {
width: 100%;
.js-wraper {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
overflow: hidden;
.column {
display: flex;
flex-basis: 49.9%;
align-items: center;
box-sizing: border-box;
padding: 6px 3%;
width: 49.9%;
border: 1px solid #fff;
background-color: $tableCellC;
word-wrap: break-word;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
font-size: 24px;
}
.column:nth-child(2n+1) {
float: left;
}
.column:nth-child(2n+2) {
float: right;
}
.oldbox {
float: left;
overflow: hidden;
... ... @@ -384,13 +386,13 @@ $basicBtnC: #eb0313;
text-align: left;
.vip-img {
background: resolve('product/silver.png') no-repeat;
background: resolve("product/silver.png") no-repeat;
}
}
&:nth-child(2) {
.vip-img {
background: resolve('product/golden.png') no-repeat;
background: resolve("product/golden.png") no-repeat;
}
}
... ... @@ -398,7 +400,7 @@ $basicBtnC: #eb0313;
text-align: right;
.vip-img {
background: resolve('product/platinum.png') no-repeat;
background: resolve("product/platinum.png") no-repeat;
}
}
}
... ... @@ -709,6 +711,7 @@ $basicBtnC: #eb0313;
display: inline-block;
&.num-incart {
position: relative;
color: #444;
font-size: 47px;
}
... ... @@ -742,17 +745,16 @@ $basicBtnC: #eb0313;
.num-tag {
position: absolute;
top: 0;
left: 48px;
right: -15px;
display: block;
width: 72px;
height: 72px;
width: 30px;
height: 30px;
border-radius: 50%;
background: $basicBtnC;
color: #fff;
text-align: center;
font-size: 40px;
line-height: 72px;
transform: scale(0.5);
font-size: 20px;
line-height: 30px;
&.hide {
display: none;
... ... @@ -768,3 +770,7 @@ $basicBtnC: #eb0313;
top: 40%;
}
}
iframe {
display: none;
}
... ...
... ... @@ -4,10 +4,8 @@
padding-bottom: 20px;
.service {
margin-left: 50px;
width: 494px;
height: 28px;
background: resolve('product/service.png') no-repeat;
background: resolve("product/service.png") no-repeat;
background-size: cover;
}
... ...