Authored by htoooth

refactor async

@@ -434,41 +434,41 @@ const getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { @@ -434,41 +434,41 @@ const getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
434 // 显示获取限购码按钮 434 // 显示获取限购码按钮
435 switch (showStatus) { 435 switch (showStatus) {
436 case 1: // 开售前/后,立即分享获得限购码(用户未领取限购码) 436 case 1: // 开售前/后,立即分享获得限购码(用户未领取限购码)
437 - {  
438 - if (isBeginSale) { 437 + {
  438 + if (isBeginSale) {
  439 + result.buyNow = true;
  440 + result.dis = true;
  441 + } else {
  442 + result.openSoon = true;
  443 + result.hasLimitedCode = false;
  444 + }
  445 + break;
  446 + }
  447 + case 2: // 开售后,限购码已抢光(用户未领取限购码)
  448 + {
439 result.buyNow = true; 449 result.buyNow = true;
440 result.dis = true; 450 result.dis = true;
441 - } else {  
442 - result.openSoon = true; 451 + result.limitedCodeSoldOut = true;
  452 + result.getLimitedCode = false;
443 result.hasLimitedCode = false; 453 result.hasLimitedCode = false;
  454 + break;
444 } 455 }
445 - break;  
446 - }  
447 - case 2: // 开售后,限购码已抢光(用户未领取限购码)  
448 - {  
449 - result.buyNow = true;  
450 - result.dis = true;  
451 - result.limitedCodeSoldOut = true;  
452 - result.getLimitedCode = false;  
453 - result.hasLimitedCode = false;  
454 - break;  
455 - }  
456 case 3: // 开售后,商品已经售罄 456 case 3: // 开售后,商品已经售罄
457 - {  
458 - result.soldOut = true;  
459 - result.getLimitedCode = false;  
460 - break;  
461 - } 457 + {
  458 + result.soldOut = true;
  459 + result.getLimitedCode = false;
  460 + break;
  461 + }
462 case 4:// 开售后,立即购买(用户已领取限购码) 462 case 4:// 开售后,立即购买(用户已领取限购码)
463 - {  
464 - result.buyNow = true;  
465 - result.dis = false;  
466 - result.hasLimitedCode = true;  
467 - if (uid) { // 限购码失效  
468 - result.getLimitedCodeDis = true; 463 + {
  464 + result.buyNow = true;
  465 + result.dis = false;
  466 + result.hasLimitedCode = true;
  467 + if (uid) { // 限购码失效
  468 + result.getLimitedCodeDis = true;
  469 + }
  470 + break;
469 } 471 }
470 - break;  
471 - }  
472 case 5: // 开售前,限购码已被抢光(用户未领取限购码) 472 case 5: // 开售前,限购码已被抢光(用户未领取限购码)
473 result.openSoon = true; 473 result.openSoon = true;
474 result.hasLimitedCode = true; 474 result.hasLimitedCode = true;
@@ -563,7 +563,7 @@ const detailDataPkg = (origin, uid, vipLevel) => { @@ -563,7 +563,7 @@ const detailDataPkg = (origin, uid, vipLevel) => {
563 563
564 let requestData = yield Promise.all([ 564 let requestData = yield Promise.all([
565 getProductAdditionInfoByProductBaseInfoAsync(origin), // 接口处理数据,设置并发请求数据 565 getProductAdditionInfoByProductBaseInfoAsync(origin), // 接口处理数据,设置并发请求数据
566 - getProductFavoriteDataAsync(uid, result.productId, brandId) //处理收藏喜欢数据 566 + getProductFavoriteDataAsync(uid, result.productId, brandId) // 处理收藏喜欢数据
567 ]); 567 ]);
568 568
569 let favoriteData = requestData[1]; 569 let favoriteData = requestData[1];
@@ -735,19 +735,19 @@ const detailDataPkg = (origin, uid, vipLevel) => { @@ -735,19 +735,19 @@ const detailDataPkg = (origin, uid, vipLevel) => {
735 if (domainBrand.type && domainBrand.shopId) { 735 if (domainBrand.type && domainBrand.shopId) {
736 switch (parseInt(domainBrand.type)) { 736 switch (parseInt(domainBrand.type)) {
737 case 1: 737 case 1:
738 - { 738 + {
739 // 多品店不显示 739 // 多品店不显示
740 - banner = [];  
741 - break;  
742 - } 740 + banner = [];
  741 + break;
  742 + }
743 case 2: 743 case 2:
744 - { 744 + {
745 // TODO:单品店显示新版的店铺banner,item.php 210 745 // TODO:单品店显示新版的店铺banner,item.php 210
746 - let basisData = shopAPI.basisTemplateAsync(domainBrand.shopId); 746 + let basisData = shopAPI.basisTemplateAsync(domainBrand.shopId);
747 747
748 - banner.bgImg = basisData.shopTopBanner.banner || banner.bgImg;  
749 - break;  
750 - } 748 + banner.bgImg = basisData.shopTopBanner.banner || banner.bgImg;
  749 + break;
  750 + }
751 751
752 } 752 }
753 } 753 }
@@ -822,15 +822,15 @@ function getDescriptionDataBySizeInfo(sizeInfo) { @@ -822,15 +822,15 @@ function getDescriptionDataBySizeInfo(sizeInfo) {
822 822
823 switch (sizeInfo.productDescBo.gender) { 823 switch (sizeInfo.productDescBo.gender) {
824 case 1: 824 case 1:
825 - {  
826 - sex = '男款';  
827 - break;  
828 - } 825 + {
  826 + sex = '男款';
  827 + break;
  828 + }
829 case 2: 829 case 2:
830 - {  
831 - sex = '女款';  
832 - break;  
833 - } 830 + {
  831 + sex = '女款';
  832 + break;
  833 + }
834 } 834 }
835 835
836 description.basic = []; 836 description.basic = [];
@@ -1191,25 +1191,25 @@ function getSizeAttrByMaxSortId(maxSortId, sizeList) { @@ -1191,25 +1191,25 @@ function getSizeAttrByMaxSortId(maxSortId, sizeList) {
1191 switch (maxSortId) { 1191 switch (maxSortId) {
1192 case 1: 1192 case 1:
1193 case 2: 1193 case 2:
1194 - {  
1195 - attributeIds = [3, 4];  
1196 - break;  
1197 - } 1194 + {
  1195 + attributeIds = [3, 4];
  1196 + break;
  1197 + }
1198 1198
1199 case 3: 1199 case 3:
1200 - {  
1201 - attributeIds = [6, 10];  
1202 - break;  
1203 - } 1200 + {
  1201 + attributeIds = [6, 10];
  1202 + break;
  1203 + }
1204 case 6: 1204 case 6:
1205 - {  
1206 - attributeIds = [13];  
1207 - break;  
1208 - } 1205 + {
  1206 + attributeIds = [13];
  1207 + break;
  1208 + }
1209 default: 1209 default:
1210 - {  
1211 - attributeIds = [];  
1212 - } 1210 + {
  1211 + attributeIds = [];
  1212 + }
1213 } 1213 }
1214 1214
1215 let sizeInfos = []; 1215 let sizeInfos = [];
@@ -1340,8 +1340,8 @@ module.exports.showMainAsync = (data) => { @@ -1340,8 +1340,8 @@ module.exports.showMainAsync = (data) => {
1340 result.productDetailPage = true; 1340 result.productDetailPage = true;
1341 result.detail = Object.assign(productInfo, sizeInfo); 1341 result.detail = Object.assign(productInfo, sizeInfo);
1342 result.statGoodsInfo = Object.assign({ 1342 result.statGoodsInfo = Object.assign({
1343 - fullSortName: navs.map(x => x.name).join('-')  
1344 - }, 1343 + fullSortName: navs.map(x => x.name).join('-')
  1344 + },
1345 productInfo.statGoodsInfo 1345 productInfo.statGoodsInfo
1346 ); 1346 );
1347 1347