@10yun/cv-mobile-ui 0.5.62 → 0.5.63

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.
Files changed (67) hide show
  1. package/package.json +1 -1
  2. package/plugins/uni-extend.js +10 -10
  3. package/ui-fireui/components/u-action-sheet/u-action-sheet.vue +46 -16
  4. package/ui-fireui/components/u-alert/u-alert.vue +11 -5
  5. package/ui-fireui/components/u-badge/u-badge.vue +52 -69
  6. package/ui-fireui/components/u-bottom-navigation/u-bottom-navigation.vue +28 -20
  7. package/ui-fireui/components/u-bottom-popup/u-bottom-popup.vue +40 -11
  8. package/ui-fireui/components/u-bubble-popup/u-bubble-popup.vue +3 -6
  9. package/ui-fireui/components/u-button/u-button.vue +262 -259
  10. package/ui-fireui/components/u-calendar/u-calendar.vue +227 -44
  11. package/ui-fireui/components/u-calendar/u-calendar2.js +562 -0
  12. package/ui-fireui/components/u-card/u-card.vue +50 -32
  13. package/ui-fireui/components/u-cascade-selection/u-cascade-selection.vue +197 -74
  14. package/ui-fireui/components/u-circular-progress/u-circular-progress.vue +324 -0
  15. package/ui-fireui/components/u-clipboard2/tui-clipboard.js +53 -0
  16. package/ui-fireui/components/u-collapse/u-collapse.vue +8 -8
  17. package/ui-fireui/components/u-config/index.js +129 -0
  18. package/ui-fireui/components/u-count-down/u-count-down.vue +124 -19
  19. package/ui-fireui/components/u-datetime/u-datetime.vue +416 -176
  20. package/ui-fireui/components/u-divider/u-divider.vue +3 -3
  21. package/ui-fireui/components/u-drawer/u-drawer.vue +55 -12
  22. package/ui-fireui/components/u-dropdown-list/u-dropdown-list.vue +103 -0
  23. package/ui-fireui/components/u-fab/u-fab.vue +344 -0
  24. package/ui-fireui/components/u-footer/u-footer.vue +148 -0
  25. package/ui-fireui/components/u-grid/u-grid.vue +2 -8
  26. package/ui-fireui/components/u-grid-item/u-grid-item.vue +22 -5
  27. package/ui-fireui/components/u-icon/u-icon-new.js +190 -0
  28. package/ui-fireui/components/u-icon/u-icon-new.vue +100 -0
  29. package/ui-fireui/components/u-image-cropper/u-image-cropper.vue +1144 -0
  30. package/ui-fireui/components/u-image-group/u-image-group.vue +164 -0
  31. package/ui-fireui/components/u-keyboard/u-keyboard.vue +3 -2
  32. package/ui-fireui/components/u-keyboard-input/u-keyboard-input.vue +1 -1
  33. package/ui-fireui/components/u-list-cell/u-list-cell.vue +82 -72
  34. package/ui-fireui/components/u-list-view/u-list-view.vue +33 -8
  35. package/ui-fireui/components/u-loading/u-loading.vue +107 -27
  36. package/ui-fireui/components/u-loadmore/u-loadmore.vue +21 -3
  37. package/ui-fireui/components/u-modal/u-modal.vue +140 -176
  38. package/ui-fireui/components/u-navigation-bar/u-navigation-bar.vue +121 -28
  39. package/ui-fireui/components/u-no-data/u-no-data.vue +58 -20
  40. package/ui-fireui/components/u-nomore/u-nomore.vue +5 -4
  41. package/ui-fireui/components/u-numberbox/u-numberbox.vue +88 -45
  42. package/ui-fireui/components/u-picture-cropper/u-picture-cropper.vue +94 -36
  43. package/ui-fireui/components/u-picture-cropper/u-picture-cropper.wxs +27 -17
  44. package/ui-fireui/components/u-rate/u-rate.vue +197 -0
  45. package/ui-fireui/components/u-round-progress/u-round-progress.vue +62 -42
  46. package/ui-fireui/components/u-scroll-top/u-scroll-top.vue +4 -3
  47. package/ui-fireui/components/u-section/u-section.vue +149 -0
  48. package/ui-fireui/components/u-skeleton/u-skeleton.vue +37 -6
  49. package/ui-fireui/components/u-steps/u-steps.vue +110 -27
  50. package/ui-fireui/components/u-sticky/u-sticky.vue +35 -21
  51. package/ui-fireui/components/u-sticky-wxs/u-sticky-wxs.vue +7 -4
  52. package/ui-fireui/components/u-sticky-wxs/u-sticky.wxs +39 -36
  53. package/ui-fireui/components/u-swipe-action/u-swipe-action.vue +76 -19
  54. package/ui-fireui/components/u-tabbar/u-tabbar.vue +71 -38
  55. package/ui-fireui/components/u-tabs/u-tabs.vue +133 -51
  56. package/ui-fireui/components/u-tag/u-tag.vue +109 -226
  57. package/ui-fireui/components/u-time-axis/u-time-axis.vue +1 -1
  58. package/ui-fireui/components/u-timeaxis-item/u-timeaxis-item.vue +1 -1
  59. package/ui-fireui/components/u-tips/u-tips.vue +35 -15
  60. package/ui-fireui/components/u-toast/u-toast.vue +9 -5
  61. package/ui-fireui/components/u-top-dropdown/u-top-dropdown.vue +8 -6
  62. package/ui-fireui/components/u-upload/u-upload-old.vue +462 -0
  63. package/ui-fireui/components/u-upload/u-upload.vue +648 -446
  64. package/ui-fireui/components/u-white-space/u-white-space.vue +68 -0
  65. package/ui-fireui/components/u-wing-blank/u-wing-blank.vue +100 -0
  66. package/uview-plus/libs/ctocode/index.js +1 -0
  67. package/uview-plus/libs/ctocode/richText.js +0 -1
