invitation_Haoyou.vue
2.1 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<template>
<view>
<u-navbar :back-icon-color="'#FFFFFF'" :is-back="true" title="邀请好友" :title-color="'#FFFFFF'" :background="background"></u-navbar>
<view class="invitationContainer flex flexColumn justifyC alignC">
<image :src="erweima" mode="widthFix" :show-menu-by-longpress="true"></image>
<view class="invitationContainerText">保存图片</view>
</view>
<view class="invitationContainerButten" @click="getImage">保存相册</view>
</view>
</template>
<script>
export default {
data() {
return {
background: {
// 渐变色
backgroundImage: 'linear-gradient(135deg, rgba(255, 148, 48, 1) 0%, rgba(254, 206, 51, 1) 100%)'
},
erweima:'/static/evering/ic_18.png'
};
},
methods: {
getImage() {
uni.showToast({
icon: 'loading',
title: '正在保存...'
});
uni.saveImageToPhotosAlbum({
filePath: this.erweima,
success: () => {
console.log('保存成功');
uni.showToast({
icon: 'success',
title: '保存成功'
});
},
fail: () => {
console.log('保存失败');
uni.showToast({
icon: 'error',
title: '保存失败'
});
}
});
},
}
};
</script>
<style>
page {
width: 100%;
height: 100%;
background: linear-gradient(60deg, rgba(255, 148, 48, 1) 0%, rgba(254, 206, 51, 1) 100%);
padding: 0 32rpx;
}
.invitationContainer {
width: 686rpx;
height: 830rpx;
margin-top: 90rpx;
background-image: url(https://s4.ax1x.com/2022/02/08/H15uwQ.png);
background-size: cover;
}
.invitationContainer image {
width: 338rpx;
height: 338rpx;
}
.invitationContainerText {
width: 128rpx;
height: 32rpx;
margin-top: 92rpx;
color: rgba(0, 0, 0, 1);
font-size: 32rpx;
font-weight: 700;
font-family: 'PingFang SC';
text-align: left;
line-height: 32rpx;
}
.invitationContainerButten {
width: 456rpx;
height: 88rpx;
border-radius: 44rpx;
opacity: 1;
color: rgba(255, 149, 49, 1);
font-size: 32rpx;
font-weight: 700;
font-family: 'PingFang SC';
text-align: center;
line-height: 88rpx;
margin: 178rpx auto 0;
background: linear-gradient(135deg, rgba(255, 227, 145, 1) 0%, rgba(255, 223, 124, 1) 100%);
}
</style>