download-bottom.vue
1.45 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
<template>
<a v-if="visible" class="openapp-btn hover-opacity" href="javascript:;" @click="toDownloadPage">
<span class="avatar-block">
<div class="avatar"></div>
</span>
在App中查看
<i class="iconfont mg"></i>
</a>
</template>
<script>
export default {
data() {
return {
visible: true
};
},
async mounted() {
let isHide = await this.isDownloadBarHide();
if (isHide) {
this.visible = false;
}
},
methods: {
toDownloadPage() {
if (this.$yoho.isAndroid && (this.$yoho.isWechat || this.$yoho.isMobileQQ)) {
this.openByBrowser();
} else {
this.$openApp();
}
}
}
};
</script>
<style lang="scss" scoped>
.openapp-btn {
width: 320px;
height: 80px;
border-radius: 10px;
font-size: 30px;
color: #fff;
background: #d0021b;
position: absolute;
bottom: 120px;
left: calc(50% - 160px);
z-index: 100;
display: flex;
align-items: center;
transition: all 600ms ease-in-out;
&.scroll-opacity {
opacity: 0.3;
}
.avatar-block {
width: 60px;
height: 60px;
margin: 10px 25px 10px 10px;
overflow: hidden;
}
.avatar {
display: block;
width: 100%;
height: 100%;
background-image: url("~statics/image/common/app.png");
background-size: 100% 100%;
}
.mg {
margin-left: 10px;
font-size: 30px;
}
}
</style>