shish il y a 4 ans
Parent
commit
86aa54e33e

+ 1 - 1
mallApp/src/pages/home/category.vue

@@ -22,7 +22,7 @@
           </view>
         </view>
         <block v-else>
-          <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+          <app-wrapper-empty title="暂无商品" :is-empty="$util.isEmpty(list.data)" />
         </block>
       </scroll-view>
     </block>

+ 6 - 1
mallApp/src/pages/home/components/goods-list-big.vue

@@ -7,7 +7,7 @@
 			</div>
 		</div>
 		<div class="goods-wrap">
-			<block>
+			<block v-if="!$util.isEmpty(info.goodsInfoList)">
 				<div class="goods-list" v-for="(item, index) in info.goodsInfoList" :key="index" @click="pageTo({ url: '/pages/goods/detail', query: { id: item.id } })">
 					<div class="goods-img">
 						<image class="app-img" :src="item.imgList[0]" mode="aspectFit" style="height:713upx;" lazy-load="true" :lazy-load-margin="0"></image>
@@ -21,6 +21,11 @@
 					</div>
 				</div>
 			</block>
+			<block>
+				<view style="height:100upx;">
+					<text></text>
+				</view>
+			</block>
 		</div>
 	</div>
 </template>

+ 17 - 11
mallApp/src/pages/home/components/goods-list-small.vue

@@ -7,22 +7,28 @@
 			</div>
 		</div>
 		<div class="goods-wrap">
-			<div class="goods-list" v-for="(item, index) in info.goodsInfoList" :key="index" @click="pageTo(`/pages/goods/detail?id=${item.id}`)">
-				<div class="goods-img">
-					<app-img :src="item.smallImgList[0]" mode="aspectFit" style="width:100%" />
-				</div>
-				<div class="goods-det">
-					<div class="goods-left">
-						<div class="goods-name">{{ item.name }}</div>
-						<div class="app-price">¥{{ item.price?parseFloat(item.price):0 }}</div>
+			<block v-if="!$util.isEmpty(info.goodsInfoList)">
+				<div class="goods-list" v-for="(item, index) in info.goodsInfoList" :key="index" @click="pageTo(`/pages/goods/detail?id=${item.id}`)">
+					<div class="goods-img">
+						<app-img :src="item.smallImgList[0]" mode="aspectFit" style="width:100%" />
+					</div>
+					<div class="goods-det">
+						<div class="goods-left">
+							<div class="goods-name">{{ item.name }}</div>
+							<div class="app-price">¥{{ item.price?parseFloat(item.price):0 }}</div>
+						</div>
+						<div class="button-com red buy-com-btn">购买</div>
 					</div>
-					<div class="button-com red buy-com-btn">购买</div>
 				</div>
-			</div>
+			</block>
+			<block>
+				<view style="height:100upx;">
+					<text></text>
+				</view>
+			</block>
 		</div>
 	</div>
 </template>
-
 <script>
 import AppImg from '@/components/app-img'
 export default {

+ 11 - 5
mallApp/src/pages/home/index.vue

@@ -1,12 +1,15 @@
 <template>
   <view class="app-main app-content">
     <app-swiper v-if="!$util.isEmpty(ad)" :list="ad" />
-    <template v-if="!$util.isEmpty(category)">
+    <view style="margin-bottom:100upx;" v-if="!$util.isEmpty(category)">
       <view class="goods-module" v-for="(item, index) in category" :key="index" >
         <goods-list-big v-if="item.showRow == 1" :info="item" />
         <goods-list-small v-if="item.showRow == 2" :info="item" />
       </view>
-    </template>
+    </view>
+    <block v-else>
+      <app-wrapper-empty title="暂无商品" is-empty="true" />
+    </block>
     <tab-bar :current="0"></tab-bar>
   </view>
 </template>
@@ -18,8 +21,9 @@ import goodsListBig from "@/pages/home/components/goods-list-big";
 import goodsListMiddle from "@/pages/home/components/goods-list-middle";
 import goodsListSmall from "@/pages/home/components/goods-list-small";
 import { getMainIndex } from "@/api/home";
-import { getOrderShop } from "@/utils/config";
-import { share } from "@/mixins";
+import { getOrderShop } from "@/utils/config"
+import { share } from "@/mixins"
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
 export default {
   name: "home",
   components: {
@@ -27,7 +31,8 @@ export default {
     AppTrademark,
     goodsListBig,
     goodsListMiddle,
-    goodsListSmall
+    goodsListSmall,
+    AppWrapperEmpty
   },
   mixins: [share],
   data () {
@@ -67,6 +72,7 @@ export default {
         });
         this.pageTitle = res.data.sj.name
         uni.setNavigationBarTitle({ title: this.pageTitle })
+        console.log('this.category',this.category)
         this.category = res.data.category;
         this.columnStyle = res.data.columnStyle;
       });