|
@@ -191,16 +191,6 @@ const _getActivityDataByProductBaseInfo = (data, additionalData) => { |
|
@@ -191,16 +191,6 @@ const _getActivityDataByProductBaseInfo = (data, additionalData) => { |
191
|
};
|
191
|
};
|
192
|
|
192
|
|
193
|
/**
|
193
|
/**
|
194
|
- * 获取商品咨询和评论数据
|
|
|
195
|
- * @param data
|
|
|
196
|
- */
|
|
|
197
|
-const _getConsultCommentDataByProductInfo = () => {
|
|
|
198
|
- return {
|
|
|
199
|
- commentUrl: helpers.urlFormat('/home/comment')
|
|
|
200
|
- };
|
|
|
201
|
-};
|
|
|
202
|
-
|
|
|
203
|
-/**
|
|
|
204
|
* 获取品牌数据
|
194
|
* 获取品牌数据
|
205
|
*/
|
195
|
*/
|
206
|
const _getBrandDataByProductBaseInfo = (data, additionalData) => {
|
196
|
const _getBrandDataByProductBaseInfo = (data, additionalData) => {
|
|
@@ -1006,7 +996,7 @@ const _getSizeInfo = (productSkn, maxSortId, additionalData)=> { |
|
@@ -1006,7 +996,7 @@ const _getSizeInfo = (productSkn, maxSortId, additionalData)=> { |
1006
|
* @param array $navs
|
996
|
* @param array $navs
|
1007
|
* @return array
|
997
|
* @return array
|
1008
|
*/
|
998
|
*/
|
1009
|
-const _getSeoByGoodsInfo = function(goodsInfo, navs) {
|
999
|
+const _getSeoByGoodsInfo = (goodsInfo, navs) => {
|
1010
|
let title = '';
|
1000
|
let title = '';
|
1011
|
let keywords = '';
|
1001
|
let keywords = '';
|
1012
|
let brandName = '';
|
1002
|
let brandName = '';
|
|
@@ -1081,7 +1071,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -1081,7 +1071,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
1081
|
// 商品标签
|
1071
|
// 商品标签
|
1082
|
result.tags = _getTagsDataByProductInfo(origin);
|
1072
|
result.tags = _getTagsDataByProductInfo(origin);
|
1083
|
|
1073
|
|
1084
|
- // 商品促销短语
|
1074
|
+ // 商品促销短语
|
1085
|
result.saleTip = propOrigin('sales_phrase', '');
|
1075
|
result.saleTip = propOrigin('sales_phrase', '');
|
1086
|
|
1076
|
|
1087
|
// 商品价格
|
1077
|
// 商品价格
|
|
@@ -1102,18 +1092,19 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -1102,18 +1092,19 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
1102
|
result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
|
1092
|
result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
|
1103
|
}
|
1093
|
}
|
1104
|
|
1094
|
|
1105
|
- // 促销活动banner,虚拟商品无促销
|
1095
|
+ // 促销活动banner,虚拟商品无促销
|
1106
|
if (propOrigin('attribute') !== 3) {
|
1096
|
if (propOrigin('attribute') !== 3) {
|
1107
|
result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData);
|
1097
|
result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData);
|
1108
|
}
|
1098
|
}
|
1109
|
|
1099
|
|
1110
|
- const C_VALUE = {
|
|
|
1111
|
- type: '返有货币',
|
|
|
1112
|
- des: '每件返 ',
|
|
|
1113
|
- rest: '个 有货币'
|
|
|
1114
|
- };
|
|
|
1115
|
-
|
1100
|
+ // 有货币
|
1116
|
if (propOrigin('yohoCoinNum', '0') !== '0') {
|
1101
|
if (propOrigin('yohoCoinNum', '0') !== '0') {
|
|
|
1102
|
+ const C_VALUE = {
|
|
|
1103
|
+ type: '返有货币',
|
|
|
1104
|
+ des: '每件返 ',
|
|
|
1105
|
+ rest: '个 有货币'
|
|
|
1106
|
+ };
|
|
|
1107
|
+
|
1117
|
result.activity.push({
|
1108
|
result.activity.push({
|
1118
|
type: C_VALUE.type,
|
1109
|
type: C_VALUE.type,
|
1119
|
des: `${C_VALUE.des}${propOrigin('yohoCoinNum')}${C_VALUE.rest}`
|
1110
|
des: `${C_VALUE.des}${propOrigin('yohoCoinNum')}${C_VALUE.rest}`
|
|
@@ -1128,20 +1119,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -1128,20 +1119,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
1128
|
result.hasOtherPrice = false;
|
1119
|
result.hasOtherPrice = false;
|
1129
|
}
|
1120
|
}
|
1130
|
|
1121
|
|
1131
|
- // 商品咨询和评论数据,当前为空
|
|
|
1132
|
- let consultComment = _getConsultCommentDataByProductInfo();
|
|
|
1133
|
-
|
|
|
1134
|
- // 品牌信息
|
|
|
1135
|
- let banner = {};
|
|
|
1136
|
-
|
|
|
1137
|
- if (propOrigin('brand_info', '')) {
|
|
|
1138
|
- result.brandImg = helpers.image(propOrigin('brand_info.brand_ico', ''), 47, 47);
|
|
|
1139
|
- result.brandName = propOrigin('brand_info.brand_name', '');
|
|
|
1140
|
- result.brandUrl = helpers.urlFormat('', null, propOrigin('brand_info.brand_domain'));
|
|
|
1141
|
- banner = _getBrandDataByProductBaseInfo(origin, additionalData);
|
|
|
1142
|
- banner.isCollect = favoriteData.brand;
|
|
|
1143
|
- }
|
|
|
1144
|
-
|
|
|
1145
|
// sku商品信息
|
1122
|
// sku商品信息
|
1146
|
let skuData = _getSkuDataByProductBaseInfo(origin);
|
1123
|
let skuData = _getSkuDataByProductBaseInfo(origin);
|
1147
|
|
1124
|
|
|
@@ -1249,7 +1226,16 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -1249,7 +1226,16 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
1249
|
statGoodsInfo.marketPrice = result.marketPrice;
|
1226
|
statGoodsInfo.marketPrice = result.marketPrice;
|
1250
|
statGoodsInfo.salePrice = result.salePrice ? result.salePrice : result.marketPrice;
|
1227
|
statGoodsInfo.salePrice = result.salePrice ? result.salePrice : result.marketPrice;
|
1251
|
|
1228
|
|
1252
|
- if (banner.brandId) {
|
1229
|
+ // 品牌信息
|
|
|
1230
|
+ let banner = {};
|
|
|
1231
|
+
|
|
|
1232
|
+ if (propOrigin('brand_info', '')) {
|
|
|
1233
|
+ result.brandImg = helpers.image(propOrigin('brand_info.brand_ico', ''), 47, 47);
|
|
|
1234
|
+ result.brandName = propOrigin('brand_info.brand_name', '');
|
|
|
1235
|
+ result.brandUrl = helpers.urlFormat('', null, propOrigin('brand_info.brand_domain'));
|
|
|
1236
|
+ banner = _getBrandDataByProductBaseInfo(origin, additionalData);
|
|
|
1237
|
+ banner.isCollect = favoriteData.brand;
|
|
|
1238
|
+
|
1253
|
let domainBrand = yield brandService.getBrandByDomainAsync(banner.brandDomain);
|
1239
|
let domainBrand = yield brandService.getBrandByDomainAsync(banner.brandDomain);
|
1254
|
|
1240
|
|
1255
|
if (domainBrand.type && domainBrand.shopId) {
|
1241
|
if (domainBrand.type && domainBrand.shopId) {
|
|
@@ -1267,6 +1253,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -1267,6 +1253,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
1267
|
}
|
1253
|
}
|
1268
|
}
|
1254
|
}
|
1269
|
|
1255
|
|
|
|
1256
|
+ // 统计信息
|
1270
|
statGoodsInfo.imageUrl = result.img;
|
1257
|
statGoodsInfo.imageUrl = result.img;
|
1271
|
statGoodsInfo.productUrl = helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');
|
1258
|
statGoodsInfo.productUrl = helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');
|
1272
|
statGoodsInfo.smallSortId = result.smallSortId;
|
1259
|
statGoodsInfo.smallSortId = result.smallSortId;
|
|
@@ -1277,7 +1264,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -1277,7 +1264,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
1277
|
|
1264
|
|
1278
|
return Object.assign({
|
1265
|
return Object.assign({
|
1279
|
goodsInfo: result,
|
1266
|
goodsInfo: result,
|
1280
|
- consultComment: consultComment,
|
1267
|
+ consultComment: true,
|
1281
|
banner: _.isEmpty(banner) ? null : banner,
|
1268
|
banner: _.isEmpty(banner) ? null : banner,
|
1282
|
statGoodsInfo: statGoodsInfo
|
1269
|
statGoodsInfo: statGoodsInfo
|
1283
|
}, sizeInfo);
|
1270
|
}, sizeInfo);
|
|
@@ -1339,7 +1326,6 @@ const showMainAsync = (data) => { |
|
@@ -1339,7 +1326,6 @@ const showMainAsync = (data) => { |
1339
|
data.saveInCookies(data.gid, _.get(productInfo, 'goodsInfo.skn', ''));
|
1326
|
data.saveInCookies(data.gid, _.get(productInfo, 'goodsInfo.skn', ''));
|
1340
|
}
|
1327
|
}
|
1341
|
|
1328
|
|
1342
|
-
|
|
|
1343
|
result.headerData = requestData[1].headerData;
|
1329
|
result.headerData = requestData[1].headerData;
|
1344
|
result.productDetailPage = true;
|
1330
|
result.productDetailPage = true;
|
1345
|
result.detail = productInfo;
|
1331
|
result.detail = productInfo;
|