codeyaoqing.vue
3.8 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<template>
<view class='content'>
<!-- 推广码弹层 -->
<view class="yaocode">
<view class="yaocodeimg">
<image src="../../static/codeyaoqing.png" mode=""></image>
<view class="codebox">
<view class="codetext">您的专属邀请码</view>
<view class='codenumber'>{{share_number}}</view>
<view class="copybtn" @click="copy">点击复制</view>
<view class='codezhuan'>“赶快发送邀请码给朋友们,一起赚钱吧”</view>
<view class="codeimgk" @longtap="previewimg">
<image :src="img" mode=""></image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
showbanben: false,
share_number:'',
img:'../../static/codeimg.png',
imgarr:["../../static/codeimg.png"],
downloadarr:["下载App"]
}
},
onLoad() {
this.getuserinfo()
},
methods: {
// 预览二维码
previewimg(){
let that=this;
uni.previewImage({
urls: that.imgarr,
longPressActions: {
itemList: that.downloadarr,
success: function (res) {
console.log(res);
plus.runtime.openURL("http://zhongmian.w.brotop.cn/index/index/download")
},
fail: function (res) {
console.log(res.errMsg);
}
}
});
},
// 获取用户信息
getuserinfo() {
let that = this;
var url = 'member/index';
var params = {
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
that.share_number=res.data.data.share_number
}).catch((err) => {
console.log(err)
if(err.msg="用户未登录"){
that.isuser=1
}
console.log('我是userusesue',that.isuser)
})
},
// 复制粘贴功能
copy(){
let that=this;
uni.setClipboardData({
data:that.share_number,//要被复制的内容
success:()=>{//复制成功的回调函数
uni.showToast({//提示
title:'复制成功'
})
}
});
}
}
}
</script>
<style>
page{
width:100%;
height:100%;
}
.content{
width:100%;
height:100%;
}
.yaocode{
width:100%;
height:100%;
}
.yaocodeimg{
width:100%;
height:100%;
font-size: 0;
position: relative;
}
.codeimgk{
width:230rpx;
height:230rpx;
font-size: 0;
margin:25rpx auto 0;
}
.codeimgk image{
width:100%;
height:100%;
}
.yaocodeimg image{
width:100%;
height:100%
}
.codebox{
width:500rpx;
position: absolute;
top:470rpx;
left:50%;
transform: translateX(-50%);
}
.codetext{
color:#794B10;
font-size: 28rpx;
text-align: center;
}
.codenumber{
color:#6F4105;
font-size: 80rpx;
font-weight: bold;
text-align: center;
margin-top:24rpx;
}
.copybtn{
width:374rpx;
height:80rpx;
line-height: 80rpx;
background:linear-gradient(123deg,rgba(255,136,0,1) 0%,rgba(255,84,0,1) 100%);
box-shadow:0rpx 26rpx 42rpx 0rpx rgba(255,108,0,0.3);
border-radius:40rpx;
color:#fff;
font-size:32rpx ;
text-align: center;
margin:90rpx auto 0;
}
.codezhuan{
color:#6F4105;
font-size: 28rpx;
text-align: center;
margin-top:72rpx
}
</style>