xuxueyang
2024-07-31 af2a86dbbe05d74b00a6e7bdc426e26bb0453654
sub_pages/customer/trade/list.vue
@@ -237,10 +237,13 @@
         this.page.current = 1
         await this.getList('post')
         uni.stopPullDownRefresh()
      },
      onShow(){
         this.refreshShopNum()
      },
      methods: {
         async refreshShopNum() {
            this.shoptotal = await this.$store.dispatch('submitShopping', dto);
            this.shoptotal = await this.$store.dispatch('countShopping');
         },
         async getDetail() {
            this.$message.showLoading()
@@ -338,8 +341,8 @@
            if (!item.shopnum) {
               item.shopnum = 0
            }
            if (item.shopnum + addnum > item.stock) {
               this.$message.showToast('库存不足,无法添加')
            if (addnum > 0 & item.shopnum + addnum > item.stock) {
               this.$message.showToast('库存不足,无法修改')
               return
            }
            
@@ -351,7 +354,7 @@
            this.$message.showLoading()
            const {
               code
            } = await http.request('post', '/api/customer/flower/cart/change-num', {
            } = await this.$http.request('post', '/api/customer/flower/cart/change-num', {
               data: {
                  id: item.id,
                  num: addnum