uview-plus 3.4.20 → 3.4.22
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/changelog.md +26 -0
- package/components/u-datetime-picker/props.js +5 -1
- package/components/u-datetime-picker/u-datetime-picker.vue +1 -1
- package/components/u-float-button/u-float-button.vue +1 -1
- package/components/u-select/u-select.vue +6 -1
- package/components/u-subsection/u-subsection.vue +3 -2
- package/components/u-toolbar/toolbar.js +1 -1
- package/components/u-toolbar/u-toolbar.vue +1 -0
- package/components/u-upload/u-upload.vue +19 -13
- package/components/u-upload/utils.js +5 -0
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## 3.4.22(2025-04-22)
|
|
2
|
+
fix: 修复自动上传偶发的success被覆盖为uploading
|
|
3
|
+
|
|
4
|
+
fix: float-button缺少key #677
|
|
5
|
+
|
|
6
|
+
fix: upload组件完善优化(感谢@semdy)
|
|
7
|
+
|
|
8
|
+
fix: toolbar组件confirmColor属性默认改为空,以便默认使用主题色、标题字体加粗(感谢@semdy)
|
|
9
|
+
|
|
10
|
+
## 3.4.21(2025-04-21)
|
|
11
|
+
feat: subsection分段器支持双向绑定current
|
|
12
|
+
|
|
13
|
+
feat: select组件支持maxHeight属性
|
|
14
|
+
|
|
15
|
+
feat: datetime-picker支持inputBorder属性
|
|
16
|
+
|
|
17
|
+
## 3.4.20(2025-04-17)
|
|
18
|
+
fix: 修复navbar-mini提示border不存在
|
|
19
|
+
|
|
20
|
+
feat: status-bar支持对外暴露状态栏高度值
|
|
21
|
+
|
|
22
|
+
feat: upload支持自定义自动上传后处理逻辑便于对接不同规范后端
|
|
23
|
+
|
|
24
|
+
feat: 优化tag组件插槽
|
|
25
|
+
|
|
26
|
+
|
|
1
27
|
## 3.4.19(2025-04-14)
|
|
2
28
|
fix: 修复model组件增加contentStyle带来的语法问题
|
|
3
29
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
bottom: height
|
|
26
26
|
}">
|
|
27
27
|
<slot name="list">
|
|
28
|
-
<template v-for="item in list">
|
|
28
|
+
<template :key="index" v-for="(item, index) in list">
|
|
29
29
|
<view class="u-float-button__item" :style="{
|
|
30
30
|
backgroundColor: item?.backgroundColor ? item?.backgroundColor : backgroundColor,
|
|
31
31
|
color: item?.color ? item?.color : color,
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
:duration="duration + 50"
|
|
23
23
|
:customStyle="overlayStyle"
|
|
24
24
|
:opacity="overlayOpacity"
|
|
25
|
+
@touchmove.stop.prevent="noop"
|
|
25
26
|
></u-overlay>
|
|
26
27
|
<view class="u-select__options__wrap"
|
|
27
|
-
:style="{ zIndex: zIndex + 1, left: optionsWrapLeft, right: optionsWrapRight }">
|
|
28
|
+
:style="{ overflowY: 'auto', zIndex: zIndex + 1, left: optionsWrapLeft, right: optionsWrapRight, maxHeight: maxHeight}">
|
|
28
29
|
<view class="u-select__options" v-if="isOpen">
|
|
29
30
|
<slot name="options">
|
|
30
31
|
<view class="u-select__options_item"
|
|
@@ -50,6 +51,10 @@ export default {
|
|
|
50
51
|
name:"up-select",
|
|
51
52
|
emits: ['update:current', 'select'],
|
|
52
53
|
props: {
|
|
54
|
+
maxHeight: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: '90vh'
|
|
57
|
+
},
|
|
53
58
|
overlay: {
|
|
54
59
|
type: Boolean,
|
|
55
60
|
default: true
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
189
189
|
beforeUnmount() {
|
|
190
190
|
uni.offWindowResize(this.windowResizeCallback)
|
|
191
191
|
},
|
|
192
|
-
emits: ["change"],
|
|
192
|
+
emits: ["change", "update:current"],
|
|
193
193
|
methods: {
|
|
194
194
|
addStyle,
|
|
195
195
|
init() {
|
|
@@ -217,7 +217,8 @@ export default {
|
|
|
217
217
|
// #endif
|
|
218
218
|
},
|
|
219
219
|
clickHandler(index) {
|
|
220
|
-
this.innerCurrent = index
|
|
220
|
+
this.innerCurrent = index;
|
|
221
|
+
this.$emit('update:current', index);
|
|
221
222
|
this.$emit("change", index);
|
|
222
223
|
},
|
|
223
224
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
v-else
|
|
40
40
|
color="#80CBF9"
|
|
41
41
|
size="26"
|
|
42
|
-
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : '
|
|
42
|
+
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'file-text'"
|
|
43
43
|
></u-icon>
|
|
44
44
|
<view v-if="item.status === 'success'"
|
|
45
45
|
class="u-upload__wrap__play"
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
v-else
|
|
55
55
|
class="u-upload__wrap__preview__other"
|
|
56
56
|
@tap="onClickPreview(item, index)"
|
|
57
|
+
:style="[{
|
|
58
|
+
width: addUnit(width),
|
|
59
|
+
height: addUnit(height)
|
|
60
|
+
}]"
|
|
57
61
|
>
|
|
58
62
|
<u-icon
|
|
59
63
|
color="#80CBF9"
|
|
@@ -61,7 +65,7 @@
|
|
|
61
65
|
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
|
|
62
66
|
></u-icon>
|
|
63
67
|
<text class="u-upload__wrap__preview__other__text">
|
|
64
|
-
{{item.isVideo || (item.type && item.type === 'video') ? '视频' : '文件'}}
|
|
68
|
+
{{item.isVideo || (item.type && item.type === 'video') ? item.name || '视频' : item.name || '文件'}}
|
|
65
69
|
</text>
|
|
66
70
|
</view>
|
|
67
71
|
<view
|
|
@@ -78,7 +82,6 @@
|
|
|
78
82
|
<u-loading-icon
|
|
79
83
|
size="22"
|
|
80
84
|
mode="circle"
|
|
81
|
-
color="#ffffff"
|
|
82
85
|
v-else
|
|
83
86
|
/>
|
|
84
87
|
</view>
|
|
@@ -327,18 +330,19 @@
|
|
|
327
330
|
const {
|
|
328
331
|
fileList = [], maxCount
|
|
329
332
|
} = this;
|
|
330
|
-
const lists = fileList.map((item) =>
|
|
331
|
-
|
|
333
|
+
const lists = fileList.map((item) => {
|
|
334
|
+
const name = item.name || item.url || item.thumb
|
|
335
|
+
return Object.assign(Object.assign({}, item), {
|
|
332
336
|
// 如果item.url为本地选择的blob文件的话,无法判断其为video还是image,此处优先通过accept做判断处理
|
|
333
|
-
isImage: this.accept === 'image' || test.image(
|
|
334
|
-
isVideo: this.accept === 'video' || test.video(
|
|
335
|
-
deletable: typeof
|
|
337
|
+
isImage: name ? test.image(name) : (this.accept === 'image' || test.image(name)),
|
|
338
|
+
isVideo: name ? test.video(name) : (this.accept === 'video' || test.video(name)),
|
|
339
|
+
deletable: typeof item.deletable === 'boolean' ? item.deletable : this.deletable,
|
|
336
340
|
})
|
|
337
|
-
);
|
|
341
|
+
});
|
|
338
342
|
this.lists = lists
|
|
339
343
|
this.isInCount = lists.length < maxCount
|
|
340
344
|
},
|
|
341
|
-
chooseFile() {
|
|
345
|
+
chooseFile(params) {
|
|
342
346
|
const {
|
|
343
347
|
maxCount,
|
|
344
348
|
multiple,
|
|
@@ -358,13 +362,14 @@
|
|
|
358
362
|
accept: this.accept,
|
|
359
363
|
extension: this.extension,
|
|
360
364
|
multiple: this.multiple,
|
|
361
|
-
capture: capture,
|
|
365
|
+
capture: this.capture,
|
|
362
366
|
compressed: this.compressed,
|
|
363
367
|
maxDuration: this.maxDuration,
|
|
364
368
|
sizeType: this.sizeType,
|
|
365
369
|
camera: this.camera,
|
|
366
370
|
}, {
|
|
367
371
|
maxCount: maxCount - lists.length,
|
|
372
|
+
...params
|
|
368
373
|
})
|
|
369
374
|
)
|
|
370
375
|
.then((res) => {
|
|
@@ -406,7 +411,7 @@
|
|
|
406
411
|
if (test.promise(res)) {
|
|
407
412
|
res.then((data) => this.onAfterRead(data || file));
|
|
408
413
|
} else {
|
|
409
|
-
this.onAfterRead(
|
|
414
|
+
this.onAfterRead(res);
|
|
410
415
|
}
|
|
411
416
|
},
|
|
412
417
|
getDetail(index) {
|
|
@@ -587,7 +592,8 @@
|
|
|
587
592
|
let item = this.fileList[index];
|
|
588
593
|
this.fileList.splice(index, 1, {
|
|
589
594
|
...item,
|
|
590
|
-
|
|
595
|
+
// 注意这里不判断会出现succcessUpload先执行又被覆盖的问题
|
|
596
|
+
status: param.progress == 100 ? 'success' : 'uploading',
|
|
591
597
|
message: '',
|
|
592
598
|
progress: param.progress
|
|
593
599
|
});
|
|
@@ -89,6 +89,11 @@ export function chooseFile({
|
|
|
89
89
|
maxCount,
|
|
90
90
|
extension
|
|
91
91
|
}) {
|
|
92
|
+
try {
|
|
93
|
+
capture = test.array(capture) ? capture : capture.split(',');
|
|
94
|
+
} catch(e) {
|
|
95
|
+
capture = [];
|
|
96
|
+
}
|
|
92
97
|
return new Promise((resolve, reject) => {
|
|
93
98
|
switch (accept) {
|
|
94
99
|
case 'image':
|
package/package.json
CHANGED