Browse Source

no message

py 2 năm trước cách đây
mục cha
commit
047445368c
2 tập tin đã thay đổi với 12 bổ sung và 10 xóa
  1. 11 9
      pages-takeout/shop-mod/menu.vue
  2. 1 1
      pages-takeout/shop.vue

+ 11 - 9
pages-takeout/shop-mod/menu.vue

@@ -356,7 +356,7 @@
 				} else if (type === 2) {
 					// 加
 					if (item.is_infinite === 1 || item.stock > item.num) {
-            // ++item.num;
+						// ++item.num;
 						this.setSub(item, type);
 					} else {
 						this.isAjax = false
@@ -386,12 +386,12 @@
 			setSub(item, type) {
 				let cartKey = this.cartData.goods_list.findIndex(row => row.goods_id === item.goods_id)
 				if (type === 2 && cartKey < 0) {
-					this.setShopIngAdd(item.goods_id, item.category_id, '', 1,item)
+					this.setShopIngAdd(item.goods_id, item.category_id, '', 1, item)
 				} else {
 					this.setShopIngNumber(item.goods_id, item.category_id, type, '', 1)
 				}
 			},
-			setShopIngAdd(goodsId, categoryId, goodsSpecId, number,item) {
+			setShopIngAdd(goodsId, categoryId, goodsSpecId, number, item) {
 				setShopIngAdd({
 					'type': 1,
 					'goods_id': goodsId,
@@ -401,10 +401,11 @@
 					'number': number,
 				}).then(res => {
 					this.isAjax = false
-          if(item){
-            ++item.num;
-          }
+					if (item) {
+						++item.num;
+					}
 					this.getShopIngList()
+					this.$forceUpdate()
 				}).catch(() => {
 					this.isAjax = false
 				})
@@ -419,11 +420,12 @@
 					'number': number,
 					'operation': operation === 2 ? 1 : 2,
 				}).then(res => {
-          if(item){
-            --item.num;
-          }
+					if (item) {
+						--item.num;
+					}
 					this.isAjax = false
 					this.getShopIngList()
+					this.$forceUpdate()
 				}).catch(() => {
 					this.isAjax = false
 				})

+ 1 - 1
pages-takeout/shop.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="shop-index iPhone-bottom flex-common-css box-border-box" @touchmove.stop.prevent="moveHandle">
+	<view class="shop-index iPhone-bottom flex-common-css box-border-box">
 		<image class="bg-img" :src="shopsInfo.shop_logo" mode="aspectFill"></image>
 		<view class="mb-box"></view>
 		<view class="nav-box">