MediaComponent.vue
2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!--
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Date: 2024-11-22 20:45:03
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-05-19 15:15:22
* @FilePath: \gl-tape\pages\equity\detail\components\MediaComponent.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<view class="layout">
<wnCanvas
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
custom
@scale="$emit('scale', $event)"
ref="canvasRef"
>
<template slot="customContent">
<view class="layout-content">
<page-title
:title="title"
:hasCarBrand="hasCarBrand"
:show="show"
/>
<template v-if="hasCarBrand">
<image
:key="viewKey"
class="content"
:src="views[customerInfo.carModelId] || require('@/assets/images/media/nothing.webp')"
/>
</template>
<template v-else>
<template v-if="views">
<image
v-if="views.detailUrl"
class="content"
:src="views.detailUrl"
/>
<!-- <image
v-if="views.bgUrl"
class="bg"
:src="views.bgUrl"
/> -->
</template>
</template>
</view>
</template>
</wnCanvas>
</view>
</template>
<script type="text/ecmascript-6">
import PageTitle from './PageTitle.vue'
export default {
props: {
views: [Array, Object],
penSwitch: Boolean,
title: String,
madiaId: Number,
isByd: Boolean,
show: Boolean,
hasCarBrand: Boolean
},
components: {
PageTitle
},
name: 'MediaComponent',
data () {
return {
}
},
watch: {
},
computed: {
customerInfo () {
return this.$store.state.user.customerInfo
},
viewKey () {
return this.$store.state.user.viewKey
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
.layout {
width: 100%;
height: 100%;
&-content {
height: 100%;
position: relative;
margin: $margin;
}
.content {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
.bg {
width: 100vw;
height: 100vh;
position: fixed;
left: 0;
top: 0;
}
}
</style>