uview-plus 3.2.21 → 3.2.23
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 +14 -0
- package/components/u-action-sheet/u-action-sheet.vue +1 -2
- package/components/u-cell/u-cell.vue +3 -2
- package/components/u-code/u-code.vue +1 -1
- package/components/u-collapse-item/u-collapse-item.vue +2 -1
- package/components/u-input/u-input.vue +4 -4
- package/components/u-search/u-search.vue +1 -1
- package/components/u-upload/u-upload.vue +14 -1
- package/libs/function/index.js +1 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 3.2.23(2024-05-30)
|
|
2
|
+
fix: #378 H5 u-input 在表单中初始值为空也会触发一次 formValidate(this,"change")事件导致进入页面直接校验了一次
|
|
3
|
+
|
|
4
|
+
fix: #373 搜索组件up-search的@clear事件无效
|
|
5
|
+
|
|
6
|
+
fix: #372 ActionSheet 组件的取消按钮触发区域太小
|
|
7
|
+
|
|
8
|
+
## 3.2.22(2024-05-13)
|
|
9
|
+
上传组件支持微信小程序预览视频
|
|
10
|
+
|
|
11
|
+
修复折叠面板右侧箭头不显示
|
|
12
|
+
|
|
13
|
+
修复uxp2px
|
|
14
|
+
|
|
1
15
|
## 3.2.21(2024-05-10)
|
|
2
16
|
fix: loading-icon修复flex布局
|
|
3
17
|
## 3.2.20(2024-05-10)
|
|
@@ -93,13 +93,12 @@
|
|
|
93
93
|
v-if="cancelText"
|
|
94
94
|
></u-gap>
|
|
95
95
|
<view class="u-action-sheet__item-wrap__item u-action-sheet__cancel"
|
|
96
|
-
hover-class="u-action-sheet--hover">
|
|
96
|
+
hover-class="u-action-sheet--hover" @tap="cancel">
|
|
97
97
|
<text
|
|
98
98
|
@touchmove.stop.prevent
|
|
99
99
|
:hover-stay-time="150"
|
|
100
100
|
v-if="cancelText"
|
|
101
101
|
class="u-action-sheet__cancel-text"
|
|
102
|
-
@tap="cancel"
|
|
103
102
|
>{{cancelText}}</text>
|
|
104
103
|
</view>
|
|
105
104
|
</view>
|
|
@@ -30,9 +30,10 @@
|
|
|
30
30
|
</slot>
|
|
31
31
|
<view class="u-cell__right-icon-wrap" v-if="$slots['right-icon'] || isLink"
|
|
32
32
|
:class="[`u-cell__right-icon-wrap--${arrowDirection}`]">
|
|
33
|
-
<u-icon v-if="rightIcon && !$slots['right-icon']" :name="rightIcon"
|
|
33
|
+
<u-icon v-if="rightIcon && !$slots['right-icon']" :name="rightIcon"
|
|
34
|
+
:custom-style="rightIconStyle" :color="disabled ? '#c8c9cc' : 'info'"
|
|
34
35
|
:size="size === 'large' ? 18 : 16"></u-icon>
|
|
35
|
-
<slot v-else name="right-icon">
|
|
36
|
+
<slot v-else name="right-icon">
|
|
36
37
|
</slot>
|
|
37
38
|
</view>
|
|
38
39
|
<view class="u-cell__right-icon-wrap" v-if="$slots['righticon']"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
if(!this.keepRunning || !this.timer) return
|
|
108
108
|
// 记录当前的时间戳,为了下次进入页面,如果还在倒计时内的话,继续倒计时
|
|
109
109
|
// 倒计时尚未结束,结果大于0;倒计时已经开始,就会小于初始值,如果等于初始值,说明没有开始倒计时,无需处理
|
|
110
|
-
if(this.secNum > 0 && this.secNum
|
|
110
|
+
if(this.secNum > 0 && this.secNum < this.seconds) {
|
|
111
111
|
// 获取当前时间戳(+ new Date()为特殊写法),除以1000变成秒,再去除小数部分
|
|
112
112
|
let nowTimestamp = Math.floor((+ new Date()) / 1000)
|
|
113
113
|
// 将本该结束时候的时间戳保存起来 => 当前时间戳 + 剩余的秒数
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
:arrowDirection="expanded ? 'up' : 'down'"
|
|
13
13
|
:disabled="disabled"
|
|
14
14
|
>
|
|
15
|
-
<!-- 微信小程序不支持,因为微信中不支持 <slot name="title"
|
|
15
|
+
<!-- 微信小程序不支持,因为微信中不支持 <slot name="title" #title />的写法 -->
|
|
16
16
|
<template #title>
|
|
17
17
|
<slot name="title">
|
|
18
18
|
<text v-if="!$slots.title && title">
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
</slot>
|
|
34
34
|
</template>
|
|
35
35
|
<template #right-icon>
|
|
36
|
+
<u-icon v-if="!$slots['right-icon']" :size="16" name="arrow-right"></u-icon>
|
|
36
37
|
<slot name="right-icon">
|
|
37
38
|
</slot>
|
|
38
39
|
</template>
|
|
@@ -154,8 +154,8 @@ export default {
|
|
|
154
154
|
) {
|
|
155
155
|
this.valueChange();
|
|
156
156
|
} else {
|
|
157
|
-
// 尝试调用
|
|
158
|
-
|
|
157
|
+
// 尝试调用up-form的验证方法
|
|
158
|
+
if(!this.firstChange) formValidate(this, "change");
|
|
159
159
|
}
|
|
160
160
|
/* #endif */
|
|
161
161
|
this.firstChange = false;
|
|
@@ -177,8 +177,8 @@ export default {
|
|
|
177
177
|
) {
|
|
178
178
|
this.valueChange();
|
|
179
179
|
} else {
|
|
180
|
-
// 尝试调用
|
|
181
|
-
|
|
180
|
+
// 尝试调用up-form的验证方法
|
|
181
|
+
if(!this.firstChange) formValidate(this, "change");
|
|
182
182
|
}
|
|
183
183
|
/* #endif */
|
|
184
184
|
this.firstChange = false;
|
|
@@ -21,13 +21,16 @@
|
|
|
21
21
|
<view
|
|
22
22
|
v-else
|
|
23
23
|
class="u-upload__wrap__preview__other"
|
|
24
|
+
@tap="onClickPreview($event, item)"
|
|
24
25
|
>
|
|
25
26
|
<u-icon
|
|
26
27
|
color="#80CBF9"
|
|
27
28
|
size="26"
|
|
28
29
|
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
|
|
29
30
|
></u-icon>
|
|
30
|
-
<text class="u-upload__wrap__preview__other__text">
|
|
31
|
+
<text class="u-upload__wrap__preview__other__text">
|
|
32
|
+
{{item.isVideo || (item.type && item.type === 'video') ? '视频' : '文件'}}
|
|
33
|
+
</text>
|
|
31
34
|
</view>
|
|
32
35
|
<view
|
|
33
36
|
class="u-upload__status"
|
|
@@ -335,6 +338,7 @@
|
|
|
335
338
|
const {
|
|
336
339
|
lists
|
|
337
340
|
} = this.data;
|
|
341
|
+
// #ifdef MP-WEIXIN
|
|
338
342
|
wx.previewMedia({
|
|
339
343
|
sources: lists
|
|
340
344
|
.filter((item) => isVideoFile(item))
|
|
@@ -348,12 +352,21 @@
|
|
|
348
352
|
toast('预览视频失败')
|
|
349
353
|
},
|
|
350
354
|
});
|
|
355
|
+
// #endif
|
|
351
356
|
},
|
|
352
357
|
onClickPreview(event) {
|
|
353
358
|
const {
|
|
354
359
|
index
|
|
355
360
|
} = event.currentTarget.dataset;
|
|
356
361
|
const item = this.data.lists[index];
|
|
362
|
+
if (!this.data.previewFullImage) return;
|
|
363
|
+
switch (item.type) {
|
|
364
|
+
case 'video':
|
|
365
|
+
this.onPreviewVideo(event);
|
|
366
|
+
break;
|
|
367
|
+
default:
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
357
370
|
this.$emit(
|
|
358
371
|
'clickPreview',
|
|
359
372
|
Object.assign(Object.assign({}, item), this.getDetail(index))
|
package/libs/function/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export function getPx(value, unit = false) {
|
|
|
27
27
|
}
|
|
28
28
|
// 如果带有rpx,先取出其数值部分,再转为px值
|
|
29
29
|
if (/(rpx|upx)$/.test(value)) {
|
|
30
|
-
return unit ? `${uni.
|
|
30
|
+
return unit ? `${uni.upx2px(parseInt(value))}px` : Number(uni.upx2px(parseInt(value)))
|
|
31
31
|
}
|
|
32
32
|
return unit ? `${parseInt(value)}px` : parseInt(value)
|
|
33
33
|
}
|