feat: add 微信分享

This commit is contained in:
Burt 2024-01-03 11:46:01 +08:00
parent 5ea86de7ce
commit 524f82063d

View File

@ -25,6 +25,7 @@ import { ref } from 'vue'
import { useCountStore, useUserStore } from '@/store' import { useCountStore, useUserStore } from '@/store'
import { http } from '@/utils/http' import { http } from '@/utils/http'
import { UserItem } from '@/typings' import { UserItem } from '@/typings'
import { onShareAppMessage } from '@dcloudio/uni-app'
const countStore = useCountStore() const countStore = useCountStore()
const title = ref('Hello') const title = ref('Hello')
@ -47,6 +48,15 @@ const handleRequest = () => {
}) })
console.log(res) console.log(res)
} }
onShareAppMessage((options: Page.ShareAppMessageOption): Page.CustomShareContent => {
console.log('options:', options)
return {
title: '自定义分享标题',
path: '/pages/index/index?id=xxx',
imageUrl:
'https://cip-shopping-page-0eysug01066a9e-1302818703.tcloudbaseapp.com/pretty-girl.png',
}
})
</script> </script>
<style> <style>