瀏覽代碼

修改待办消息显示问题

jwyu 3 年之前
父節點
當前提交
3485a8a760
共有 1 個文件被更改,包括 27 次插入15 次删除
  1. 27 15
      pages/index/index.vue

+ 27 - 15
pages/index/index.vue

@@ -1,20 +1,23 @@
 <template>
 	<view class="home-page">
-		<view class="message-box flex white-wrap" @click="handleGONext('custome')" v-if="custome.Total>0">
-			<image class="icon" src="../../static/icon-1.png" mode="aspectFill"></image>
-			<text style="flex: 1;margin-right: 5px;" class="van-ellipsis">{{custome.Message}}</text>
-			<van-tag round type="danger" color="#FF4444">{{custome.Total}}</van-tag>
-		</view>
-		<view class="message-box flex white-wrap" @click="handleGONext('contract')" v-if="contract.Total>0">
-			<image class="icon" src="../../static/icon-2.png" mode="aspectFill"></image>
-			<text style="flex: 1;margin-right: 5px;" class="van-ellipsis">{{contract.Message}}</text>
-			<van-tag round type="danger" color="#FF4444">{{contract.Total}}</van-tag>
-		</view>
-		<view class="message-box flex white-wrap" @click="handleGONext('seal')" v-if="seal.Total>0">
-			<image class="icon" src="../../static/icon-3.png" mode="aspectFill"></image>
-			<text style="flex: 1;margin-right: 5px;" class="van-ellipsis">{{seal.Message}}</text>
-			<van-tag round type="danger" color="#FF4444">{{seal.Total}}</van-tag>
-		</view>
+		<van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="show"/>
+		<template v-else>
+			<view class="message-box flex white-wrap" @click="handleGONext('custome')" v-if="custome.Message">
+				<image class="icon" src="../../static/icon-1.png" mode="aspectFill"></image>
+				<text style="flex: 1;margin-right: 5px;" class="van-ellipsis">{{custome.Message}}</text>
+				<van-tag round type="danger" color="#FF4444">{{custome.Total}}</van-tag>
+			</view>
+			<view class="message-box flex white-wrap" @click="handleGONext('contract')" v-if="contract.Message">
+				<image class="icon" src="../../static/icon-2.png" mode="aspectFill"></image>
+				<text style="flex: 1;margin-right: 5px;" class="van-ellipsis">{{contract.Message}}</text>
+				<van-tag round type="danger" color="#FF4444">{{contract.Total}}</van-tag>
+			</view>
+			<view class="message-box flex white-wrap" @click="handleGONext('seal')" v-if="seal.Message">
+				<image class="icon" src="../../static/icon-3.png" mode="aspectFill"></image>
+				<text style="flex: 1;margin-right: 5px;" class="van-ellipsis">{{seal.Message}}</text>
+				<van-tag round type="danger" color="#FF4444">{{seal.Total}}</van-tag>
+			</view>
+		</template>
 	</view>
 	
 </template>
@@ -22,6 +25,15 @@
 <script>
 	import {apiMessageCount} from '@/api/message.js'
 	export default {
+		computed:{
+			show(){
+				if(this.custome&&!this.custome.Message&&this.contract&&!this.contract.Message&&this.seal&&!this.seal.Message){
+					return true
+				}else{
+					return false
+				}
+			}
+		},
 		data() {
 			return {
 				custome:null,