feat:添加empty组件
parent
55796a6a41
commit
c2151b7c2f
@ -0,0 +1,97 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app-empty-state">
|
||||||
|
<view class="empty-icon-wrap">
|
||||||
|
<view class="empty-icon-bg empty-icon-bg-left"></view>
|
||||||
|
<view class="empty-icon-bg empty-icon-bg-right"></view>
|
||||||
|
<view class="empty-icon-core">
|
||||||
|
<uni-icons :type="icon" size="38" color="#2d5a87" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="empty-title">{{ title }}</text>
|
||||||
|
<text v-if="desc" class="empty-desc">{{ desc }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: 'locked-filled'
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
desc: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-empty-state {
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
padding: 72rpx 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 12rpx 36rpx rgba(26, 58, 92, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon-wrap {
|
||||||
|
position: relative;
|
||||||
|
width: 176rpx;
|
||||||
|
height: 176rpx;
|
||||||
|
margin: 0 auto 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon-bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
width: 78rpx;
|
||||||
|
height: 78rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: linear-gradient(135deg, rgba(45, 90, 135, 0.08) 0%, rgba(45, 90, 135, 0.18) 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon-bg-left {
|
||||||
|
left: 10rpx;
|
||||||
|
transform: translateY(-50%) rotate(-18deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon-bg-right {
|
||||||
|
right: 10rpx;
|
||||||
|
transform: translateY(-50%) rotate(18deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon-core {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 132rpx;
|
||||||
|
height: 132rpx;
|
||||||
|
border-radius: 36rpx;
|
||||||
|
background: linear-gradient(180deg, #f7fbff 0%, #eaf3fb 100%);
|
||||||
|
border: 2rpx solid rgba(45, 90, 135, 0.1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
box-shadow: inset 0 2rpx 0 rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-title {
|
||||||
|
display: block;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1a3a5c;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-desc {
|
||||||
|
display: block;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #7a8795;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue