Skip to content

Commit 583acc2

Browse files
docs: ✏️ 演示demo小程序支持分享
1 parent 1d0b11b commit 583acc2

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ onMounted(() => {
105105
})
106106
// #ifdef MP-WEIXIN
107107
// 微信广告
108-
if (uni.createInterstitialAd && showWxAd3.value && props.useWxAd) {
108+
if (uni.createInterstitialAd && showWxAd3.value && props.useWxAd && !isFree.value) {
109109
interstitialAd = uni.createInterstitialAd({ adUnitId: 'adunit-fc8522e2b1185c89' })
110110
nextTick(() => {
111111
interstitialAd && interstitialAd.show()

src/pages/images/share.png

85.6 KB
Loading

src/pages/index/Index.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<script lang="ts" setup>
4040
import { ref } from 'vue'
4141
import packageConfig from '../../../package.json'
42+
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
4243
4344
const imgModules: any = import.meta.glob('../images/*.png', { eager: true })
4445
@@ -402,6 +403,22 @@ function kindToggle(id: string) {
402403
}
403404
list.value = listValue
404405
}
406+
407+
onShareAppMessage(() => {
408+
return {
409+
title: '一个基于Vue3+TS的uni-app组件库,提供70+高质量组件,支持暗黑模式、国际化和自定义主题。',
410+
path: '/pages/index/Index',
411+
imageUrl: imgModules['../images/share.png'].default
412+
}
413+
})
414+
415+
onShareTimeline(() => {
416+
return {
417+
title: '一个基于Vue3+TS的uni-app组件库,提供70+高质量组件,支持暗黑模式、国际化和自定义主题。',
418+
path: '/pages/index/Index',
419+
imageUrl: imgModules['../images/share.png'].default
420+
}
421+
})
405422
</script>
406423

407424
<style lang="scss" scoped>

src/pages/wxRewardAd/Index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import { useRewardAd } from '@/store/useRewardAd'
1616
import { pause } from '@/uni_modules/wot-design-uni/components/common/util'
1717
import { onMounted } from 'vue'
18-
const { createRewardVideoAd, showRewardAd, isFree } = useRewardAd()
18+
const { createRewardVideoAd, showRewardAd } = useRewardAd()
1919
2020
onMounted(async () => {
2121
await pause()

0 commit comments

Comments
 (0)