Browse Source

Merge remote-tracking branch 'origin/release-201844-wangcz' into release-201844-wangcz

shenjunjie 7 years ago
parent
commit
7547c9372d

+ 8 - 7
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -700,12 +700,14 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
               if (isDisabled) {
                   return;
               }
-              // if (seek.id != $scope.currentSeek.id) {
-              //     $scope.isInit = true;
+              $scope.selectAmount = 0;
+              $scope.selectPrice = 0;
+              if (seek.id != $scope.currentSeek.id) {
+                  $scope.isInit = true;
                   $scope.goodsCount = 0;
                   $scope.offerCount = 0;
                   $scope.replaceOfferCount = 0;
-              // }
+              }
             $scope.currentSeek = seek;
               if (!seek.$status || seek.$status != 1) {
                   seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {
@@ -722,7 +724,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
                     } else {
                         $scope.offer = seek.qutations;
                         clearSeekStatus();
-                        if (seek.qutations && seek.qutations.length) {
+                        if (seek.qutations && seek.qutations.length && $scope.isInit) {
                             for (var i = 0; i < seek.qutations.length; i++) {
                                 if (seek.qutations[i].isReplace == 1) {
                                     $scope.replaceOfferCount++;
@@ -731,7 +733,8 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
                                 }
                             }
                         }
-                        seek.$status = $scope.offerCount == 0 ? 3 : 2;
+                        seek.$status = $scope.offerCount == 0 ? 3 : ($scope.isInit ? 2 : status);
+                        $scope.isInit = false;
                     }
                 });
             } else if (status == 1 && $scope.goodsCount != 0) {// 查看现货
@@ -741,8 +744,6 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
             } else if (status == 0) { // 收起
               seek.$status = status;
             }
-            $scope.selectAmount = 0;
-            $scope.selectPrice = 0;
           };
 
           $scope.condition = {