hw-cus-ui 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,192 +5,222 @@
|
|
|
5
5
|
|
|
6
6
|
<!-- 空数据占位view,此组件支持easycom规范,可以在项目中直接引用 -->
|
|
7
7
|
<template>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
<view
|
|
9
|
+
:class="{ 'zp-container': true, 'zp-container-fixed': emptyViewFixed }"
|
|
10
|
+
:style="[finalEmptyViewStyle]"
|
|
11
|
+
@click="emptyViewClick"
|
|
12
|
+
>
|
|
13
|
+
<view class="zp-main">
|
|
14
|
+
<image
|
|
15
|
+
v-if="!emptyViewImg.length"
|
|
16
|
+
:class="{ 'zp-main-image-rpx': unit === 'rpx', 'zp-main-image-px': unit === 'px' }"
|
|
17
|
+
:style="[emptyViewImgStyle]"
|
|
18
|
+
:src="emptyImg"
|
|
19
|
+
/>
|
|
20
|
+
<image
|
|
21
|
+
v-else
|
|
22
|
+
:class="{ 'zp-main-image-rpx': unit === 'rpx', 'zp-main-image-px': unit === 'px' }"
|
|
23
|
+
mode="aspectFit"
|
|
24
|
+
:style="[emptyViewImgStyle]"
|
|
25
|
+
:src="emptyViewImg"
|
|
26
|
+
/>
|
|
27
|
+
<text
|
|
28
|
+
class="zp-main-title"
|
|
29
|
+
:class="{ 'zp-main-title-rpx': unit === 'rpx', 'zp-main-title-px': unit === 'px' }"
|
|
30
|
+
:style="[emptyViewTitleStyle]"
|
|
31
|
+
>
|
|
32
|
+
{{ emptyViewText }}
|
|
33
|
+
</text>
|
|
34
|
+
<text
|
|
35
|
+
v-if="showEmptyViewReload"
|
|
36
|
+
:class="{
|
|
37
|
+
'zp-main-error-btn': true,
|
|
38
|
+
'zp-main-error-btn-rpx': unit === 'rpx',
|
|
39
|
+
'zp-main-error-btn-px': unit === 'px'
|
|
40
|
+
}"
|
|
41
|
+
:style="[emptyViewReloadStyle]"
|
|
42
|
+
@click.stop="reloadClick"
|
|
43
|
+
>
|
|
44
|
+
{{ emptyViewReloadText }}
|
|
45
|
+
</text>
|
|
46
|
+
</view>
|
|
47
|
+
</view>
|
|
16
48
|
</template>
|
|
17
49
|
|
|
18
50
|
<script>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
}
|
|
51
|
+
// #ifdef APP-NVUE
|
|
52
|
+
import zStatic from '../z-paging/js/z-paging-static';
|
|
53
|
+
// #endif
|
|
54
|
+
|
|
55
|
+
// #ifndef APP-NVUE
|
|
56
|
+
import zStatic from '../z-paging/js/z-paging-static';
|
|
57
|
+
// #endif
|
|
58
|
+
export default {
|
|
59
|
+
name: 'z-paging-empty-view',
|
|
60
|
+
mixins: [zStatic],
|
|
61
|
+
data() {
|
|
62
|
+
return {};
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
// 空数据描述文字
|
|
66
|
+
emptyViewText: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: '没有数据哦~'
|
|
69
|
+
},
|
|
70
|
+
// 空数据图片
|
|
71
|
+
emptyViewImg: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: ''
|
|
74
|
+
},
|
|
75
|
+
// 是否显示空数据图重新加载按钮
|
|
76
|
+
showEmptyViewReload: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
// 空数据点击重新加载文字
|
|
81
|
+
emptyViewReloadText: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: '重新加载'
|
|
84
|
+
},
|
|
85
|
+
// 是否是加载失败
|
|
86
|
+
isLoadFailed: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false
|
|
89
|
+
},
|
|
90
|
+
// 空数据图样式
|
|
91
|
+
emptyViewStyle: {
|
|
92
|
+
type: Object,
|
|
93
|
+
default: function () {
|
|
94
|
+
return {};
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
// 空数据图img样式
|
|
98
|
+
emptyViewImgStyle: {
|
|
99
|
+
type: Object,
|
|
100
|
+
default: function () {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
// 空数据图描述文字样式
|
|
105
|
+
emptyViewTitleStyle: {
|
|
106
|
+
type: Object,
|
|
107
|
+
default: function () {
|
|
108
|
+
return {};
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
// 空数据图重新加载按钮样式
|
|
112
|
+
emptyViewReloadStyle: {
|
|
113
|
+
type: Object,
|
|
114
|
+
default: function () {
|
|
115
|
+
return {};
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
// 空数据图z-index
|
|
119
|
+
emptyViewZIndex: {
|
|
120
|
+
type: Number,
|
|
121
|
+
default: 9
|
|
122
|
+
},
|
|
123
|
+
// 空数据图片是否使用fixed布局并铺满z-paging
|
|
124
|
+
emptyViewFixed: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: true
|
|
127
|
+
},
|
|
128
|
+
// 空数据图中布局的单位,默认为rpx
|
|
129
|
+
unit: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: 'rpx'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
computed: {
|
|
135
|
+
emptyImg() {
|
|
136
|
+
return this.isLoadFailed ? zStatic.base64Error : zStatic.base64Empty;
|
|
137
|
+
},
|
|
138
|
+
finalEmptyViewStyle() {
|
|
139
|
+
this.emptyViewStyle['z-index'] = this.emptyViewZIndex;
|
|
140
|
+
return this.emptyViewStyle;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
// 点击了reload按钮
|
|
145
|
+
reloadClick() {
|
|
146
|
+
this.$emit('reload');
|
|
147
|
+
},
|
|
148
|
+
// 点击了空数据view
|
|
149
|
+
emptyViewClick() {
|
|
150
|
+
this.$emit('viewClick');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
124
154
|
</script>
|
|
125
155
|
|
|
126
156
|
<style scoped>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
157
|
+
.zp-container {
|
|
158
|
+
/* #ifndef APP-NVUE */
|
|
159
|
+
display: flex;
|
|
160
|
+
/* #endif */
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
}
|
|
164
|
+
.zp-container-fixed {
|
|
165
|
+
/* #ifndef APP-NVUE */
|
|
166
|
+
position: absolute;
|
|
167
|
+
top: 0;
|
|
168
|
+
left: 0;
|
|
169
|
+
width: 100%;
|
|
170
|
+
height: 100%;
|
|
171
|
+
/* #endif */
|
|
172
|
+
/* #ifdef APP-NVUE */
|
|
173
|
+
flex: 1;
|
|
174
|
+
/* #endif */
|
|
175
|
+
}
|
|
146
176
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
177
|
+
.zp-main {
|
|
178
|
+
/* #ifndef APP-NVUE */
|
|
179
|
+
display: flex;
|
|
180
|
+
/* #endif */
|
|
181
|
+
flex-direction: column;
|
|
182
|
+
align-items: center;
|
|
183
|
+
padding: 50rpx 0rpx;
|
|
184
|
+
}
|
|
155
185
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
186
|
+
.zp-main-image-rpx {
|
|
187
|
+
width: 240rpx;
|
|
188
|
+
height: 240rpx;
|
|
189
|
+
}
|
|
190
|
+
.zp-main-image-px {
|
|
191
|
+
width: 120px;
|
|
192
|
+
height: 120px;
|
|
193
|
+
}
|
|
164
194
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
195
|
+
.zp-main-title {
|
|
196
|
+
color: #aaaaaa;
|
|
197
|
+
text-align: center;
|
|
198
|
+
}
|
|
199
|
+
.zp-main-title-rpx {
|
|
200
|
+
font-size: 28rpx;
|
|
201
|
+
margin-top: 10rpx;
|
|
202
|
+
padding: 0rpx 20rpx;
|
|
203
|
+
}
|
|
204
|
+
.zp-main-title-px {
|
|
205
|
+
font-size: 14px;
|
|
206
|
+
margin-top: 5px;
|
|
207
|
+
padding: 0px 10px;
|
|
208
|
+
}
|
|
179
209
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
210
|
+
.zp-main-error-btn {
|
|
211
|
+
border: solid 1px #dddddd;
|
|
212
|
+
color: #aaaaaa;
|
|
213
|
+
}
|
|
214
|
+
.zp-main-error-btn-rpx {
|
|
215
|
+
font-size: 28rpx;
|
|
216
|
+
padding: 8rpx 24rpx;
|
|
217
|
+
border-radius: 6rpx;
|
|
218
|
+
margin-top: 50rpx;
|
|
219
|
+
}
|
|
220
|
+
.zp-main-error-btn-px {
|
|
221
|
+
font-size: 14px;
|
|
222
|
+
padding: 4px 12px;
|
|
223
|
+
border-radius: 3px;
|
|
224
|
+
margin-top: 25px;
|
|
225
|
+
}
|
|
196
226
|
</style>
|