34
34
</button >
35
35
</view >
36
36
<view class =" func" v-if =" num <= 0" >
37
+ <button plain class =" func-btn error" v-if =" coverDetail.inviteLockNum > 0" >
38
+ <image src =" /static/share.png" mode =" " class =" func-btn-img" ></image >
39
+ 邀请好友情况({{lockEdInfo.inviteLockNum}}/{{coverDetail.inviteLockNum}})
40
+ </button >
41
+ <button plain class =" func-btn error" v-if =" coverDetail.lookVideoLockNum > 0" >
42
+ <image src =" /static/video.png" mode =" " class =" func-btn-img" ></image >
43
+ 观看视频情况({{lockEdInfo.lookVideoLockNum}}/{{coverDetail.lookVideoLockNum}})
44
+ </button >
37
45
<button plain class =" func-btn error" >
38
- 该封面已被领完
46
+ 抱歉, 该封面已被领完
39
47
</button >
40
48
</view >
41
49
<view class =" recommand" v-if =" modalShow" >更多封面👇👇👇</view >
42
50
<ad-custom :unit-id =" ad.three" v-if =" ad.three" ></ad-custom >
43
51
<ad :unit-id =" ad.four" ad-type =" video" ad-theme =" white" v-if =" ad.four" ></ad >
44
- <view class =" modal" @touchmove.stop =" handle" @click =" closeModal" v-if =" modalShow" >
52
+ <view class =" modal func " @touchmove.stop =" handle" @click =" closeModal" v-if =" modalShow" >
45
53
<view class =" modal-content" @click.stop =" openModal" >
46
54
<view class =" modal-content-body" >
47
55
<view class =" modal-content-body-title" >
48
56
领取方式
49
57
</view >
50
58
<text user-select decode class =" modal-content-body-getdesc" >{{coverDetail.getDesc}}</text >
51
- <text user-select decode class =" modal-content-body-getdesc" >\n{{id}}\n{{openid}}</text >
59
+ <button plain class =" modal-content-body-copy success" @click =" copyCode" v-if =" lockEdInfo.isLocked" >
60
+ 复制代码
61
+ </button >
62
+ <button plain class =" modal-content-body-copy success" @click =" linkOthers" v-if =" lockEdInfo.isLocked" >
63
+ 前往公众号
64
+ </button >
52
65
<button plain class =" modal-content-body-question" open-type =" contact" >有疑问?</button >
53
66
</view >
54
67
<image src =" /static/close.png" mode =" " class =" modal-content-cancel" @click.stop =" closeModal" ></image >
@@ -66,7 +79,7 @@ export default {
66
79
data () {
67
80
return {
68
81
id: ' ' ,
69
- num: 0 ,
82
+ num: 1 ,
70
83
modalShow: ' ' ,
71
84
coverDetail: {
72
85
inviteLockNum: 0 ,
@@ -89,7 +102,6 @@ export default {
89
102
},
90
103
onLoad (e ) {
91
104
this .id = e .id
92
- this .num = parseInt (e .num )
93
105
if (e .openid ){
94
106
this .openid = e .openid
95
107
}else {
@@ -107,7 +119,7 @@ export default {
107
119
onShareAppMessage (res ) {
108
120
let shareConfig = {
109
121
title: ' 送你个性微信红包封面,发红包时可用' ,
110
- path: ' /pages/detail/detail?openid=' + this .openid + ' &id=' + this .id + ' &num= ' + this . num ,
122
+ path: ' /pages/detail/detail?openid=' + this .openid + ' &id=' + this .id ,
111
123
imageUrl: this .coverDetail .pic
112
124
}
113
125
return shareConfig
@@ -116,12 +128,20 @@ export default {
116
128
let shareConfig = {
117
129
title: ' 送你个性微信红包封面,发红包时可用' ,
118
130
path: ' /pages/detail/detail' ,
119
- query: ' openid=' + this .openid + ' &id=' + this .id + ' &num= ' + this . num ,
131
+ query: ' openid=' + this .openid + ' &id=' + this .id ,
120
132
imageUrl: this .coverDetail .pic
121
133
}
122
134
return shareConfig
123
135
},
124
136
methods: {
137
+ linkOthers (){
138
+ // 此处填写你要跳转的绑定公众号文章的链接地址或者已经在小程序后台配置好业务域名的地址
139
+ var url = " https://mp.weixin.qq.com/s?__biz=MzU3MzY0OTAwNQ==&mid=2247484014&idx=1&sn=98969bf1a25f3ced92150e39e83d80bc&chksm=fd3f3b6cca48b27a00fafc3335ccbb9a52949b16a6ecbec177cfe1e31f14b7a2058ce166b339&token=1026867263&lang=zh_CN#rd"
140
+ uni .navigateTo ({
141
+ // 此处的链接为小程序上面新建的webview页面路径,参数url为要跳转外链的地址
142
+ url: " /pages/linkOthers/linkOthers?url=" + encodeURIComponent (url)
143
+ });
144
+ },
125
145
handle (){
126
146
return
127
147
},
@@ -133,6 +153,7 @@ export default {
133
153
console .log (res .result )
134
154
this .coverDetail = res .result .data .coverDetail
135
155
this .lockEdInfo = res .result .data .lockEdInfo
156
+ this .num = res .result .data .coverDetail .num
136
157
this .ad = res .result .data .ad
137
158
console .log (' inviteStatus' , getApp ().globalData .inviteStatus )
138
159
if (getApp ().globalData .inviteStatus && getApp ().globalData .inviteStatus .status == 1 ){
@@ -145,20 +166,46 @@ export default {
145
166
this .lookInviteVideoLockNum = 0 ;
146
167
}
147
168
console .log (' this.coverDetail' , this .coverDetail )
148
- if (isFirst && this .ad ){
149
- // 激励视频和插屏广告
150
- if (this .ad .one && ! this .lookInviteVideoLockNum ){
151
- this .adinsertInit (this .ad .one )
152
- }
153
- if (this .ad .five ){
154
- this .adInit (this .ad .five );
169
+ try {
170
+ if (isFirst && this .ad ){
171
+ // 激励视频和插屏广告
172
+ if (this .ad .one && ! this .lookInviteVideoLockNum && ! this .lockEdInfo .isLocked ){
173
+
174
+ this .adinsertInit (this .ad .one )
175
+ }
176
+ if (this .ad .five ){
177
+ this .adInit (this .ad .five );
178
+ }
155
179
}
180
+ } catch (error) {
181
+ console .log (' 广告初始化出错' ,error)
156
182
}
157
- if (this .lockEdInfo .isLocked && isFirst){
183
+ if (this .lockEdInfo .isLocked && isFirst && this . num > 0 ){
158
184
this .modalShow = true
159
185
}
160
186
uni .hideLoading ()
161
187
},
188
+ copyCode (){
189
+ console .log (' 复制剪切板' )
190
+ const _this = this ;
191
+ uni .setClipboardData ({
192
+ data: ' 元气封面领取码\n ' + this .id + ' \n ' + this .openid ,
193
+ success : function () {
194
+ uni .showToast ({
195
+ title: ' 获取成功' ,
196
+ icon: ' success' ,
197
+ duration: 4000
198
+ });
199
+ },
200
+ fail : function (err ) {
201
+ uni .showToast ({
202
+ title: ' 获取失败' ,
203
+ icon: ' none' ,
204
+ duration: 2000
205
+ });
206
+ }
207
+ });
208
+ },
162
209
lookAd : function (event ) {
163
210
console .log (' 观看广告' , event )
164
211
let lookType = event .currentTarget .dataset [' type' ];
@@ -230,6 +277,7 @@ export default {
230
277
},
231
278
// 看视频上报
232
279
async trackLookVideo (isEnded ){
280
+ console .log (' 看视频上报' )
233
281
await lookVideo ({
234
282
openid: getApp ().globalData .openid ,
235
283
id: this .id ,
@@ -343,6 +391,25 @@ export default {
343
391
color : #576b95 ;
344
392
margin-top : 30 rpx;
345
393
}
394
+ & -copy {
395
+ margin : auto ;
396
+ display : block ;
397
+ border : none ;
398
+ padding : 0 40 rpx;
399
+ height : 90 rpx;
400
+ width : 50% ;
401
+ align-items : center ;
402
+ justify-content : center ;
403
+ background-color : #fbd926 ;
404
+ border-radius : 90 rpx;
405
+ margin-top : 30 rpx;
406
+ font-size : 34 rpx;
407
+ font-weight : 700 ;
408
+ & .success {
409
+ background-color : #07c160 ;
410
+ color : #FFFFFF ;
411
+ }
412
+ }
346
413
}
347
414
& -cancel {
348
415
width : 50 rpx;
0 commit comments