lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
330d2448b8
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      pages/goods/index.vue

+ 7 - 2
pages/goods/index.vue

@@ -6,13 +6,13 @@
 		</view>
 		</view>
 		<!-- 商品 -->
 		<!-- 商品 -->
 		<view class="goods">
 		<view class="goods">
-			<view v-for="(item,index) in goodsList" :key="index" v-if="goodsList.length&&item.list.length">
+			<view v-for="(item,index) in goodsList" :key="index" v-if="item&&item.list.length">
 				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
 				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
 				<view class="goods-list">
 				<view class="goods-list">
 					<uni-coods :goldLimit="item.type.goldLimit" :list="item.list"></uni-coods>
 					<uni-coods :goldLimit="item.type.goldLimit" :list="item.list"></uni-coods>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view v-if="goodsList.length==0">
+			<view v-if="goodsListLength==0">
 				<u-empty icon-size="60" :text="noDataText" mode="list"></u-empty>
 				<u-empty icon-size="60" :text="noDataText" mode="list"></u-empty>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -43,6 +43,11 @@
 		onLoad() {
 		onLoad() {
 			this.pageInit()
 			this.pageInit()
 		},
 		},
+		computed: {
+			goodsListLength() {
+				return this.goodsList.length
+			}
+		},
 		onShow() {
 		onShow() {
 			// 是否登录
 			// 是否登录
 			checkLogin().then(res => {
 			checkLogin().then(res => {