1
This commit is contained in:
31
components/empty/empty.js
Normal file
31
components/empty/empty.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// components/empty/empty.js
|
||||
Component({
|
||||
properties: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
value: '📭'
|
||||
},
|
||||
text: {
|
||||
type: String,
|
||||
value: '暂无数据'
|
||||
},
|
||||
desc: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
buttonText: {
|
||||
type: String,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onButtonClick() {
|
||||
this.triggerEvent('buttonclick')
|
||||
}
|
||||
}
|
||||
})
|
||||
4
components/empty/empty.json
Normal file
4
components/empty/empty.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
11
components/empty/empty.wxml
Normal file
11
components/empty/empty.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<!--components/empty/empty.wxml-->
|
||||
<view class="empty-container" wx:if="{{show}}">
|
||||
<view class="empty-image">
|
||||
<text class="empty-icon">{{icon}}</text>
|
||||
</view>
|
||||
<view class="empty-text">{{text}}</view>
|
||||
<view class="empty-desc" wx:if="{{desc}}">{{desc}}</view>
|
||||
<button class="empty-button" wx:if="{{buttonText}}" bindtap="onButtonClick">
|
||||
{{buttonText}}
|
||||
</button>
|
||||
</view>
|
||||
42
components/empty/empty.wxss
Normal file
42
components/empty/empty.wxss
Normal file
@@ -0,0 +1,42 @@
|
||||
/* components/empty/empty.wxss */
|
||||
.empty-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 60rpx;
|
||||
min-height: 400rpx;
|
||||
}
|
||||
|
||||
.empty-image {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
font-size: 120rpx;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 32rpx;
|
||||
color: #666666;
|
||||
margin-bottom: 15rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.empty-desc {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.empty-button {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
padding: 20rpx 60rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user