ソースを参照

fix:修改市场价零售价为1的bug

徐志豪 5 年 前
コミット
fd30dbb94d
2 ファイル変更18 行追加1 行削除
  1. 3 0
      .gitignore
  2. 15 1
      js/shop/goods.js

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+node_moudles/
+*/node_moudles/
+node_modules

+ 15 - 1
js/shop/goods.js

@@ -533,7 +533,21 @@ var vm = new Vue({
             vm.goods['guigeArr'] = JSON.stringify(vm.guigeArr)
             
             vm.goods['ggContent'] = JSON.stringify(vm.ggContent)
-
+            // 修改市场价和零售价
+            
+            vm.goods['productList'].forEach((item, index) => {
+                if (index === 0) {
+                    vm.goods.retailPrice = item.retailPrice
+                    vm.goods.marketPrice = item.marketPrice
+                } else {
+                    if (item.retailPrice < vm.goods['productList'][index - 1].retailPrice) {
+                        vm.goods.retailPrice = item.retailPrice
+                    }
+                    if (item.marketPrice < vm.goods['productList'][index - 1].marketPrice) {
+                        vm.goods.retailPrice = item.marketPrice
+                    }
+                }
+            })
             Ajax.request({
                 type: "POST",
                 url: url,