|
@@ -10,10 +10,9 @@ const library = '../../../library'; |
|
@@ -10,10 +10,9 @@ const library = '../../../library'; |
10
|
const API = require(`${library}/api`).API;
|
10
|
const API = require(`${library}/api`).API;
|
11
|
const sign = require(`${library}/sign`);
|
11
|
const sign = require(`${library}/sign`);
|
12
|
const _ = require('lodash');
|
12
|
const _ = require('lodash');
|
13
|
-const HELPERS = require(`${library}/helpers`);
|
13
|
+const helpers = require(`${library}/helpers`);
|
14
|
|
14
|
|
15
|
var api = new API();
|
15
|
var api = new API();
|
16
|
-var helpers = new HELPERS();
|
|
|
17
|
|
16
|
|
18
|
/**
|
17
|
/**
|
19
|
* 处理品牌关联店铺信息
|
18
|
* 处理品牌关联店铺信息
|
|
@@ -25,10 +24,10 @@ const getShopsInfo = (data) => { |
|
@@ -25,10 +24,10 @@ const getShopsInfo = (data) => { |
25
|
|
24
|
|
26
|
_.forEach(data, function(value, key) {
|
25
|
_.forEach(data, function(value, key) {
|
27
|
enterStore[key] = {};
|
26
|
enterStore[key] = {};
|
28
|
- enterStore[key].img = helpers.getImageUrl(value.brand_ico, 47, 47);
|
27
|
+ enterStore[key].img = value.brand_ico;
|
29
|
enterStore[key].storeName = value.brand_name;
|
28
|
enterStore[key].storeName = value.brand_name;
|
30
|
|
29
|
|
31
|
- if (value.shop_id !== null && value.shop_id !== undefined) {
|
30
|
+ if (value.shop_id !== null && typeof value.shop_id !== 'undefined') {
|
32
|
let params = {};
|
31
|
let params = {};
|
33
|
|
32
|
|
34
|
params.shop_id = value.shop_id;
|
33
|
params.shop_id = value.shop_id;
|
|
@@ -127,14 +126,14 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -127,14 +126,14 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
127
|
totalStorageNum = 0;
|
126
|
totalStorageNum = 0;
|
128
|
|
127
|
|
129
|
// 商品名称
|
128
|
// 商品名称
|
130
|
- if (origin.productName === null || origin.productName === undefined) {
|
129
|
+ if (origin.productName === null || typeof origin.productName === 'undefined') {
|
131
|
return dest;
|
130
|
return dest;
|
132
|
}
|
131
|
}
|
133
|
|
132
|
|
134
|
dest.goodsName = origin.productName;
|
133
|
dest.goodsName = origin.productName;
|
135
|
|
134
|
|
136
|
// 用户未登录时 待处理
|
135
|
// 用户未登录时 待处理
|
137
|
- if (uid === null || uid === undefined) {
|
136
|
+ if (uid === null || typeof uid === 'undefined') {
|
138
|
let params = {};
|
137
|
let params = {};
|
139
|
|
138
|
|
140
|
params.refer = helpers.url('/product/show_' + origin.erpProductId + '.html');
|
139
|
params.refer = helpers.url('/product/show_' + origin.erpProductId + '.html');
|
|
@@ -142,12 +141,12 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -142,12 +141,12 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
142
|
}
|
141
|
}
|
143
|
|
142
|
|
144
|
// 商品促销短语
|
143
|
// 商品促销短语
|
145
|
- if (origin.salesPhrase !== null && origin.salesPhrase !== undefined) {
|
144
|
+ if (origin.salesPhrase !== null && typeof origin.salesPhrase !== 'undefined') {
|
146
|
dest.goodsSubtitle = origin.salesPhrase;
|
145
|
dest.goodsSubtitle = origin.salesPhrase;
|
147
|
}
|
146
|
}
|
148
|
|
147
|
|
149
|
// 商品标签
|
148
|
// 商品标签
|
150
|
- if (origin.productTagBoList !== null && origin.productTagBoList !== undefined) {
|
149
|
+ if (origin.productTagBoList !== null && typeof origin.productTagBoList !== 'undefined') {
|
151
|
_.forEach(origin.productTagBoList, function(value) {
|
150
|
_.forEach(origin.productTagBoList, function(value) {
|
152
|
switch (value.tagLabel) {
|
151
|
switch (value.tagLabel) {
|
153
|
case 'is_soon_sold_out':
|
152
|
case 'is_soon_sold_out':
|
|
@@ -177,7 +176,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -177,7 +176,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
177
|
// 商品价格
|
176
|
// 商品价格
|
178
|
dest.goodsPrice = {};
|
177
|
dest.goodsPrice = {};
|
179
|
|
178
|
|
180
|
- if (origin.productPriceBo !== null && origin.productPriceBo !== undefined) {
|
179
|
+ if (origin.productPriceBo !== null && typeof origin.productPriceBo !== 'undefined') {
|
181
|
dest.goodsPrice.currentPrice = origin.productPriceBo.formatSalesPrice;
|
180
|
dest.goodsPrice.currentPrice = origin.productPriceBo.formatSalesPrice;
|
182
|
if (origin.productPriceBo.formatMarketPrice !== origin.productPriceBo.formatSalesPrice) {
|
181
|
if (origin.productPriceBo.formatMarketPrice !== origin.productPriceBo.formatSalesPrice) {
|
183
|
dest.goodsPrice.previousPrice = origin.productPriceBo.formatMarketPrice;
|
182
|
dest.goodsPrice.previousPrice = origin.productPriceBo.formatMarketPrice;
|
|
@@ -193,7 +192,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -193,7 +192,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
193
|
dest.vipLevel = {};
|
192
|
dest.vipLevel = {};
|
194
|
dest.vipLevel.list = {};
|
193
|
dest.vipLevel.list = {};
|
195
|
|
194
|
|
196
|
- if (origin.productPriceBo.vipPrices !== null && origin.productPriceBo.vipPrices !== undefined) {
|
195
|
+ if (origin.productPriceBo.vipPrices !== null && typeof origin.productPriceBo.vipPrices !== 'undefined') {
|
197
|
_.forEach(origin.productPriceBo.vipPrices, function(value, key) {
|
196
|
_.forEach(origin.productPriceBo.vipPrices, function(value, key) {
|
198
|
dest.vipLevel.list[key] = {};
|
197
|
dest.vipLevel.list[key] = {};
|
199
|
dest.vipLevel.list[key].level = value.vipLevel;
|
198
|
dest.vipLevel.list[key].level = value.vipLevel;
|
|
@@ -203,7 +202,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -203,7 +202,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
203
|
}
|
202
|
}
|
204
|
|
203
|
|
205
|
// 上市期
|
204
|
// 上市期
|
206
|
- if (origin.expectArrivalTime !== null && origin.expectArrivalTime !== undefined) {
|
205
|
+ if (origin.expectArrivalTime !== null && typeof origin.expectArrivalTime !== 'undefined') {
|
207
|
dest.periodOfMarket = origin.expectArrivalTime + '月';
|
206
|
dest.periodOfMarket = origin.expectArrivalTime + '月';
|
208
|
}
|
207
|
}
|
209
|
|
208
|
|
|
@@ -211,7 +210,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -211,7 +210,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
211
|
dest.goodsDiscount = {};
|
210
|
dest.goodsDiscount = {};
|
212
|
dest.goodsDiscount.list = {};
|
211
|
dest.goodsDiscount.list = {};
|
213
|
|
212
|
|
214
|
- if (origin.promotionBoList !== null && origin.promotionBoList !== undefined) {
|
213
|
+ if (origin.promotionBoList !== null && typeof origin.promotionBoList !== 'undefined') {
|
215
|
_.forEach(origin.promotionBoList, function(value, key) {
|
214
|
_.forEach(origin.promotionBoList, function(value, key) {
|
216
|
dest.goodsDiscount.list[key] = {};
|
215
|
dest.goodsDiscount.list[key] = {};
|
217
|
dest.goodsDiscount.list[key].text = '【' + value.promotionType + '】' +
|
216
|
dest.goodsDiscount.list[key].text = '【' + value.promotionType + '】' +
|
|
@@ -224,7 +223,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -224,7 +223,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
224
|
dest.feedbacks.consults = {};
|
223
|
dest.feedbacks.consults = {};
|
225
|
dest.feedbacks.consultsNum = 0;
|
224
|
dest.feedbacks.consultsNum = 0;
|
226
|
|
225
|
|
227
|
- if (origin.consultBoWrapper !== null && origin.consultBoWrapper !== undefined) {
|
226
|
+ if (origin.consultBoWrapper !== null && typeof origin.consultBoWrapper !== 'undefined') {
|
228
|
dest.feedbacks.consultsNum = origin.consultBoWrapper.consultTotal;
|
227
|
dest.feedbacks.consultsNum = origin.consultBoWrapper.consultTotal;
|
229
|
_.forEach(origin.consultBoWrapper.consultBoList, function(value, key) {
|
228
|
_.forEach(origin.consultBoWrapper.consultBoList, function(value, key) {
|
230
|
dest.feedbacks.consults[key] = {};
|
229
|
dest.feedbacks.consults[key] = {};
|
|
@@ -251,7 +250,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -251,7 +250,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
251
|
|
250
|
|
252
|
// 商品评价
|
251
|
// 商品评价
|
253
|
dest.feedbacks.commentsNum = 0;
|
252
|
dest.feedbacks.commentsNum = 0;
|
254
|
- if (origin.commentBoWrapper !== null && origin.commentBoWrapper !== undefined) {
|
253
|
+ if (origin.commentBoWrapper !== null && typeof origin.commentBoWrapper !== 'undefined') {
|
255
|
dest.feedbacks.commentsNum = origin.commentBoWrapper.commentTotal;
|
254
|
dest.feedbacks.commentsNum = origin.commentBoWrapper.commentTotal;
|
256
|
dest.feedbacks.comments = {};
|
255
|
dest.feedbacks.comments = {};
|
257
|
|
256
|
|
|
@@ -261,7 +260,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -261,7 +260,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
261
|
dest.feedbacks.comments[key].desc = value.colorName +
|
260
|
dest.feedbacks.comments[key].desc = value.colorName +
|
262
|
'/' + value.sizeName;
|
261
|
'/' + value.sizeName;
|
263
|
dest.feedbacks.comments[key].content = (value.content !== null &&
|
262
|
dest.feedbacks.comments[key].content = (value.content !== null &&
|
264
|
- value.content !== undefined) ? value.content : '';
|
263
|
+ typeof value.content !== 'undefined') ? value.content : '';
|
265
|
dest.feedbacks.comments[key].time = value.createTime;
|
264
|
dest.feedbacks.comments[key].time = value.createTime;
|
266
|
});
|
265
|
});
|
267
|
|
266
|
|
|
@@ -274,13 +273,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -274,13 +273,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
274
|
}
|
273
|
}
|
275
|
|
274
|
|
276
|
// 品牌信息
|
275
|
// 品牌信息
|
277
|
- if (origin.brand !== null && origin.brand !== undefined) {
|
|
|
278
|
-
|
|
|
279
|
- // dest.enterStore[0] = {};
|
|
|
280
|
- // dest.enterStore[0].img =
|
|
|
281
|
- // helpers.getImageUrl(origin.brand.brandIco, 47, 47);
|
|
|
282
|
- // dest.enterStore[0].storeName = origin.brand.brandName;
|
|
|
283
|
- // dest.enterStore[0].url = helpers.url('', null, origin.brand.brandDomain);
|
276
|
+ if (origin.brand !== null && typeof origin.brand !== 'undefined') {
|
284
|
|
277
|
|
285
|
// 为你优选的链接
|
278
|
// 为你优选的链接
|
286
|
let params = {};
|
279
|
let params = {};
|
|
@@ -293,7 +286,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -293,7 +286,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
293
|
dest.productSkn = origin.erpProductId;
|
286
|
dest.productSkn = origin.erpProductId;
|
294
|
|
287
|
|
295
|
// 商品信息
|
288
|
// 商品信息
|
296
|
- if (origin.goodsList !== null && origin.goodsList !== undefined) {
|
289
|
+ if (origin.goodsList !== null && typeof origin.goodsList !== 'undefined') {
|
297
|
let goodsGroup = {},
|
290
|
let goodsGroup = {},
|
298
|
sizeName = '',
|
291
|
sizeName = '',
|
299
|
colorList = {},
|
292
|
colorList = {},
|
|
@@ -310,7 +303,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -310,7 +303,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
310
|
colorStorageNum = 0;
|
303
|
colorStorageNum = 0;
|
311
|
|
304
|
|
312
|
// 商品分组
|
305
|
// 商品分组
|
313
|
- if (value.goodsImagesList !== null && value.goodsImagesList !== undefined) {
|
306
|
+ if (value.goodsImagesList !== null && typeof value.goodsImagesList !== 'undefined') {
|
314
|
_.forEach(value.goodsImagesList, function(good, keyForGood) {
|
307
|
_.forEach(value.goodsImagesList, function(good, keyForGood) {
|
315
|
goodsGroup[keyForGood] = {};
|
308
|
goodsGroup[keyForGood] = {};
|
316
|
goodsGroup[keyForGood].goodsId = good.goodsId;
|
309
|
goodsGroup[keyForGood].goodsId = good.goodsId;
|
|
@@ -320,7 +313,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -320,7 +313,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
320
|
|
313
|
|
321
|
// 商品的尺码列表
|
314
|
// 商品的尺码列表
|
322
|
colorStorageGroup[value.productSkc] = {};
|
315
|
colorStorageGroup[value.productSkc] = {};
|
323
|
- if (value.goodsSizeBoList !== null && value.goodsSizeBoList !== undefined) {
|
316
|
+ if (value.goodsSizeBoList !== null && typeof value.goodsSizeBoList !== 'undefined') {
|
324
|
|
317
|
|
325
|
_.forEach(value.goodsSizeBoList, function(size, keyForSize) {
|
318
|
_.forEach(value.goodsSizeBoList, function(size, keyForSize) {
|
326
|
sizeList[value.productSkc] = {};
|
319
|
sizeList[value.productSkc] = {};
|
|
@@ -341,11 +334,11 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -341,11 +334,11 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
341
|
build.storage = size.goodsSizeStorageNum;
|
334
|
build.storage = size.goodsSizeStorageNum;
|
342
|
build.id = size.id;
|
335
|
build.id = size.id;
|
343
|
allSizeList[sizeName] = (allSizeList[sizeName] === null ||
|
336
|
allSizeList[sizeName] = (allSizeList[sizeName] === null ||
|
344
|
- allSizeList[sizeName] === undefined) ? build :
|
337
|
+ typeof allSizeList[sizeName] === 'undefined') ? build :
|
345
|
allSizeList[sizeName];
|
338
|
allSizeList[sizeName];
|
346
|
|
339
|
|
347
|
- colorStorageNum += parseInt(size.goodsSizeStorageNum);
|
|
|
348
|
- colorStorageGroup[value.productSkc][sizeName] = parseInt(size.goodsSizeStorageNum);
|
340
|
+ colorStorageNum += parseInt(size.goodsSizeStorageNum, 10);
|
|
|
341
|
+ colorStorageGroup[value.productSkc][sizeName] = parseInt(size.goodsSizeStorageNum, 10);
|
349
|
});
|
342
|
});
|
350
|
|
343
|
|
351
|
// 颜色分组
|
344
|
// 颜色分组
|
|
@@ -360,7 +353,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -360,7 +353,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
360
|
// 缩略图
|
353
|
// 缩略图
|
361
|
let params = {};
|
354
|
let params = {};
|
362
|
|
355
|
|
363
|
- params.img = helpers.getImageUrl(value.colorImage, 60, 60);
|
356
|
+ params.img = value.colorImage;
|
364
|
thumbImageList[key] = params;
|
357
|
thumbImageList[key] = params;
|
365
|
|
358
|
|
366
|
// 商品库存总数
|
359
|
// 商品库存总数
|
|
@@ -378,7 +371,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -378,7 +371,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
378
|
sizeGroup[0].size = {};
|
371
|
sizeGroup[0].size = {};
|
379
|
sizeGroup[0].size[key] = {};
|
372
|
sizeGroup[0].size[key] = {};
|
380
|
sizeGroup[0].size[key].name = sizeName;
|
373
|
sizeGroup[0].size[key].name = sizeName;
|
381
|
- sizeGroup[0].size[key].sizeNum = (value.storage === undefined || value.storage === null) ? false : true;
|
374
|
+ sizeGroup[0].size[key].sizeNum = (typeof value.storage === 'undefined' ||
|
|
|
375
|
+ value.storage === null) ? false : true;
|
382
|
sizeGroup[0].size[key].id = value.id;
|
376
|
sizeGroup[0].size[key].id = value.id;
|
383
|
|
377
|
|
384
|
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
|
378
|
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
|
|
@@ -388,7 +382,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -388,7 +382,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
388
|
colorGroup[i].color[keyForColorArr] = {};
|
382
|
colorGroup[i].color[keyForColorArr] = {};
|
389
|
colorGroup[i].color[keyForColorArr].colorNum =
|
383
|
colorGroup[i].color[keyForColorArr].colorNum =
|
390
|
(colorStorageGroup[colorArr.skcId][sizeName] !== null &&
|
384
|
(colorStorageGroup[colorArr.skcId][sizeName] !== null &&
|
391
|
- colorStorageGroup[colorArr.skcId][sizeName] !== undefined) ?
|
385
|
+ typeof colorStorageGroup[colorArr.skcId][sizeName] !== 'undefined') ?
|
392
|
colorStorageGroup[colorArr.skcId][sizeName] : 0;
|
386
|
colorStorageGroup[colorArr.skcId][sizeName] : 0;
|
393
|
});
|
387
|
});
|
394
|
colorGroup[i].id = value.id;
|
388
|
colorGroup[i].id = value.id;
|
|
@@ -414,19 +408,19 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -414,19 +408,19 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
414
|
});
|
408
|
});
|
415
|
|
409
|
|
416
|
// 商品图:多个
|
410
|
// 商品图:多个
|
417
|
- if (goodsGroup[1] !== null && goodsGroup[1] !== undefined) {
|
411
|
+ if (goodsGroup[1] !== null && typeof goodsGroup[1] !== 'undefined') {
|
418
|
_.forEach(goodsGroup, function(value, key) {
|
412
|
_.forEach(goodsGroup, function(value, key) {
|
419
|
dest.bannerTop = {};
|
413
|
dest.bannerTop = {};
|
420
|
|
414
|
|
421
|
dest.bannerTop.list = {};
|
415
|
dest.bannerTop.list = {};
|
422
|
let params = {};
|
416
|
let params = {};
|
423
|
|
417
|
|
424
|
- params.img = helpers.getImageUrl(value.img, 450, 600);
|
418
|
+ params.img = value.img;
|
425
|
dest.bannerTop.list[key] = params;
|
419
|
dest.bannerTop.list[key] = params;
|
426
|
});
|
420
|
});
|
427
|
- } else if (goodsGroup[0] !== null && goodsGroup[0] !== undefined) {
|
421
|
+ } else if (goodsGroup[0] !== null && typeof goodsGroup[0] !== 'undefined') {
|
428
|
dest.bannerTop = {};
|
422
|
dest.bannerTop = {};
|
429
|
- dest.bannerTop.img = helpers.getImageUrl(goodsGroup[0].img, 450, 600);
|
423
|
+ dest.bannerTop.img = goodsGroup[0].img;
|
430
|
}
|
424
|
}
|
431
|
}
|
425
|
}
|
432
|
|
426
|
|
|
@@ -446,11 +440,11 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -446,11 +440,11 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
446
|
dest.cartInfo = {};
|
440
|
dest.cartInfo = {};
|
447
|
dest.cartInfo.productId = origin.id;
|
441
|
dest.cartInfo.productId = origin.id;
|
448
|
dest.cartInfo.thumbs = thumbImageList;
|
442
|
dest.cartInfo.thumbs = thumbImageList;
|
449
|
- dest.cartInfo.name = (dest.goodsName !== null && dest.goodsName !== undefined) ? dest.goodsName : '';
|
443
|
+ dest.cartInfo.name = (dest.goodsName !== null && typeof dest.goodsName !== 'undefined') ? dest.goodsName : '';
|
450
|
dest.cartInfo.price = (dest.goodsPrice.previousPrice !== null &&
|
444
|
dest.cartInfo.price = (dest.goodsPrice.previousPrice !== null &&
|
451
|
- dest.goodsPrice.previousPrice !== undefined) ? dest.goodsPrice.previousPrice : '';
|
445
|
+ typeof dest.goodsPrice.previousPrice !== 'undefined') ? dest.goodsPrice.previousPrice : '';
|
452
|
dest.cartInfo.salePrice = (dest.goodsPrice.currentPrice !== null &&
|
446
|
dest.cartInfo.salePrice = (dest.goodsPrice.currentPrice !== null &&
|
453
|
- dest.goodsPrice.currentPrice !== undefined) ? dest.goodsPrice.currentPrice : '';
|
447
|
+ typeof dest.goodsPrice.currentPrice !== 'undefined') ? dest.goodsPrice.currentPrice : '';
|
454
|
dest.cartInfo.totalNum = totalStorageNum;
|
448
|
dest.cartInfo.totalNum = totalStorageNum;
|
455
|
dest.cartInfo.colors = colorGroup;
|
449
|
dest.cartInfo.colors = colorGroup;
|
456
|
dest.cartInfo.sizes = sizeGroup;
|
450
|
dest.cartInfo.sizes = sizeGroup;
|
|
@@ -458,14 +452,14 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -458,14 +452,14 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
458
|
// 限购商品
|
452
|
// 限购商品
|
459
|
if (origin.isLimitBuy === 'Y') {
|
453
|
if (origin.isLimitBuy === 'Y') {
|
460
|
// 是否开售
|
454
|
// 是否开售
|
461
|
- let isBeginSale = (origin.saleStatus !== null && origin.saleStatus !== undefined &&
|
455
|
+ let isBeginSale = (origin.saleStatus !== null && typeof origin.saleStatus !== 'undefined' &&
|
462
|
origin.saleStatus === 1);
|
456
|
origin.saleStatus === 1);
|
463
|
|
457
|
|
464
|
// 限购商品有关的展示状态
|
458
|
// 限购商品有关的展示状态
|
465
|
let showStatus = 1;
|
459
|
let showStatus = 1;
|
466
|
|
460
|
|
467
|
- if (origin.showStatus !== null && origin.showStatus !== undefined) {
|
|
|
468
|
- showStatus = parseInt(origin.showStatus);
|
461
|
+ if (origin.showStatus !== null && typeof origin.showStatus !== 'undefined') {
|
|
|
462
|
+ showStatus = parseInt(origin.showStatus, 10);
|
469
|
}
|
463
|
}
|
470
|
|
464
|
|
471
|
// 处理限购商品有关的按钮状态
|
465
|
// 处理限购商品有关的按钮状态
|
|
@@ -486,7 +480,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
@@ -486,7 +480,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { |
486
|
// 是否收藏
|
480
|
// 是否收藏
|
487
|
|
481
|
|
488
|
dest.isCollect = false;
|
482
|
dest.isCollect = false;
|
489
|
- if (origin.isCollect !== null && origin.isCollect !== undefined && origin.isCollect === 'Y') {
|
483
|
+ if (origin.isCollect !== null && typeof origin.isCollect !== 'undefined' && origin.isCollect === 'Y') {
|
490
|
dest.isCollect = true;
|
484
|
dest.isCollect = true;
|
491
|
}
|
485
|
}
|
492
|
|
486
|
|