hw-cus-ui 1.1.7 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hw-cus-ui",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "使用该组件库需安装uniapp插件@dcloudio/uni-ui",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -5,192 +5,222 @@
5
5
 
6
6
  <!-- 空数据占位view,此组件支持easycom规范,可以在项目中直接引用 -->
7
7
  <template>
8
- <view :class="{'zp-container':true,'zp-container-fixed':emptyViewFixed}" :style="[finalEmptyViewStyle]" @click="emptyViewClick">
9
- <view class="zp-main">
10
- <image v-if="!emptyViewImg.length" :class="{'zp-main-image-rpx':unit==='rpx','zp-main-image-px':unit==='px'}" :style="[emptyViewImgStyle]" :src="emptyImg" />
11
- <image v-else :class="{'zp-main-image-rpx':unit==='rpx','zp-main-image-px':unit==='px'}" mode="aspectFit" :style="[emptyViewImgStyle]" :src="emptyViewImg" />
12
- <text class="zp-main-title" :class="{'zp-main-title-rpx':unit==='rpx','zp-main-title-px':unit==='px'}" :style="[emptyViewTitleStyle]">{{emptyViewText}}</text>
13
- <text v-if="showEmptyViewReload" :class="{'zp-main-error-btn':true,'zp-main-error-btn-rpx':unit==='rpx','zp-main-error-btn-px':unit==='px'}" :style="[emptyViewReloadStyle]" @click.stop="reloadClick">{{emptyViewReloadText}}</text>
14
- </view>
15
- </view>
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
- // #ifdef APP-NVUE
20
- import zStatic from '../z-paging/js/z-paging-static';
21
- // #endif
22
-
23
- // #ifndef APP-NVUE
24
- import zStatic from '../js/z-paging-static';
25
- // #endif
26
- export default {
27
- name: 'z-paging-empty-view',
28
- mixins: [zStatic],
29
- data() {
30
- return {
31
-
32
- };
33
- },
34
- props: {
35
- // 空数据描述文字
36
- emptyViewText: {
37
- type: String,
38
- default: '没有数据哦~'
39
- },
40
- // 空数据图片
41
- emptyViewImg: {
42
- type: String,
43
- default: ''
44
- },
45
- // 是否显示空数据图重新加载按钮
46
- showEmptyViewReload: {
47
- type: Boolean,
48
- default: false
49
- },
50
- // 空数据点击重新加载文字
51
- emptyViewReloadText: {
52
- type: String,
53
- default: '重新加载'
54
- },
55
- // 是否是加载失败
56
- isLoadFailed: {
57
- type: Boolean,
58
- default: false
59
- },
60
- // 空数据图样式
61
- emptyViewStyle: {
62
- type: Object,
63
- default: function() {
64
- return {}
65
- }
66
- },
67
- // 空数据图img样式
68
- emptyViewImgStyle: {
69
- type: Object,
70
- default: function() {
71
- return {}
72
- }
73
- },
74
- // 空数据图描述文字样式
75
- emptyViewTitleStyle: {
76
- type: Object,
77
- default: function() {
78
- return {}
79
- }
80
- },
81
- // 空数据图重新加载按钮样式
82
- emptyViewReloadStyle: {
83
- type: Object,
84
- default: function() {
85
- return {}
86
- }
87
- },
88
- // 空数据图z-index
89
- emptyViewZIndex: {
90
- type: Number,
91
- default: 9
92
- },
93
- // 空数据图片是否使用fixed布局并铺满z-paging
94
- emptyViewFixed: {
95
- type: Boolean,
96
- default: true
97
- },
98
- // 空数据图中布局的单位,默认为rpx
99
- unit: {
100
- type: String,
101
- default: 'rpx'
102
- }
103
- },
104
- computed: {
105
- emptyImg() {
106
- return this.isLoadFailed ? zStatic.base64Error : zStatic.base64Empty;
107
- },
108
- finalEmptyViewStyle(){
109
- this.emptyViewStyle['z-index'] = this.emptyViewZIndex;
110
- return this.emptyViewStyle;
111
- }
112
- },
113
- methods: {
114
- // 点击了reload按钮
115
- reloadClick() {
116
- this.$emit('reload');
117
- },
118
- // 点击了空数据view
119
- emptyViewClick() {
120
- this.$emit('viewClick');
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
- .zp-container{
128
- /* #ifndef APP-NVUE */
129
- display: flex;
130
- /* #endif */
131
- align-items: center;
132
- justify-content: center;
133
- }
134
- .zp-container-fixed {
135
- /* #ifndef APP-NVUE */
136
- position: absolute;
137
- top: 0;
138
- left: 0;
139
- width: 100%;
140
- height: 100%;
141
- /* #endif */
142
- /* #ifdef APP-NVUE */
143
- flex: 1;
144
- /* #endif */
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
- .zp-main{
148
- /* #ifndef APP-NVUE */
149
- display: flex;
150
- /* #endif */
151
- flex-direction: column;
152
- align-items: center;
153
- padding: 50rpx 0rpx;
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
- .zp-main-image-rpx {
157
- width: 240rpx;
158
- height: 240rpx;
159
- }
160
- .zp-main-image-px {
161
- width: 120px;
162
- height: 120px;
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
- .zp-main-title {
166
- color: #aaaaaa;
167
- text-align: center;
168
- }
169
- .zp-main-title-rpx {
170
- font-size: 28rpx;
171
- margin-top: 10rpx;
172
- padding: 0rpx 20rpx;
173
- }
174
- .zp-main-title-px {
175
- font-size: 14px;
176
- margin-top: 5px;
177
- padding: 0px 10px;
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
- .zp-main-error-btn {
181
- border: solid 1px #dddddd;
182
- color: #aaaaaa;
183
- }
184
- .zp-main-error-btn-rpx {
185
- font-size: 28rpx;
186
- padding: 8rpx 24rpx;
187
- border-radius: 6rpx;
188
- margin-top: 50rpx;
189
- }
190
- .zp-main-error-btn-px {
191
- font-size: 14px;
192
- padding: 4px 12px;
193
- border-radius: 3px;
194
- margin-top: 25px;
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>
@@ -27,11 +27,11 @@
27
27
 
28
28
  <script>
29
29
  // #ifdef APP-NVUE
30
- import commonLayoutModule from '../z-paging/js/modules/common-layout';
30
+ import commonLayoutModule from '../../z-paging/js/modules/common-layout';
31
31
  // #endif
32
32
 
33
33
  // #ifndef APP-NVUE
34
- import commonLayoutModule from '../js/modules/common-layout';
34
+ import commonLayoutModule from '../../z-paging/js/modules/common-layout';
35
35
  // #endif
36
36
  export default {
37
37
  name: 'z-paging-swiper',
@@ -26,11 +26,11 @@
26
26
 
27
27
  <script>
28
28
  // #ifdef APP-NVUE
29
- import zPaging from '../z-paging/z-paging';
29
+ import zPaging from '../../z-paging/z-paging';
30
30
  // #endif
31
31
 
32
32
  // #ifndef APP-NVUE
33
- import zPaging from '../z-paging/z-paging';
33
+ import zPaging from '../../z-paging/z-paging';
34
34
  // #endif
35
35
  export default {
36
36
  name: 'z-paging-swiper-item',