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 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
 
@@ -5,7 +5,11 @@ export const props = defineMixin({
5
5
  // 是否显示input
6
6
  hasInput: {
7
7
  type: Boolean,
8
- default: () => false
8
+ default: false
9
+ },
10
+ inputBorder: {
11
+ type: String,
12
+ default: 'surround'
9
13
  },
10
14
  disabled: {
11
15
  type: Boolean,
@@ -7,7 +7,7 @@
7
7
  <up-input
8
8
  :placeholder="placeholder"
9
9
  :readonly="!!showByClickInput"
10
- border="surround"
10
+ :border="inputBorder"
11
11
  v-model="inputValue"
12
12
  :disabled="disabled"
13
13
  :disabledColor="disabledColor"
@@ -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
  },
@@ -14,7 +14,7 @@ export default {
14
14
  cancelText: '取消',
15
15
  confirmText: '确认',
16
16
  cancelColor: '#909193',
17
- confirmColor: '#3c9cff',
17
+ confirmColor: '',
18
18
  title: ''
19
19
  }
20
20
 
@@ -106,6 +106,7 @@
106
106
  color: $u-main-color;
107
107
  padding: 0 60rpx;
108
108
  font-size: 16px;
109
+ font-weight: bold;
109
110
  flex: 1;
110
111
  text-align: center;
111
112
  }
@@ -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' : 'folder'"
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
- Object.assign(Object.assign({}, item), {
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(item.url || item.thumb),
334
- isVideo: this.accept === 'video' || test.video(item.url || item.thumb),
335
- deletable: typeof(item.deletable) === 'boolean' ? item.deletable : this.deletable,
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(file);
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
- status: 'uploading',
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
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
- "version": "3.4.20",
5
+ "version": "3.4.22",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水。",
7
7
  "keywords": [
8
8
  "uview",