yiming
2024-03-20 80232d691dd9c4989985b570ce4d745e5d2bc3f7
pages/cart/index.js
@@ -20,7 +20,9 @@
    });
    this.shoppingCartGet();
  },
  onShow() {
    this.shoppingCartGet();
  },
  onDelete(e) {
    const item = e.currentTarget.dataset.item;
    app.MG.store.delShoppingCart({
@@ -77,12 +79,9 @@
      if (eitem.id == item.id) {
        eitem.checked = e.detail.checked
      }
    })
    const data = items.filter(item => item.checked)
    const checkAll = data.length == this.data.shoppingCartData.length
    this.setData({
      shoppingCartData: items,
      checkAll
@@ -120,7 +119,6 @@
        });
      })
    } else {
      Toast({
        context: this,
        selector: '#t-toast',
@@ -129,8 +127,10 @@
        direction: 'column',
      });
    }
  },
  onLogin() {
    wx.navigateTo({
      url: '/pages/testLogin/index'
    });
  }
});