From 1034136b2a8e95d131f90ea12fcc4945691c4652 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期五, 31 五月 2024 15:15:05 +0800 Subject: [PATCH] feture:无数据添加空页面 --- pages/quality-inspection-page/edc-sampling/edc-sampling.vue | 24 ++++++++++++ pages/quality-inspection-page/salt-total-sampling/salt-total-sampling.vue | 24 ++++++++++++ pages/quality-inspection-page/yanGaiMei-sampling/yanGaiMei-sampling.vue | 24 ++++++++++++ pages/quality-inspection-page/symbNa-sampling/symbNa-sampling.vue | 24 ++++++++++++ pages/quality-inspection-page/toc-sampling/toc-sampling.vue | 24 ++++++++++++ 5 files changed, 120 insertions(+), 0 deletions(-) diff --git a/pages/quality-inspection-page/edc-sampling/edc-sampling.vue b/pages/quality-inspection-page/edc-sampling/edc-sampling.vue index e813548..0ce17d6 100644 --- a/pages/quality-inspection-page/edc-sampling/edc-sampling.vue +++ b/pages/quality-inspection-page/edc-sampling/edc-sampling.vue @@ -1,6 +1,16 @@ <template> <view class="edc-sampling-wrap"> <view class="edc-sampling-main"> + <u-empty + class="empty-box" + mode="data" + icon="http://cdn.uviewui.com/uview/empty/data.png" + textSize="30" + width="300" + height="300" + text="鏆傛棤鏁版嵁" + v-if="emptyShow"> + </u-empty> <view class="edc-sampling-card" v-for="(item,index) in edcList" :key="index"> <view class="edc-sampling-line"> <h1>{{item.carNo}}</h1> @@ -71,6 +81,7 @@ data() { return { edcList:[], + emptyShow:false, //绌洪〉闈㈡槸鍚︽樉绀� size:10, current:1, total:0, @@ -141,6 +152,11 @@ const res = await this.$reqGet('getTaskCoalOfNoDetection',{current:this.current,size:this.size,productId:this.productId}) uni.hideLoading() this.edcList = [...this.edcList,...res.data.records] + if(this.edcList == 0) { + this.emptyShow = true + }else { + this.emptyShow = false + } this.total = res.data.total callBack && callBack() }catch (err) { @@ -282,6 +298,14 @@ } } } + .empty-box{ + margin: auto; + position: absolute; + top: 24%; + left: 50%; + transition: (50%, -50%); + transform: translate(-50%, -24%); + } } } diff --git a/pages/quality-inspection-page/salt-total-sampling/salt-total-sampling.vue b/pages/quality-inspection-page/salt-total-sampling/salt-total-sampling.vue index 4dc5738..dd21c02 100644 --- a/pages/quality-inspection-page/salt-total-sampling/salt-total-sampling.vue +++ b/pages/quality-inspection-page/salt-total-sampling/salt-total-sampling.vue @@ -7,6 +7,16 @@ <h1>娣诲姞鍘熺洂鍏ㄦ鍙栨牱</h1> </view> </view> + <u-empty + class="empty-box" + mode="data" + icon="http://cdn.uviewui.com/uview/empty/data.png" + textSize="30" + width="300" + height="300" + text="鏆傛棤鏁版嵁" + v-if="emptyShow"> + </u-empty> <div class="edc-sampling-main-inside"> <view class="edc-sampling-card" v-for="item in edcList" :key="item.id"> <view class="edc-sampling-line"> @@ -62,6 +72,7 @@ data() { return { edcList:[], + emptyShow: false, size:10, current:1, total:0, @@ -132,6 +143,11 @@ const res = await this.$reqGet('pageList',{current:this.current,size:this.size,type:this.type}) uni.hideLoading() this.edcList = [...this.edcList,...res.data.records] + if(this.edcList == 0) { + this.emptyShow = true + }else { + this.emptyShow = false + } this.total = res.data.total callBack && callBack() }catch (err) { @@ -306,6 +322,14 @@ font-size: 30rpx; color: #999999; } + .empty-box{ + margin: auto; + position: absolute; + top: 24%; + left: 50%; + transition: (50%, -50%); + transform: translate(-50%, -24%); + } } } </style> diff --git a/pages/quality-inspection-page/symbNa-sampling/symbNa-sampling.vue b/pages/quality-inspection-page/symbNa-sampling/symbNa-sampling.vue index 0260870..33876fa 100644 --- a/pages/quality-inspection-page/symbNa-sampling/symbNa-sampling.vue +++ b/pages/quality-inspection-page/symbNa-sampling/symbNa-sampling.vue @@ -7,6 +7,16 @@ <h1>娣诲姞姘㈡哀鍖栭挔鍙栨牱</h1> </view> </view> + <u-empty + class="empty-box" + mode="data" + icon="http://cdn.uviewui.com/uview/empty/data.png" + textSize="30" + width="300" + height="300" + text="鏆傛棤鏁版嵁" + v-if="emptyShow"> + </u-empty> <div class="edc-sampling-main-inside"> <view class="edc-sampling-card" v-for="item in edcList" :key="item.id"> <view class="edc-sampling-line"> @@ -62,6 +72,7 @@ data() { return { edcList:[], + emptyShow: false, size:10, current:1, total:0, @@ -132,6 +143,11 @@ const res = await this.$reqGet('pageList',{current:this.current,size:this.size,type:this.type}) uni.hideLoading() this.edcList = [...this.edcList,...res.data.records] + if(this.edcList == 0) { + this.emptyShow = true + }else { + this.emptyShow = false + } this.total = res.data.total callBack && callBack() }catch (err) { @@ -305,6 +321,14 @@ font-size: 30rpx; color: #999999; } + .empty-box{ + margin: auto; + position: absolute; + top: 24%; + left: 50%; + transition: (50%, -50%); + transform: translate(-50%, -24%); + } } } </style> diff --git a/pages/quality-inspection-page/toc-sampling/toc-sampling.vue b/pages/quality-inspection-page/toc-sampling/toc-sampling.vue index 1b79319..5f4281a 100644 --- a/pages/quality-inspection-page/toc-sampling/toc-sampling.vue +++ b/pages/quality-inspection-page/toc-sampling/toc-sampling.vue @@ -7,6 +7,16 @@ <h1>娣诲姞鍘熺洂TOC鍙栨牱</h1> </view> </view> + <u-empty + class="empty-box" + mode="data" + icon="http://cdn.uviewui.com/uview/empty/data.png" + textSize="30" + width="300" + height="300" + text="鏆傛棤鏁版嵁" + v-if="emptyShow"> + </u-empty> <div class="edc-sampling-main-inside"> <view class="edc-sampling-card" v-for="item in edcList" :key="item.id"> <view class="edc-sampling-line"> @@ -62,6 +72,7 @@ data() { return { edcList:[], + emptyShow:false, //绌洪〉闈㈡槸鍚︽樉绀� size:10, current:1, total:0, @@ -132,6 +143,11 @@ const res = await this.$reqGet('pageList',{current:this.current,size:this.size,type:this.type}) uni.hideLoading() this.edcList = [...this.edcList,...res.data.records] + if(this.edcList == 0) { + this.emptyShow = true + }else { + this.emptyShow = false + } this.total = res.data.total callBack && callBack() }catch (err) { @@ -305,6 +321,14 @@ font-size: 30rpx; color: #999999; } + .empty-box{ + margin: auto; + position: absolute; + top: 24%; + left: 50%; + transition: (50%, -50%); + transform: translate(-50%, -24%); + } } } </style> diff --git a/pages/quality-inspection-page/yanGaiMei-sampling/yanGaiMei-sampling.vue b/pages/quality-inspection-page/yanGaiMei-sampling/yanGaiMei-sampling.vue index 3bc8a53..e7cbc9e 100644 --- a/pages/quality-inspection-page/yanGaiMei-sampling/yanGaiMei-sampling.vue +++ b/pages/quality-inspection-page/yanGaiMei-sampling/yanGaiMei-sampling.vue @@ -1,6 +1,16 @@ <template> <view class="yanGaiMei-sampling-wrap"> <div class="edc-sampling-main"> + <u-empty + class="empty-box" + mode="data" + icon="http://cdn.uviewui.com/uview/empty/data.png" + textSize="30" + width="300" + height="300" + text="鏆傛棤鏁版嵁" + v-if="emptyShow"> + </u-empty> <view class="yanGaiMei-sampling-add"> <view class="add-box" @click="addYanGaiMeiForm"> <u-image src="/static/image/quality/addIcon.png" mode="widthFix"></u-image> @@ -62,6 +72,7 @@ data() { return { edcList:[], + emptyShow:false, //绌洪〉闈㈡槸鍚︽樉绀� size:10, current:1, total:0, @@ -132,6 +143,11 @@ const res = await this.$reqGet('pageList',{current:this.current,size:this.size,type:this.type}) uni.hideLoading() this.edcList = [...this.edcList,...res.data.records] + if(this.edcList == 0) { + this.emptyShow = true + }else { + this.emptyShow = false + } this.total = res.data.total callBack && callBack() }catch (err) { @@ -305,6 +321,14 @@ font-size: 30rpx; color: #999999; } + .empty-box{ + margin: auto; + position: absolute; + top: 24%; + left: 50%; + transition: (50%, -50%); + transform: translate(-50%, -24%); + } } } </style> -- Gitblit v1.9.1