QrBox.vue
2.62 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
<template>
<uni-popup
ref="qr"
type="center"
:is-mask-click="false"
animation
class="qrPopup"
>
<view class="box">
<view
class="icon-close-box flex"
@click="close"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
<view class="content flex">
<view class="title flex">
<view class="sprite-icon icon-scan"></view>
请让客户扫码领取
</view>
<template v-if="received">
<view class="received flex">
<view class="sprite-icon icon-qr-success"></view>
<view class="received-title">客户领券成功</view>
<view class="received-text">车主已领取该礼券,请前往客户邀约列表查看</view>
</view>
</template>
<template v-else>
<view class="qr-box">
<image :src="url" />
</view>
</template>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'QRBox',
props: {
url: {
type: String,
default: '',
},
received: Boolean
},
data () {
return {
}
},
mounted () {
},
methods: {
open () {
this.$refs.qr.open();
},
close () {
this.$refs.qr.close();
this.$emit('close')
},
}
}
</script>
<style scoped lang='scss'>
.qrPopup {
z-index: 99 !important;
}
.box {
width: 1040rpx;
height: 800rpx;
background: #ffffff;
border-radius: 48rpx;
position: relative;
.icon-close-box {
position: absolute;
padding: 48rpx;
top: 0;
right: 0;
}
.content {
flex-direction: column;
.title {
padding: 80rpx 0 48rpx;
font-weight: 500;
font-size: 32rpx;
color: #333333;
.sprite-icon{
margin-right: 12rpx;
}
}
.qr-box {
width: 560rpx;
height: 560rpx;
background: #ffffff;
box-shadow: 0 0 24rpx 0 #0000001a;
border-radius: 32rpx;
padding: 40rpx;
box-sizing: border-box;
image {
width: 100%;
height: 100%;
vertical-align: top;
}
}
.received {
width: 560rpx;
height: 560rpx;
background: #f9f9f9;
border-radius: 32rpx;
flex-direction: column;
justify-content: center;
&-title {
font-weight: 500;
font-size: 28rpx;
color: #333333;
margin: 16rpx 0 48rpx;
}
&-text {
font-size: 28rpx;
color: #666666;
margin: 0 56rpx;
}
}
}
}
</style>