wuheng 1 year ago
parent
commit
9b690f82e6
2 changed files with 5 additions and 3 deletions
  1. 4 3
      src/views/ShopCart.vue
  2. 1 0
      src/views/SubmitOrderInfo.vue

+ 4 - 3
src/views/ShopCart.vue

@@ -42,7 +42,7 @@
         </div>
         </div>
         <van-empty v-if="shopCartInfo <= 0" />
         <van-empty v-if="shopCartInfo <= 0" />
         <div style="height: 7rem;"></div>
         <div style="height: 7rem;"></div>
-        <van-submit-bar :price="totalMoney" button-text="提交订单" @submit="onSubmit">
+        <van-submit-bar :price="totalMoney" :disabled="basketIds.length <= 0" button-text="提交订单" @submit="onSubmit">
             <van-checkbox v-model="checked" @click="allProdSelected">全选</van-checkbox>
             <van-checkbox v-model="checked" @click="allProdSelected">全选</van-checkbox>
             <a class="clear-cart" v-show="basketIds.length > 0" @click="clearCart">清空</a>
             <a class="clear-cart" v-show="basketIds.length > 0" @click="clearCart">清空</a>
         </van-submit-bar>
         </van-submit-bar>
@@ -104,8 +104,9 @@ export default {
             //         }
             //         }
             //     }
             //     }
             // }
             // }
-            for (let n = 0; n < this.basketIds; n++) {
+            for (let n = 0; n < this.basketIds.length; n++) {
                 const cart = this.shopCartInfo[0].shopCartItemDiscounts[0].shopCartItems
                 const cart = this.shopCartInfo[0].shopCartItemDiscounts[0].shopCartItems
+                
                 for (let j = 0; j < cart.length; j++) {
                 for (let j = 0; j < cart.length; j++) {
                     if ( this.basketIds[n] !== cart[j].basketId ) {
                     if ( this.basketIds[n] !== cart[j].basketId ) {
                         break;
                         break;
@@ -123,7 +124,7 @@ export default {
             }
             }
             if ( this.basketIds.length <= 0 ) return ;
             if ( this.basketIds.length <= 0 ) return ;
             sessionStorage.setItem("confirm", JSON.stringify(this.confirm))
             sessionStorage.setItem("confirm", JSON.stringify(this.confirm))
-            this.$router.push("/submitinfo")
+            //this.$router.push("/submitinfo")
         },
         },
         async init() {
         async init() {
             shopCartInfo({}).then(
             shopCartInfo({}).then(

+ 1 - 0
src/views/SubmitOrderInfo.vue

@@ -45,6 +45,7 @@
                 </van-cell>
                 </van-cell>
             </van-cell-group>
             </van-cell-group>
         </div>
         </div>
+        <div style="height: 3rem;"></div>
         <van-submit-bar :price="shopCartInfo.actualTotal * 100" button-text="提交订单" @submit="onSubmit" />
         <van-submit-bar :price="shopCartInfo.actualTotal * 100" button-text="提交订单" @submit="onSubmit" />
     </div>
     </div>
 </template>
 </template>