HomeScan.vue
1.14 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
<template>
<div v-if="type == 2" class="scan2" @click="saoYiSao">
<van-icon name="scan" />
<p class="tishi">基地打卡</p>
</div>
<div v-else class="scan" @click="saoYiSao">
<van-icon name="scan" />
<img class="tishi" src="@/assets/home/tishi.png" alt="扫码打卡" />
</div>
</template>
<script>
export default {
props: ['type'],
methods: {
saoYiSao() {
ZWJSBridge.scan({
type: 'qrCode',
})
.then((res) => {
if(res.qrcode&&!isNaN(Number(res.qrcode))){
this.$router.push({ name: 'MyClassList', query: { qrresult: res.qrcode } })
}else{
this.$toast.fail('扫码失败')
}
})
.catch((err) => {
console.log(err)
})
},
},
}
</script>
<style lang="scss" scoped>
.scan {
position: relative;
// position:absolute;
// right:20px;
// top :20px;
// z-index :100;
color: white;
font-size: 50px;
.tishi {
position: absolute;
left: -90px;
bottom: -30px;
width: 112px;
}
}
.scan2 {
font-size: 50px;
color: #526195;
text-align: center;
.tishi {
font-size: 24px;
}
}
</style>