Sfoglia il codice sorgente

修复组合商品问题

zhengjinyi 2 anni fa
parent
commit
58078d58fd

+ 6 - 2
src/main/resources/static/js/product/detail.js

@@ -625,7 +625,9 @@ var productDetail = new Vue({
                 });
             }
             // 计算价格
-            _self.calculatetTtalPrice();
+            if(this.listQuery.userId>0){
+                this.calculatetTtalPrice();
+            }
         },
         calculatetTtalPrice: function () { // 计算配套商品总价格
             var _self = this;
@@ -658,7 +660,9 @@ var productDetail = new Vue({
             }else{
                 _self.isProductChecked = false
             }
-            _self.calculatetTtalPrice();
+            if(this.listQuery.userId>0){
+                this.calculatetTtalPrice();
+            }
         },
         toBuyCoupon:function (coupon) {// 点击购买按钮事件处理
             var _self = this;

+ 13 - 6
src/main/resources/templates/product/detail.html

@@ -473,14 +473,21 @@
                                     </span>
                                 </div>
                                 <div class="tr tr-6">
-                                    <template v-if="pros.priceFlag == 1 || (pros.priceFlag==2 && GLOBAL_USER_IDENTITY === 4) || GLOBAL_USER_IDENTITY == 3">
-                                        <div class="checked-box">
-                                           <p>不可选择</p>
-                                        </div>
+                                    <template v-if="GLOBAL_USER_ID && GLOBAL_USER_ID>0">
+                                        <template v-if="pros.priceFlag == 1 || (pros.priceFlag==2 && GLOBAL_USER_IDENTITY === 4) || GLOBAL_USER_IDENTITY == 3">
+                                            <div class="checked-box">
+                                                <p>不可选择</p>
+                                            </div>
+                                        </template>
+                                        <template v-else>
+                                            <div class="checked-box" @click="checkedSoperv(pros)">
+                                                <input class="check" type="checkbox" @change="" v-model="pros.isChecked">
+                                            </div>
+                                        </template>
                                     </template>
                                     <template v-else>
-                                        <div class="checked-box" @click="checkedSoperv(pros)">
-                                            <input class="check" type="checkbox" @change="" v-model="pros.isChecked">
+                                        <div class="checked-box">
+                                            <p>不可选择</p>
                                         </div>
                                     </template>
                                 </div>