HomeScan.vue
909 Bytes
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
<template>
<div class="scan" @click="saoYiSao">
<van-icon name="scan" />
<img class="tishi" src="@/assets/home/tishi.png" alt="扫码打卡">
</div>
</template>
<script>
export default {
methods: {
saoYiSao () {
ZWJSBridge.scan({
"type": "qrCode"
}).then(res => {
console.log(res)
const qrcode = res.text
if(qrcode.length>10){
this.$toast.fail('请扫描正确的基地码')
return;
}
this.$router.push({ name: 'MyClassList', query: { qrresult: res.text } })
}).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;
}
}
</style>