lrf 2 éve
szülő
commit
6bba3a6b7b
1 módosított fájl, 11 hozzáadás és 2 törlés
  1. 11 2
      pages/market/index.vue

+ 11 - 2
pages/market/index.vue

@@ -3,7 +3,9 @@
     <view class="main">
       <view class="top" v-if="list.length !=0">
         <view class="text_1">
-          <checkbox class="checkbox" @click="selectAll(false)" :checked="isAll">全选</checkbox>
+          <uni-popup ref="popup" :mask-click="true" background-color="#f1f1f1">
+            <checkbox class="checkbox" @click="selectAll(false)" :checked="isAll">全选</checkbox>
+          </uni-popup>
         </view>
         <view class="text_2" v-if="num==0" @click="edit(1)">编辑</view>
         <view class="text_2" v-if="num==1" @click="edit(0)">完成</view>
@@ -295,12 +297,19 @@ export default {
           if (result.errcode === 0) {
             list = list.map(i => ({ ...i, goods: i.goods.filter(f => f.cart_id !== e.cart_id) }))
             this.$set(this, `list`, list);
+            // 检查店铺内是否还有商品
+            this.checkShopGoodsExist();
             // 计算总额
             this.countMoney();
           }
         }
       });
-
+    },
+    //检查店铺内是否还有商品
+    checkShopGoodsExist() {
+      let list = this.list;
+      list = list.filter(f => f.goods && f.goods.length > 0)
+      this.$set(this, `list`, list);
     },
     // 计算总额
     countMoney() {