YZM 1 년 전
부모
커밋
ddc65a4002
2개의 변경된 파일17개의 추가작업 그리고 19개의 파일을 삭제
  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>
 		<!-- 弹出层消息 -->