wui-components-v2 1.0.94 → 1.0.96
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.
|
@@ -34,6 +34,9 @@ function handleFileChange(e: any) {
|
|
|
34
34
|
show.value = false
|
|
35
35
|
emit('handleFileChange', e)
|
|
36
36
|
}
|
|
37
|
+
function handleChange(e: any) {
|
|
38
|
+
console.log(e, '文件触发')
|
|
39
|
+
}
|
|
37
40
|
</script>
|
|
38
41
|
|
|
39
42
|
<template>
|
|
@@ -48,7 +51,9 @@ function handleFileChange(e: any) {
|
|
|
48
51
|
custom-class="custom-upload"
|
|
49
52
|
:multiple="true" :accept="fileType"
|
|
50
53
|
:header="{ 'hydrocarbon-program-token': hydrocarbonProgramToken, 'hydrocarbon-token': token }"
|
|
51
|
-
:action="`${action}/v3/upload`"
|
|
54
|
+
:action="`${action}/v3/upload`"
|
|
55
|
+
@success="(e) => { handleFileChange(e) }"
|
|
56
|
+
@change="(e) => { handleChange(e) }"
|
|
52
57
|
>
|
|
53
58
|
<view class="p-t-3">
|
|
54
59
|
<wd-button size="small" type="info" block class="w-200px">
|
|
@@ -9,19 +9,26 @@ const show = ref(false)
|
|
|
9
9
|
const url = ref('')
|
|
10
10
|
defineExpose({
|
|
11
11
|
open: (e: any) => {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
key.value++// 解决视频显示小,延迟渲染
|
|
14
|
+
}, 1000)
|
|
14
15
|
show.value = true
|
|
15
16
|
url.value = e
|
|
16
17
|
},
|
|
17
18
|
})
|
|
19
|
+
function close() {
|
|
20
|
+
uni.createVideoContext('myVideo').pause()
|
|
21
|
+
}
|
|
18
22
|
</script>
|
|
19
23
|
|
|
20
24
|
<template>
|
|
21
|
-
<wd-popup v-model="show" :
|
|
22
|
-
<view
|
|
25
|
+
<wd-popup v-model="show" :hide-when-close="true" @close="close">
|
|
26
|
+
<view class="container">
|
|
23
27
|
<video
|
|
24
|
-
|
|
28
|
+
id="myVideo"
|
|
29
|
+
:key="key"
|
|
30
|
+
class="video-box"
|
|
31
|
+
object-fit="fill"
|
|
25
32
|
:src="url"
|
|
26
33
|
controls
|
|
27
34
|
/>
|
|
@@ -29,6 +36,21 @@ defineExpose({
|
|
|
29
36
|
</wd-popup>
|
|
30
37
|
</template>
|
|
31
38
|
|
|
32
|
-
<style>
|
|
39
|
+
<style scoped>
|
|
40
|
+
.container {
|
|
41
|
+
position: relative;
|
|
42
|
+
width: 300px;
|
|
43
|
+
height: 0;
|
|
44
|
+
/* // 因为 padding 和 margin 等受 width 影响,父容器固定后,子标签可以进行填充。
|
|
45
|
+
// 此处的 56.25% 是 9/16【 75% 是 3/4 】其他比例可以依照此法 */
|
|
46
|
+
padding-bottom: 56.25%;
|
|
33
47
|
|
|
48
|
+
}
|
|
49
|
+
.video-box {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
}
|
|
34
56
|
</style>
|