share.vue
1.2 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
<template>
<view>
<view class="page-content">
<image mode="widthFix" :src="src"></image>
</view>
<view class="page-tabbar">
<view class="page-tabbar-tip red" @click="save">保存海报去分享</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
src: 'https://img2.ydniu.com/app/cd/202204122204/%E5%BF%AB%E4%B9%908%E5%9F%BA%E6%9C%AC%E8%B5%B0%E5%8A%BF%E5%9B%BE.png'
}
},
async onLoad(e) {},
methods: {
save() {
//#ifdef H5
try {
if (Android) {
Android.save2Album(this.src)
}
} catch (e) {
const $h5 = require('@/static/js/h5-utils.js')
$h5.downloadIamge(this.src)
}
//#endif
}
}
}
</script>
<style scoped>
.page-content {
width: 80vw;
padding: 10px 5vw 44px 5vw;
}
.page-content image {
width: 90vw;
}
.page-tabbar {
display: flex;
position: fixed;
bottom: 0;
width: 100%;
height: 44px;
background-color: #F8F8F8;
justify-content: space-around;
font-size: 16px;
color: #333333;
}
.page-tabbar-tip {
width: 33vw;
height: 44px;
line-height: 44px;
text-align: center;
color: #E34439;
}
</style>