xuxueyang
2024-07-30 1fb44496929548b4f07b37796d506dedc494d44a
sub_pages/customer/shop/shop.vue
@@ -249,7 +249,11 @@
         },
         //update 关注
         async updateGz(type) {
         async updateGz(type) {
            if(!this.currentInfo.id){
               this.$message.showToast('请先登录')
               return
            }
            this.$message.showLoading()
            const {
               code
@@ -315,6 +319,13 @@
            }
            if (!item.shopnum) {
               item.shopnum = 0
            }
            if (!item.stock) {
               item.stock = 0
            }
            if (item.shopnum + addnum > item.stock) {
               this.$message.showToast('库存不足,无法添加')
               return
            }
            if (item.shopnum + addnum >= 0) {
@@ -332,9 +343,9 @@
            })
            this.$message.hideLoading()
            if (code === 0) {
               item.shopnum += addnum
               item.shopnum += addnum
               this.$forceUpdate()
            }
            this.$forceUpdate()
         },
      }