PaperDialog.vue
3.39 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<template>
<van-overlay
:show="show"
@click="$emit('update:value', false)"
z-index="99"
:lock-scroll="false"
>
<div class="image-wrapper">
<div
class="image-close"
@click="$emit('update:value', false)"
>
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/close.png">
</div>
<template v-if="data.text && data.pushType == 5">
<div
class="text-box"
@click.stop
>
<div class="text-title flex">文字喜报</div>
<div
class="content"
v-html="data.text"
ref="textBox"
>
</div>
<van-button
block
round
color="#3975C6"
class="btn"
@click="$emit('update:value', false)"
>确定</van-button>
</div>
</template>
<template v-else>
<div
class="image-box"
@click.stop
>
<img :src="data.fileUrl" />
</div>
<div
class="image-tips flex"
@click.stop
>
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/longtap.png">
长按图片保存
</div>
</template>
</div>
</van-overlay>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'PaperDialog',
props: {
value: Boolean,
data: Object
},
data () {
return {
show: false
}
},
watch: {
value (n) {
this.show = n
if (n && this.data.pushType == 5) this.$nextTick(() => {
this.$refs.textBox.scrollTop = 0
})
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.image-wrapper {
user-select: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.image-close {
position: absolute;
width: 28px;
height: 28px;
right: 0;
top: -44px;
}
.image-box {
width: 279px;
height: 400px;
// max-height: 454px;
background: #ffffff;
border-radius: 6px 6px 0 0;
padding: 16px;
box-sizing: border-box;
overflow-y: scroll;
img {
height: auto;
// object-fit: contain;
}
}
.image-tips {
width: 279px;
height: 45px;
background: #f7f8fa;
border-radius: 0 0 6px 6px;
justify-content: center;
font-weight: 500;
font-size: 16px;
color: #3975c6;
transform: translateY(-1px);
img {
margin-right: 6px;
width: 20px;
height: 20px;
}
}
.text-box {
background-color: #fff;
width: 279px;
max-height: 457px;
background: #ffffff;
border-radius: 6px;
box-sizing: border-box;
padding-bottom: 20px;
.text-title {
font-weight: 500;
font-size: 16px;
color: #282829;
height: 52px;
justify-content: center;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
}
.content {
user-select: text;
padding: 16px;
box-sizing: border-box;
max-height: 320px;
overflow-y: scroll;
font-size: 14px;
line-height: 24px;
color: #666666ff;
word-break: break-all;
white-space: pre-wrap;
}
.btn {
width: 247px !important;
margin: 24px auto 0;
height: 40px;
background: #3975c6;
border-radius: 21px;
font-weight: 600;
font-size: 16px;
letter-spacing: 1px;
}
}
}
</style>