| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <template>
- </template>
-
- <script>
- // 文件:/pages/reader/reader.vue
- export default {
- data() {
- return {
- isVIP: false,
- chapterCount: 0
- }
- },
- methods: {
- // 翻页触发广告
- onPageTurn() {
- this.chapterCount++;
- if (!this.isVIP && this.chapterCount % 5 === 0) {
- this.showRewardAd(); // 每5章触发激励视频
- }
- },
- // 平台广告过滤
- showRewardAd() {
- // #ifdef MP-WEIXIN
- wx.createRewardedVideoAd({ adUnitId: '微信广告ID' }).show()
- // #endif
-
- // #ifdef MP-DOUYIN
- tt.showRewardedVideoAd({ adUnitId: '抖音广告ID' })
- // #endif
-
- // #ifdef H5
- this.$refs.h5Ad.show() // H5专用广告组件
- // #endif
- }
- }
- }
- </script>
-
- <style>
- </style>
|