YZM 1 rok temu
rodzic
commit
ddc65a4002
2 zmienionych plików z 17 dodań i 19 usunięć
  1. 16 18
      pages/gouwuche/index.vue
  2. 1 1
      pages/shop/index.vue

+ 16 - 18
pages/gouwuche/index.vue

@@ -184,25 +184,23 @@
 					data: {}
 				}).then(res => {
 					if (res.data.code == 200) {
-						if (res.data.data.length > 0) {
-							that.test = [];
-							for (let i = 0; i < res.data.data.length; i++) {
-								var obj = {
-									img: res.data.data[i].goods_image,
-									title: res.data.data[i].goods_name,
-									// label: '黑色 - 6518/320',
-									// size:'S',
-									price: res.data.data[i].goods_price,
-									id: res.data.data[i].id,
-									buy: res.data.data[i].goods_num,
-									itemId: res.data.data[i].id,
-									checked: false,
-									goods_id:res.data.data[i].goods_id
-								};
-								that.test.push(obj)
-							}
-							that.jiage()
+						that.test = [];
+						for (let i = 0; i < res.data.data.length; i++) {
+							var obj = {
+								img: res.data.data[i].goods_image,
+								title: res.data.data[i].goods_name,
+								// label: '黑色 - 6518/320',
+								// size:'S',
+								price: res.data.data[i].goods_price,
+								id: res.data.data[i].id,
+								buy: res.data.data[i].goods_num,
+								itemId: res.data.data[i].id,
+								checked: false,
+								goods_id:res.data.data[i].goods_id
+							};
+							that.test.push(obj)
 						}
+						that.jiage()
 					} else {
 						that.test = [];
 					}

+ 1 - 1
pages/shop/index.vue

@@ -84,7 +84,7 @@
 		</view>
 		<view v-if="gouwuche.length!=0" class="fudong" @click="qugowuche">
 			<image src="../../static/img/87.png" mode="widthFix"></image>
-			<!-- <view class="shuzigwc"></view> -->
+			<view class="shuzigwc">{{gouwuche.length}}</view>
 		</view>
 		<view style="width:100%;height:60px;"></view>
 		<!-- 弹出层消息 -->