HomeScan.vue
1.71 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
<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 () {
let isLogin = this.checkLogin()
if (!isLogin) return;
if (process.env.NODE_ENV === "production" && this.common.isWeiXin()) {
// location.href = `http://sao315.com/w/api/saoyisao?redirect_uri=https://zlyx.shunzhi.net/wap/index.html%23/MyClassList`;
location.href = `http://sao315.com/w/api/saoyisao?redirect_uri=https://zlyx.shunzhi.net/wap/index.html%23/MyClassList`;
} else {
this.$router.push({ name: 'MyClassList', query: { qrresult: '188' } })
}
},
// 判断是否已登录
checkLogin () {
if (process.env.NODE_ENV != "production") return true;
const userInfo = JSON.parse(localStorage.getItem('userInfo'))
if (!userInfo?.phone) {
localStorage.setItem('prePage', 'Home');
localStorage.setItem('prePageQuery', JSON.stringify({ showTab: this.$route.query.showTab }));
this.$router.push({ name: 'LoginPublic' })
return false;
}
return true;
},
}
}
</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>