Skip to content

Commit 1d0b11b

Browse files
docs: ✏️ 添加互助交流QQ群3群二维码
1 parent 3b6d10d commit 1d0b11b

File tree

7 files changed

+107
-56
lines changed

7 files changed

+107
-56
lines changed

docs/guide/join-group.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424

2525
## QQ 群
2626

27-
目前 1 群已满,请加 2 群。
27+
目前 1、2 群已满,请加 3 群。
2828

2929
<div style="display: flex;gap:24px;">
30-
<img style="width: 250px; height: 250px;" :src="QQ1" @click="handleClick" :style="{filter: checked ? 'none' : 'blur(5px)'}" />
31-
<img style="width: 250px; height: 250px;" :src="QQ2" @click="handleClick" :style="{filter: checked ? 'none' : 'blur(5px)'}" />
30+
<img style="width: 250px; height: auto;" :src="QQ1" @click="handleClick" :style="{filter: checked ? 'none' : 'blur(5px)'}" />
31+
<img style="width: 250px; height: auto;" :src="QQ2" @click="handleClick" :style="{filter: checked ? 'none' : 'blur(5px)'}" />
32+
<img style="width: 250px; height: auto;" :src="QQ3" @click="handleClick" :style="{filter: checked ? 'none' : 'blur(5px)'}" />
3233
</div>
3334

