docs: ✏️ 演示demo小程序支持分享

This commit is contained in:
不如摸鱼去 2024-12-29 16:45:03 +08:00
parent 1d0b11b256
commit 583acc2fa9
4 changed files with 19 additions and 2 deletions

View File

@ -105,7 +105,7 @@ onMounted(() => {
})
// #ifdef MP-WEIXIN
// 广
if (uni.createInterstitialAd && showWxAd3.value && props.useWxAd) {
if (uni.createInterstitialAd && showWxAd3.value && props.useWxAd && !isFree.value) {
interstitialAd = uni.createInterstitialAd({ adUnitId: 'adunit-fc8522e2b1185c89' })
nextTick(() => {
interstitialAd && interstitialAd.show()

BIN
src/pages/images/share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -39,6 +39,7 @@
<script lang="ts" setup>
import { ref } from 'vue'
import packageConfig from '../../../package.json'
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
const imgModules: any = import.meta.glob('../images/*.png', { eager: true })
@ -402,6 +403,22 @@ function kindToggle(id: string) {
}
list.value = listValue
}
onShareAppMessage(() => {
return {
title: '一个基于Vue3+TS的uni-app组件库提供70+高质量组件,支持暗黑模式、国际化和自定义主题。',
path: '/pages/index/Index',
imageUrl: imgModules['../images/share.png'].default
}
})
onShareTimeline(() => {
return {
title: '一个基于Vue3+TS的uni-app组件库提供70+高质量组件,支持暗黑模式、国际化和自定义主题。',
path: '/pages/index/Index',
imageUrl: imgModules['../images/share.png'].default
}
})
</script>
<style lang="scss" scoped>

View File

@ -15,7 +15,7 @@
import { useRewardAd } from '@/store/useRewardAd'
import { pause } from '@/uni_modules/wot-design-uni/components/common/util'
import { onMounted } from 'vue'
const { createRewardVideoAd, showRewardAd, isFree } = useRewardAd()
const { createRewardVideoAd, showRewardAd } = useRewardAd()
onMounted(async () => {
await pause()