Parcourir la source

首页最新和排行榜无数据样式

pansl il y a 1 an
Parent
commit
ff67490b21
2 fichiers modifiés avec 35 ajouts et 21 suppressions
  1. 24 17
      pages/index/billboard/index.vue
  2. 11 4
      pages/index/new/index.vue

+ 24 - 17
pages/index/billboard/index.vue

@@ -1,25 +1,26 @@
 <template>
 	<view>
-		<view class="top">
-			<image class="top-img" mode="scaleToFill" src="@/static/icon/index/phb_bg.jpg"></image>
-			<view class="top-wrapper">
-				<text class="top-title">排行榜</text>
-				<text class="top-content">最后更新于 {{listData.update_time}}</text>
+		<view v-if="listData.data.length>0">
+			<view class="top">
+				<image class="top-img" mode="scaleToFill" src="@/static/icon/index/phb_bg.jpg"></image>
+				<view class="top-wrapper">
+					<text class="top-title">排行榜</text>
+					<text class="top-content">最后更新于 {{listData.update_time}}</text>
+				</view>
+			</view>
+			<view class="wrapper">
+				<block v-for="(value,key) in listData.data" :key="key">
+					<view class="box pb10 mb15" style="width:30%; border-radius:20rpx;" @click="detail(value)">
+						<image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
+						<view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{value.name}}</view>
+					</view>
+				</block>
 			</view>
 		</view>
-
-		<view class="wrapper">
-			<block v-for="(value,key) in listData.data" :key="key">
-				<view class="box pb10 mb15" style="width:30%; border-radius:20rpx;" @click="detail(value)">
-					<image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
-					<view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{value.name}}</view>
-				</view>
-			</block>
+		<view class="empty-box" v-else>
+			<image src="/static/img/orders/emty.png" mode=""></image>
+			<p class="ft14 line-1-txt">暂无数据</p>
 		</view>
-		<!-- <uni-load-more :status="status" :content-text="contentText" /> -->
-		<view style="width: 100%; height: 30upx;"></view>
-		<!-- <com-footer model="tuan"></com-footer> -->
-
 	</view>
 </template>
 
@@ -101,6 +102,12 @@
 </script>
 
 <style lang="scss" scoped>
+	.empty-box {
+		padding: 20px;
+		justify-content: center;
+		text-align: center;
+	}
+
 	.wrapper {
 		display: flex;
 		flex-wrap: wrap;

+ 11 - 4
pages/index/new/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view class="wrapper" style="">
+		<view class="wrapper" style="" v-if="listData.length>0">
 			<block v-for="(value,key) in listData" :key="key">
 				<view class="box pb10 mb15" style="width:30%; border-radius:20rpx;" @click="detail(value)">
 					<image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
@@ -8,9 +8,10 @@
 				</view>
 			</block>
 		</view>
-		<!-- <uni-load-more :status="status" :content-text="contentText" /> -->
-		<view style="width: 100%; height: 30upx;"></view>
-		<!-- <com-footer model="tuan"></com-footer> -->
+		<view class="empty-box" v-else>
+			<image src="/static/img/orders/emty.png" mode=""></image>
+			<p class="ft14 line-1-txt">暂无数据</p>
+		</view>
 
 	</view>
 </template>
@@ -93,6 +94,12 @@
 </script>
 
 <style lang="scss" scoped>
+	.empty-box {
+		padding: 20px;
+		justify-content: center;
+		text-align: center;
+	}
+
 	.wrapper {
 		display: flex;
 		flex-wrap: wrap;