3435
***快速定位问题小技巧***
@@ -37,15 +38,18 @@
3738
3. 查看[Github issues](https://github.com/Moonofweisheng/wot-design-uni/issues),是否有类似问题。
3839
4. 翻看[更新日志](/guide/changelog),查看是否有相关更新。
3940
5. 学习[提问的智慧](https://lug.ustc.edu.cn/wiki/doc/smart-questions/),如何快速提出正确的问题。
41+
6. 交流群主要是提供一个互助交流的平台,请友好交流,不做伸手党,感谢支持。
4042

4143
<el-checkbox v-model="checked" label="我已阅读以上沟通案例和小技巧,并保证提问时遵守以上规范" />
4244

4345

4446
<script setup>
4547
import { ElMessage, ElMessageBox } from 'element-plus'
4648
import { ref } from 'vue'
47-
import QQ1 from '/QQ1.png'
48-
import QQ2 from '/QQ2.png'
49+
import QQ1 from '/QQ1.jpg'
50+
import QQ2 from '/QQ2.jpg'
51+
import QQ3 from '/QQ3.jpg'
52+
4953
const checked = ref(false)
5054

5155
function handleClick() {

docs/public/QQ1.jpg

487 KB
Loading

docs/public/QQ2.jpg

504 KB
Loading

docs/public/QQ3.jpg

459 KB
Loading

src/components/page-wraper/page-wraper.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<slot />
1111
<!-- #ifdef MP-WEIXIN -->
1212
<!-- 横幅广告和格子广告可以共存,但插屏广告展示时,不显示横幅广告和格子广告 -->
13-
<template v-if="useWxAd && !showWxAd3">
13+
<template v-if="useWxAd && !showWxAd3 && !isFree">
1414
<ad-custom v-if="showWxAd" unit-id="adunit-06191d6d3d1ddfc4"></ad-custom>
1515
<ad-custom
1616
v-if="showWxAd2"
@@ -29,7 +29,7 @@
2929
<wd-button type="error" round @click="goToReward">
3030
<view style="display: flex; align-items: center">
3131
<wd-icon name="thumb-up" size="22px"></wd-icon>
32-
观看激励视频广告为我助力
32+
观看视频广告24h内免除广告
3333
</view>
3434
</wd-button>
3535
</wd-fab>
@@ -49,6 +49,7 @@ export default {
4949
import { computed, ref, onMounted, nextTick } from 'vue'
5050
import { setNotifyDefaultOptions, useQueue, type ConfigProviderThemeVars } from '@/uni_modules/wot-design-uni'
5151
import { useDark } from '../../store'
52+
import { useRewardAd } from '@/store/useRewardAd'
5253
5354
interface Props {
5455
showDarkMode?: boolean
@@ -67,7 +68,7 @@ const props = withDefaults(defineProps<Props>(), {
6768
const enableRewardFab = computed(() => {
6869
return props.useRewardFab && (process.env.NODE_ENV === 'development' ? false : true)
6970
})
70-
71+
const { isFree } = useRewardAd()
7172
const darkMode = useDark()
7273
const { closeOutside } = useQueue()
7374
const isDark = ref<boolean>(false)

src/pages/wxRewardAd/Index.vue

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
<!--
2-
* @Author: weisheng
3-
* @Date: 2024-12-12 21:33:43
4-
* @LastEditTime: 2024-12-12 22:52:14
5-
* @LastEditors: weisheng
6-
* @Description:
7-
* @FilePath: /wot-design-uni/src/pages/wxRewardAd/Index.vue
8-
* 记得注释
9-
-->
101
<template>
112
<page-wraper :use-wx-ad="false">
123
<div class="ad-completion-message">
134
<div class="message-title">感谢你愿意来观看广告!</div>
145
<div class="message-content">观看成功就已经成功为我助力!</div>
15-
<div class="message-content">请继续使用我们的组件,您的支持对我们非常重要!</div>
6+
<div class="message-content">观看一次即可免除24h内的页面贴片和插屏广告!</div>
167
<view class="button-group">
178
<wd-button type="success" block @click="back">返回使用</wd-button>
189
<wd-button type="error" block @click="showAd">再次观看</wd-button>
@@ -21,46 +12,16 @@
2112
</page-wraper>
2213
</template>
2314
<script setup lang="ts">
24-
import { useToast } from '@/uni_modules/wot-design-uni'
15+
import { useRewardAd } from '@/store/useRewardAd'
16+
import { pause } from '@/uni_modules/wot-design-uni/components/common/util'
2517
import { onMounted } from 'vue'
26-
const { loading: showLoading, close: closeLoading } = useToast()
27-
let rewardVideoAd: UniApp.InterstitialAdContext | null = null
18+
const { createRewardVideoAd, showRewardAd, isFree } = useRewardAd()
2819
29-
function showRewardAd() {
30-
showLoading({ msg: '正在加载激励视频...' })
31-
rewardVideoAd &&
32-
rewardVideoAd
33-
.show()
34-
.then(() => {
35-
closeLoading()
36-
})
37-
.catch(() => {
38-
rewardVideoAd!
39-
.load()
40-
.then(() =>
41-
rewardVideoAd!.show().finally(() => {
42-
closeLoading()
43-
})
44-
)
45-
.catch((err) => {
46-
closeLoading()
47-
console.log('激励视频 广告显示失败')
48-
})
49-
})
50-
}
51-
52-
onMounted(() => {
53-
// 接入微信小程序激励视频广告
54-
if (uni.createRewardedVideoAd) {
55-
rewardVideoAd = uni.createRewardedVideoAd({ adUnitId: 'adunit-91e0e9b07b57557a' })
56-
rewardVideoAd.onLoad(() => {
57-
console.log('激励视频 广告加载成功')
58-
})
59-
rewardVideoAd.onError((err) => {
60-
console.log('激励视频 广告加载失败', err)
61-
})
62-
showRewardAd()
63-
}
20+
onMounted(async () => {
21+
await pause()
22+
createRewardVideoAd()
23+
await pause()
24+
showRewardAd()
6425
})
6526
6627
function back() {

src/store/useRewardAd.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { useToast } from '@/uni_modules/wot-design-uni'
2+
import { ref } from 'vue'
3+
4+
// 是否免除广告,免除后不再显示广告
5+
const isFree = ref(false)
6+
7+
export function useRewardAd() {
8+
const { loading: showLoading, close: closeLoading, show: showToast } = useToast()
9+
10+
let rewardVideoAd: UniApp.InterstitialAdContext | null = null
11+
12+
isFreeAd()
13+
14+
// 用户观看过广告的话会在storage中存一个时间戳,写个方法判断是否存在这个时间戳,距离当前是否超过一天,超过一天则必须观看,否则不强制
15+
function isFreeAd() {
16+
const freeAdTime = uni.getStorageSync('freeAdTime')
17+
if (freeAdTime) {
18+
const now = new Date().getTime()
19+
const diff = now - freeAdTime
20+
if (diff > 24 * 60 * 60 * 1000) {
21+
isFree.value = false
22+
} else {
23+
isFree.value = true
24+
}
25+
} else {
26+
isFree.value = false
27+
}
28+
}
29+
30+
/**
31+
* 创建激励视频广告
32+
*/
33+
function createRewardVideoAd() {
34+
if (uni.createRewardedVideoAd) {
35+
rewardVideoAd = uni.createRewardedVideoAd({ adUnitId: 'adunit-91e0e9b07b57557a' })
36+
rewardVideoAd.onLoad(() => {
37+
console.log('激励视频 广告加载成功')
38+
})
39+
rewardVideoAd.onError((err) => {
40+
console.log('激励视频 广告加载失败', err)
41+
})
42+
rewardVideoAd.onClose((res) => {
43+
if (res && res.isEnded) {
44+
// 看完广告则存一个时间戳
45+
console.log('激励视频 广告完成')
46+
isFree.value = true
47+
uni.setStorageSync('freeAdTime', new Date().getTime())
48+
showToast({ msg: '广告观看成功,感谢支持' })
49+
} else {
50+
console.log('激励视频 广告未完成')
51+
}
52+
})
53+
} else {
54+
console.log('当前环境不支持激励视频广告')
55+
}
56+
}
57+
58+
/**
59+
* 打开激励视频广告
60+
*/
61+
function showRewardAd() {
62+
showLoading({ msg: '正在加载激励视频...' })
63+
rewardVideoAd &&
64+
rewardVideoAd
65+
.show()
66+
.then(() => {
67+
closeLoading()
68+
})
69+
.catch(() => {
70+
rewardVideoAd!
71+
.load()
72+
.then(() =>
73+
rewardVideoAd!.show().finally(() => {
74+
closeLoading()
75+
})
76+
)
77+
.catch((err) => {
78+
closeLoading()
79+
console.log('激励视频 广告显示失败')
80+
})
81+
})
82+
}
83+
84+
return { createRewardVideoAd, showRewardAd, isFree }
85+
}

0 commit comments

Comments
 (0)