| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 | <template>	<view class="zp-container" :style="[finalEmptyViewStyle]">		<view class="zp-main">			<image v-if="!emptyViewImg.length" class="zp-main-image" :style="[emptyViewImgStyle]" :src="emptyImg"></image>			<image v-else class="zp-main-image" mode="aspectFit" :style="[emptyViewImgStyle]" :src="emptyViewImg"></image>			<text class="zp-main-title" :style="[emptyViewTitleStyle]">{{emptyViewText}}</text>			<text v-if="showEmptyViewReload" class="zp-main-error-btn" :style="[emptyViewReloadStyle]"				@click="reloadClick">{{emptyViewReloadText}}</text>		</view>	</view></template><script>	import zStatic from '../z-paging/js/z-paging-static'	export default {		data() {			return {				base64Empty: zStatic.base64Empty,				base64Error: zStatic.base64Error			};		},		props: {						emptyViewText: {				type: String,				default: function() {					return '没有数据哦~'				}			},						emptyViewImg: {				type: String,				default: function() {					return ''				}			},						showEmptyViewReload: {				type: Boolean,				default: function() {					return false				}			},						emptyViewReloadText: {				type: String,				default: function() {					return '重新加载'				}			},						isLoadFailed: {				type: Boolean,				default: function() {					return false				}			},						emptyViewStyle: {				type: Object,				default: function() {					return {}				}			},						emptyViewImgStyle: {				type: Object,				default: function() {					return {}				}			},						emptyViewTitleStyle: {				type: Object,				default: function() {					return {}				}			},						emptyViewReloadStyle: {				type: Object,				default: function() {					return {}				}			},						emptyViewZIndex: {				type: Number,				default: function() {					return 9				}			}		},		computed: {			emptyImg() {				if (this.isLoadFailed) {					return this.base64Error;				} else {					return this.base64Empty;				}			},			finalEmptyViewStyle(){				this.emptyViewStyle['z-index'] = this.emptyViewZIndex;				return this.emptyViewStyle;			}		},		methods: {			reloadClick() {				this.$emit('reload');			}		}	}</script><style scoped>	.zp-container {				position: absolute;		top: 0;		left: 0;		width: 100%;		height: 100%;		display: flex;						flex: 1;				align-items: center;		justify-content: center;	}	.zp-main {				display: flex;		margin-top: -150rpx;						margin-top: -100rpx;				flex-direction: column;		align-items: center;	}	.zp-main-image {		width: 200rpx;		height: 200rpx;	}	.zp-main-title {		font-size: 26rpx;		color: #aaaaaa;		text-align: center;		margin-top: 10rpx;	}	.zp-main-error-btn {		font-size: 26rpx;		padding: 8rpx 24rpx;		border: solid 1px #dddddd;		border-radius: 6rpx;		color: #aaaaaa;		margin-top: 50rpx;	}</style>
 |