uview-plus 3.4.6 → 3.4.8
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
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script>
|
|
30
|
-
import {mapState} from 'vuex';
|
|
31
30
|
export default {
|
|
32
31
|
props: {
|
|
33
32
|
modelValue: {
|
|
@@ -73,6 +72,15 @@ export default {
|
|
|
73
72
|
}
|
|
74
73
|
},
|
|
75
74
|
emits: ['update:modelValue'],
|
|
75
|
+
watch: {
|
|
76
|
+
modelValue() {
|
|
77
|
+
this.options.forEach((ele) => {
|
|
78
|
+
if (ele[this.valueKey] == this.modelValue) {
|
|
79
|
+
this.current = ele[this.labelKey]
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
},
|
|
76
84
|
methods: {
|
|
77
85
|
hideKeyboard() {
|
|
78
86
|
uni.hideKeyboard()
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
-
import {mapState} from 'vuex';
|
|
28
27
|
export default {
|
|
29
28
|
props: {
|
|
30
29
|
modelValue: {
|
|
@@ -69,6 +68,17 @@ export default {
|
|
|
69
68
|
})
|
|
70
69
|
}
|
|
71
70
|
},
|
|
71
|
+
watch: {
|
|
72
|
+
modelValue() {
|
|
73
|
+
if (this.modelValue) {
|
|
74
|
+
this.options.forEach((ele) => {
|
|
75
|
+
if (ele[this.valueKey] == this.modelValue) {
|
|
76
|
+
this.current = ele[this.labelKey]
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
72
82
|
computed: {
|
|
73
83
|
optionsInner() {
|
|
74
84
|
return [this.options];
|
|
@@ -18,9 +18,14 @@
|
|
|
18
18
|
height: addUnit(height)
|
|
19
19
|
}]"
|
|
20
20
|
/>
|
|
21
|
-
<
|
|
21
|
+
<view class="u-upload__wrap__preview__video"
|
|
22
|
+
:style="{
|
|
23
|
+
width: addUnit(width),
|
|
24
|
+
height: addUnit(height)
|
|
25
|
+
}"
|
|
22
26
|
v-else-if="(item.isVideo || (item.type && item.type === 'video')) && getVideoThumb">
|
|
23
27
|
<image
|
|
28
|
+
v-if="item.thumb"
|
|
24
29
|
:src="item.thumb"
|
|
25
30
|
:mode="imageMode"
|
|
26
31
|
class="u-upload__wrap__preview__image"
|
|
@@ -30,6 +35,12 @@
|
|
|
30
35
|
height: addUnit(height)
|
|
31
36
|
}]"
|
|
32
37
|
/>
|
|
38
|
+
<u-icon
|
|
39
|
+
v-else
|
|
40
|
+
color="#80CBF9"
|
|
41
|
+
size="26"
|
|
42
|
+
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
|
|
43
|
+
></u-icon>
|
|
33
44
|
<view v-if="item.status === 'success'"
|
|
34
45
|
class="u-upload__wrap__play"
|
|
35
46
|
@tap="onPreviewVideo(item, index)">
|
|
@@ -38,7 +49,7 @@
|
|
|
38
49
|
class="u-upload__wrap__play__icon"
|
|
39
50
|
name="play-right" size="22px"></up-icon>
|
|
40
51
|
</view>
|
|
41
|
-
</
|
|
52
|
+
</view>
|
|
42
53
|
<view
|
|
43
54
|
v-else
|
|
44
55
|
class="u-upload__wrap__preview__other"
|
|
@@ -721,6 +732,7 @@
|
|
|
721
732
|
height: $u-upload-image-height;
|
|
722
733
|
}
|
|
723
734
|
|
|
735
|
+
&__video,
|
|
724
736
|
&__other {
|
|
725
737
|
width: $u-upload-image-width;
|
|
726
738
|
height: $u-upload-image-height;
|
|
@@ -23,13 +23,13 @@ function formatImage(res) {
|
|
|
23
23
|
file: item
|
|
24
24
|
// #endif
|
|
25
25
|
// #ifndef H5
|
|
26
|
-
name:
|
|
26
|
+
name: item.tempFilePath.split('/').pop() + '.png',
|
|
27
27
|
// #endif
|
|
28
28
|
}))
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function formatVideo(res) {
|
|
32
|
-
console.log(res)
|
|
32
|
+
// console.log(res)
|
|
33
33
|
return [
|
|
34
34
|
{
|
|
35
35
|
...pickExclude(res, ['tempFilePath', 'thumbTempFilePath', 'errMsg']),
|
|
@@ -61,7 +61,7 @@ function formatMedia(res) {
|
|
|
61
61
|
file: item
|
|
62
62
|
// #endif
|
|
63
63
|
// #ifndef H5
|
|
64
|
-
name:
|
|
64
|
+
name: item.tempFilePath.split('/').pop() + (res.type === 'video' ? '.mp4': '.png'),
|
|
65
65
|
// #endif
|
|
66
66
|
}))
|
|
67
67
|
}
|