|
|
@@ -70,7 +70,7 @@ Component({
|
|
|
this.videoAd.onError((err) => {
|
|
|
console.log('激励失败', err)
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
this.videoAd.onClose((res) => {
|
|
|
const novelManager = novelPlugin.getNovelManager(this.properties.novelManagerId)
|
|
|
if (res && res.isEnded) {
|
|
|
@@ -85,12 +85,20 @@ Component({
|
|
|
unlockChapter(params).then(res => {
|
|
|
console.log(res)
|
|
|
novelManager.paymentCompleted()
|
|
|
- console.log('章节解锁成功',this.properties.chapterIndex)
|
|
|
+ console.log('章节解锁成功', this.properties.chapterIndex)
|
|
|
+ wx.showToast({
|
|
|
+ title: '解锁成功',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
})
|
|
|
this.videoAd.offClose()
|
|
|
} else {
|
|
|
novelManager.closeChargeDialog()
|
|
|
console.log('关闭解锁组件')
|
|
|
+ wx.showToast({
|
|
|
+ title: '解锁失败',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -105,6 +113,10 @@ Component({
|
|
|
console.log('激励视频播放成功')
|
|
|
}).catch((err) => {
|
|
|
console.log('激励视频播放失败', err)
|
|
|
+ wx.showToast({
|
|
|
+ title: '广告拉起失败,请重试',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}).then(() => {
|
|
|
wx.hideLoading()
|
|
|
})
|