@@ -0,0 +1,462 @@
1
+ <template>
2
+ <view class="up-container">
3
+ <view class="up-upload-box">
4
+ <view
5
+ class="up-image-item"
6
+ v-for="(item, index) in imageList" :key="index"
7
+ >
8
+ <image :src="item" class="up-item-img" @tap.stop="previewImage(index)" mode="aspectFill"></image>
9
+ <view v-if="!forbidDel" class="up-img-del" @tap.stop="delImage(index)">
10
+ <image class="del-img" src="/static/images/share/icon_del.png" mode="widthFix"></image>
11
+ </view>
12
+ <view v-if="statusArr[index] != 1" class="up-upload-mask">
13
+ <view class="up-upload-loading" v-if="statusArr[index] == 2"></view>
14
+ <text class="up-tips">{{ statusArr[index] == 2 ? '上传中...' : '上传失败' }}</text>
15
+ <view
16
+ class="up-mask-btn"
17
+ v-if="statusArr[index] == 3"
18
+ @tap.stop="reUpLoad(index)"
19
+ hover-class="up-btn-hover"
20
+ :hover-stay-time="150"
21
+ >
22
+ 重新上传
23
+ </view>
24
+ </view>
25
+ </view>
26
+ <view
27
+ v-if="isShowAdd"
28
+ class="up-upload-add"
29
+ :class="[borderColor !== 'transparent' ? 'up-upload__border' : 'up-upload__unborder']"
30
+ :style="{
31
+ width: width + 'rpx',
32
+ height: height + 'rpx',
33
+ background: background,
34
+ borderRadius: radius + 'rpx',
35
+ borderColor: borderColor,
36
+ borderStyle: borderSytle
37
+ }"
38
+ @tap="chooseImage"
39
+ >
40
+ <uni-icons type="camera" size="30" color="#00AFC7" />
41
+ <view class="" style="font-size: 24rpx; margin-top: 20rpx">添加</view>
42
+ <!-- <image class="add-img" src="/static/images/share/ad.png" mode="widthFix"></image> -->
43
+ <!-- <view class="up-upload-icon up-icon-plus"></view> -->
44
+ </view>
45
+ </view>
46
+ </view>
47
+ </template>
48
+ <script>
49
+ export default {
50
+ name: 'fuiUpload',
51
+ props: {
52
+ //初始化图片路径
53
+ value: {
54
+ type: Array,
55
+ default() {
56
+ return [];
57
+ }
58
+ },
59
+ //禁用删除
60
+ forbidDel: {
61
+ type: Boolean,
62
+ default: false
63
+ },
64
+ //禁用添加
65
+ forbidAdd: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ //服务器地址
70
+ serverUrl: {
71
+ type: String,
72
+ default: ''
73
+ },
74
+ //限制数
75
+ limit: {
76
+ type: Number,
77
+ default: 9
78
+ },
79
+ //original 原图,compressed 压缩图,默认二者都有
80
+ sizeType: {
81
+ type: Array,
82
+ default() {
83
+ return ['original', 'compressed'];
84
+ }
85
+ },
86
+ //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
87
+ sourceType: {
88
+ type: Array,
89
+ default() {
90
+ return ['album', 'camera'];
91
+ }
92
+ },
93
+ //可上传图片类型,默认为空,不限制 Array<String> ['jpg','png','gif']
94
+ imageFormat: {
95
+ type: Array,
96
+ default() {
97
+ return [];
98
+ }
99
+ },
100
+ //单张图片大小限制 MB
101
+ size: {
102
+ type: Number,
103
+ default: 4
104
+ },
105
+ //项目名,默认为 file
106
+ fileKeyName: {
107
+ type: String,
108
+ default: 'file'
109
+ },
110
+ //HTTP 请求 Header, header 中不能设置 Referer。
111
+ header: {
112
+ type: Object,
113
+ default() {
114
+ return {};
115
+ }
116
+ },
117
+ //HTTP 请求中其他额外的 form data
118
+ formData: {
119
+ type: Object,
120
+ default() {
121
+ return {};
122
+ }
123
+ }
124
+ },
125
+ data() {
126
+ return {
127
+ //图片地址
128
+ imageList: [],
129
+ //上传状态:1-上传成功 2-上传中 3-上传失败
130
+ statusArr: []
131
+ };
132
+ },
133
+ created() {
134
+ this.initImages();
135
+ },
136
+ watch: {
137
+ value(val) {
138
+ console.log('监听', val);
139
+ if (val) {
140
+ this.initImages();
141
+ }
142
+ }
143
+ },
144
+ computed: {
145
+ isShowAdd() {
146
+ let isShow = true;
147
+ if (this.forbidAdd || (this.limit && this.imageList.length >= this.limit)) {
148
+ isShow = false;
149
+ }
150
+ return isShow;
151
+ }
152
+ },
153
+ methods: {
154
+ initImages() {
155
+ this.imageList = [...this.value];
156
+ for (let item of this.imageList) {
157
+ this.statusArr.push('1');
158
+ }
159
+ },
160
+ // 重新上传
161
+ reUpLoad(index) {
162
+ this.statusArr[index] = '2';
163
+ this.change();
164
+ this.uploadImage(index, this.imageList[index])
165
+ .then(() => {
166
+ this.change();
167
+ })
168
+ .catch(() => {
169
+ this.change();
170
+ });
171
+ },
172
+ change() {
173
+ let status = ~this.statusArr.indexOf('2') ? 2 : 1;
174
+ if (status != 2 && ~this.statusArr.indexOf('3')) {
175
+ // 上传失败
176
+ status = 3;
177
+ }
178
+ this.$emit('complete', {
179
+ status: status,
180
+ imgArr: this.imageList
181
+ });
182
+ },
183
+ chooseImage() {
184
+ uni.chooseImage({
185
+ count: this.limit - this.imageList.length,
186
+ sizeType: this.sizeType,
187
+ sourceType: this.sourceType,
188
+ success: (e) => {
189
+ let imageArr = [];
190
+ for (let i = 0; i < e.tempFiles.length; i++) {
191
+ let len = this.imageList.length;
192
+ if (len >= this.limit) {
193
+ this.showToast(`最多可上传${this.limit}张图片`);
194
+ break;
195
+ }
196
+ //过滤图片类型
197
+ let path = e.tempFiles[i].path;
198
+
199
+ if (this.imageFormat.length > 0) {
200
+ let format = '';
201
+ // #ifdef H5
202
+ let type = e.tempFiles[i].type;
203
+ format = type.split('/')[1];
204
+ // #endif
205
+
206
+ // #ifndef H5
207
+ format = path.split('.')[path.split('.').length - 1];
208
+ // #endif
209
+
210
+ if (this.imageFormat.indexOf(format) == -1) {
211
+ let text = `只能上传 ${this.imageFormat.join(',')} 格式图片!`;
212
+ this.showToast(text);
213
+ continue;
214
+ }
215
+ }
216
+
217
+ //过滤超出大小限制图片
218
+ let size = e.tempFiles[i].size;
219
+
220
+ if (this.size * 1024 * 1024 < size) {
221
+ let err = `单张图片大小不能超过:${this.size}MB`;
222
+ this.showToast(err);
223
+ continue;
224
+ }
225
+ imageArr.push(path);
226
+ this.imageList.push(path);
227
+ this.statusArr.push('2');
228
+ }
229
+ // this.change();
230
+
231
+ let start = this.imageList.length - imageArr.length;
232
+ for (let j = 0; j < imageArr.length; j++) {
233
+ let index = start + j;
234
+ //服务器地址
235
+ if (this.serverUrl) {
236
+ this.uploadImage(index, imageArr[j])
237
+ .then(() => {
238
+ this.change();
239
+ })
240
+ .catch(() => {
241
+ this.change();
242
+ });
243
+ } else {
244
+ //无服务器地址则直接返回成功
245
+ this.statusArr[index] = '1';
246
+ this.change();
247
+ }
248
+ }
249
+ }
250
+ });
251
+ },
252
+ // return httpObj.flagPost('API_FILE_FILE_UPLOAD', data)
253
+ uploadImage(index, url) {
254
+ return new Promise((resolve, reject) => {
255
+ uni.uploadFile({
256
+ url: this.serverUrl,
257
+ name: this.fileKeyName,
258
+ header: this.header,
259
+ formData: this.formData,
260
+ filePath: url,
261
+ success: (res) => {
262
+ console.log('上传后处理数据', res);
263
+ if (res.statusCode == 200) {
264
+ //返回结果 此处需要按接口实际返回进行修改
265
+ let d = JSON.parse(res.data.replace(/\ufeff/g, '') || '{}');
266
+ //判断code,以实际接口规范判断
267
+ if (d.code % 100 === 0) {
268
+ // 上传成功 d.url 为上传后图片地址,以实际接口返回为准
269
+ d.url && (this.imageList[index] = d.url);
270
+ this.statusArr[index] = d.url ? '1' : '3';
271
+ } else {
272
+ // 上传失败
273
+ this.statusArr[index] = '3';
274
+ }
275
+ resolve(index);
276
+ } else {
277
+ this.statusArr[index] = '3';
278
+
279
+ reject(index);
280
+ }
281
+ },
282
+ fail: (res) => {
283
+ this.statusArr[index] = '3';
284
+ reject(index);
285
+ }
286
+ });
287
+ });
288
+ },
289
+ delImage(index) {
290
+ this.imageList.splice(index, 1);
291
+ this.statusArr.splice(index, 1);
292
+ this.$emit('remove', {
293
+ index: index
294
+ });
295
+ this.change();
296
+ },
297
+ previewImage(index) {
298
+ if (!this.imageList.length) return;
299
+ uni.previewImage({
300
+ current: this.imageList[index],
301
+ loop: true,
302
+ urls: this.imageList
303
+ });
304
+ }
305
+ }
306
+ };
307
+ </script>
308
+
309
+ <style scoped>
310
+ @font-face {
311
+ font-family: 'fuiUpload';
312
+ src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAATcAA0AAAAAByQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEwAAAABoAAAAciR52BUdERUYAAASgAAAAHgAAAB4AKQALT1MvMgAAAaAAAABCAAAAVjxvR/tjbWFwAAAB+AAAAEUAAAFK5ibpuGdhc3AAAASYAAAACAAAAAj//wADZ2x5ZgAAAkwAAADXAAABAAmNjcZoZWFkAAABMAAAAC8AAAA2FpiS+WhoZWEAAAFgAAAAHQAAACQH3QOFaG10eAAAAeQAAAARAAAAEgwAACBsb2NhAAACQAAAAAwAAAAMAEoAgG1heHAAAAGAAAAAHwAAACABEgA2bmFtZQAAAyQAAAFJAAACiCnmEVVwb3N0AAAEcAAAACgAAAA6OMUs4HjaY2BkYGAAYo3boY/i+W2+MnCzMIDAzb3qdQj6fwPzf+YGIJeDgQkkCgA/KAtvAHjaY2BkYGBu+N/AEMPCAALM/xkYGVABCwBZ4wNrAAAAeNpjYGRgYGBl0GJgZgABJiDmAkIGhv9gPgMADTABSQB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PGJ9xMjf8b2CIYW5gaAAKM4LkANt9C+UAAHjaY2GAABY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font-family: 'fuiUpload' !important;
320
+ font-style: normal;
321
+ -webkit-font-smoothing: antialiased;
322
+ -moz-osx-font-smoothing: grayscale;
323
+ padding: 10rpx;
324
+ }
325
+
326
+ .up-icon-delete:before {
327
+ content: '\e601';
328
+ }
329
+
330
+ .up-icon-plus:before {
331
+ content: '\e609';
332
+ }
333
+
334
+ .up-upload-box {
335
+ width: 100%;
336
+ display: flex;
337
+ flex-wrap: wrap;
338
+ }
339
+
340
+ .up-upload-add {
341
+ /* width: 240rpx;
342
+ height: 240rpx; */
343
+ width: 178rpx;
344
+ height: 178rpx;
345
+ font-size: 68rpx;
346
+ font-weight: 100;
347
+ color: #888;
348
+ /* background-color: #fff; */
349
+ display: flex;
350
+ flex-direction: column;
351
+ align-items: center;
352
+ justify-content: center;
353
+ padding: 0;
354
+ border-radius: 18rpx;
355
+ }
356
+ .add-img {
357
+ width: 60rpx;
358
+ height: 140rpx;
359
+ }
360
+ .del-img {
361
+ width: 36rpx;
362
+ height: 36rpx;
363
+ }
364
+ .up-image-item {
365
+ width: 178rpx;
366
+ height: 178rpx;
367
+ position: relative;
368
+ /* margin-right: 20rpx; */
369
+ margin-right: 10rpx;
370
+ margin-bottom: 20rpx;
371
+ border-radius: 18rpx;
372
+ }
373
+
374
+ .up-image-item:nth-of-type(3n) {
375
+ margin-right: 0;
376
+ }
377
+
378
+ .up-item-img {
379
+ width: 178rpx;
380
+ height: 178rpx;
381
+ display: block;
382
+ border-radius: 18rpx;
383
+ }
384
+
385
+ .up-img-del {
386
+ width: 36rpx;
387
+ height: 36rpx;
388
+ position: absolute;
389
+ right: -12rpx;
390
+ top: -12rpx;
391
+ /* background-color: #333333; */
392
+ border-radius: 50%;
393
+ color: white;
394
+ font-size: 34rpx;
395
+ z-index: 999;
396
+ }
397
+
398
+ /* .up-img-del::before {
399
+ content: '';
400
+ width: 16rpx;
401
+ height: 1px;
402
+ position: absolute;
403
+ left: 10rpx;
404
+ top: 18rpx;
405
+ background-color: #fff;
406
+ } */
407
+
408
+ .up-upload-mask {
409
+ width: 100%;
410
+ height: 100%;
411
+ position: absolute;
412
+ left: 0;
413
+ top: 0;
414
+ display: flex;
415
+ flex-direction: column;
416
+ align-items: center;
417
+ justify-content: space-around;
418
+ padding: 40rpx 0;
419
+ box-sizing: border-box;
420
+ background-color: rgba(0, 0, 0, 0.6);
421
+ }
422
+
423
+ .up-upload-loading {
424
+ width: 28rpx;
425
+ height: 28rpx;
426
+ border-radius: 50%;
427
+ border: 2px solid;
428
+ border-color: #b2b2b2 #b2b2b2 #b2b2b2 #fff;
429
+ animation: up-rotate 0.7s linear infinite;
430
+ }
431
+
432
+ @keyframes up-rotate {
433
+ 0% {
434
+ transform: rotate(0);
435
+ }
436
+
437
+ 100% {
438
+ transform: rotate(360deg);
439
+ }
440
+ }
441
+
442
+ .up-tips {
443
+ font-size: 26rpx;
444
+ color: #fff;
445
+ }
446
+
447
+ .up-mask-btn {
448
+ padding: 4rpx 16rpx;
449
+ border-radius: 40rpx;
450
+ text-align: center;
451
+ font-size: 24rpx;
452
+ color: #fff;
453
+ border: 1rpx solid #fff;
454
+ display: flex;
455
+ align-items: center;
456
+ justify-content: center;
457
+ }
458
+
459
+ .up-btn-hover {
460
+ opacity: 0.8;
461
+ }
462
+ </style>