Authored by htoooth

refactor

@@ -38,18 +38,22 @@ const getProductAdditionInfoByProductBaseInfoAsync = (data) => { @@ -38,18 +38,22 @@ const getProductAdditionInfoByProductBaseInfoAsync = (data) => {
38 let uid = data.uid ? data.uid : 0; 38 let uid = data.uid ? data.uid : 0;
39 let skn = data.erpProductId; 39 let skn = data.erpProductId;
40 let brandId = data.brand.id ? data.brand.id : 0; 40 let brandId = data.brand.id ? data.brand.id : 0;
41 - let isOnlyUrl = true;  
42 41
43 - // 获取相关url  
44 -  
45 - let result = yield Promise.all([ 42 + // 获取相关数据
  43 + let promiseData = [
46 productAPI.getProductBannerAsync(productId, 'web'), 44 productAPI.getProductBannerAsync(productId, 'web'),
47 productAPI.sizeInfoAsync(skn), 45 productAPI.sizeInfoAsync(skn),
48 productAPI.getProductComfortAsync(productId), 46 productAPI.getProductComfortAsync(productId),
49 productAPI.getProductModelCardAsync(productId), 47 productAPI.getProductModelCardAsync(productId),
50 productAPI.getProductModelTryAsync(skn), 48 productAPI.getProductModelTryAsync(skn),
51 brandService.getBannerInfoAsync(brandId) 49 brandService.getBannerInfoAsync(brandId)
52 - ]); 50 + ];
  51 +
  52 + if (uid) {
  53 + promiseData.push(favoriteBrandService.isFavoriteAsync(uid, productId));
  54 + }
  55 +
  56 + let result = yield Promise.all(promiseData);
53 57
54 cachedRequestData['ItemData::getProductBanner'] = result[0]; 58 cachedRequestData['ItemData::getProductBanner'] = result[0];
55 cachedRequestData['ItemData::sizeInfo'] = result[1]; 59 cachedRequestData['ItemData::sizeInfo'] = result[1];
@@ -57,11 +61,7 @@ const getProductAdditionInfoByProductBaseInfoAsync = (data) => { @@ -57,11 +61,7 @@ const getProductAdditionInfoByProductBaseInfoAsync = (data) => {
57 cachedRequestData['ItemData::getProductModelCard'] = result[3]; 61 cachedRequestData['ItemData::getProductModelCard'] = result[3];
58 cachedRequestData['ItemData::getProductModelTry'] = result[4]; 62 cachedRequestData['ItemData::getProductModelTry'] = result[4];
59 cachedRequestData['BrandData::getBannerInfo'] = result[5]; 63 cachedRequestData['BrandData::getBannerInfo'] = result[5];
60 -  
61 - if (uid) {  
62 - cachedRequestData['FavoriteData::getUidProductFav'] =  
63 - yield favoriteProductService.isFavoriteAsync(uid, productId, isOnlyUrl);  
64 - } 64 + cachedRequestData['FavoriteData::getUidProductFav'] = result[6];
65 65
66 return null; 66 return null;
67 })(); 67 })();
@@ -1252,7 +1252,6 @@ function getSizeAttrByMaxSortId(maxSortId, sizeList) { @@ -1252,7 +1252,6 @@ function getSizeAttrByMaxSortId(maxSortId, sizeList) {
1252 * @return array 1252 * @return array
1253 */ 1253 */
1254 const getSizeInfo = (productSkn, maxSortId)=> { 1254 const getSizeInfo = (productSkn, maxSortId)=> {
1255 -  
1256 let result = {}; 1255 let result = {};
1257 1256
1258 if (productSkn) { 1257 if (productSkn) {