Переглянути джерело

feat(app): 添加页面分享功能- 在多个页面中添加 onShareAppMessage 和 onShareTimeline 方法- 设置分享标题为各页面的标题或产品名称
- 优化用户分享体验,增加品牌曝光

EvilDragon 2 місяців тому
батько
коміт
2dda16aabf

+ 6 - 0
packages/app/src/pages/home/about/index.vue

@@ -15,6 +15,12 @@ const imgs = ref([
   'https://image.zhuchaohui.com/zhucaohui/7f212c009d75cb2fd1c89f5934e5bbc97042344dcc2a9818894edcd7bb33dfe6.png',
   'https://image.zhuchaohui.com/zhucaohui/a81c225a5ad394aaba99594f1410c0865f94c8e941e0c0f868d62fb8111a3c5f.png',
 ])
+onShareAppMessage(() => ({
+  title: '1分钟快速了解筑巢荟',
+}))
+onShareTimeline(() => ({
+  title: '1分钟快速了解筑巢荟',
+}))
 </script>
 <template>
   <div>

+ 6 - 0
packages/app/src/pages/home/content/index.vue

@@ -35,6 +35,12 @@ onLoad(async (query: { id: string; type?: 'banner' }) => {
   }
   await run()
 })
+onShareAppMessage(() => ({
+  title: data.value?.title,
+}))
+onShareTimeline(() => ({
+  title: data.value?.title,
+}))
 </script>
 <template>
   <div class="flex-grow bg-white">

+ 6 - 0
packages/app/src/pages/home/mall/detail/index.vue

@@ -74,6 +74,12 @@ onLoad(async (query: { id: string }) => {
   id.value = query.id
   await setData()
 })
+onShareAppMessage(() => ({
+  title: data.value?.prodcutName,
+}))
+onShareTimeline(() => ({
+  title: data.value?.prodcutName,
+}))
 </script>
 
 <template>

+ 6 - 0
packages/app/src/pages/home/mall/index.vue

@@ -78,6 +78,12 @@ onMounted(async () => {
 onShow(async () => {
   await Promise.all([setCarts()])
 })
+onShareAppMessage(() => ({
+  title: '品质商城',
+}))
+onShareTimeline(() => ({
+  title: '品质商城',
+}))
 </script>
 
 <template>

+ 6 - 0
packages/app/src/pages/home/offline-activity/cycling-rankings/index.vue

@@ -8,6 +8,12 @@ import { getRidings } from '../../../../core/libs/requests'
 import PageHelperEvo from '@/components/page-helper-evo.vue'
 
 // const { data, run } = useRequest(() => ({}), { initialData: [] })
+onShareAppMessage(() => ({
+  title: '骑行排行榜',
+}))
+onShareTimeline(() => ({
+  title: '骑行排行榜',
+}))
 </script>
 <template>
   <div class="flex-grow flex flex-col bg-[length:100%]">

+ 6 - 0
packages/app/src/pages/home/offline-activity/list/index.vue

@@ -20,6 +20,12 @@ const { data: tabs, run: setTabs } = useRequest(() => getByDictType(DictType.Mem
 onMounted(async () => {
   await setTabs()
 })
+onShareAppMessage(() => ({
+  title: '线下活动',
+}))
+onShareTimeline(() => ({
+  title: '线下活动',
+}))
 </script>
 <template>
   <div class="flex-grow flex flex-col gap-6 mx-3.5">

+ 6 - 0
packages/app/src/pages/home/spread/case-shooting/index.vue

@@ -7,6 +7,12 @@ import { useRouter } from '../../../../core/utils/router'
 import { getProducts } from '../../../../core/libs/requests'
 
 const router = useRouter()
+onShareAppMessage(() => ({
+  title: '案例拍摄',
+}))
+onShareTimeline(() => ({
+  title: '案例拍摄',
+}))
 </script>
 <template>
   <div class="flex-grow p-3.5">

+ 6 - 0
packages/app/src/pages/home/spread/product-detail/index.vue

@@ -63,6 +63,12 @@ onLoad(async (query: { id: string; title: string; item: string }) => {
   uni.setNavigationBarTitle({ title: query.title })
   await setData()
 })
+onShareAppMessage(() => ({
+  title: data.value?.prodcutName,
+}))
+onShareTimeline(() => ({
+  title: data.value?.prodcutName,
+}))
 </script>
 
 <template>

+ 6 - 0
packages/app/src/pages/home/spread/wx-agent-operation/index.vue

@@ -7,6 +7,12 @@ import { useRouter } from '../../../../core/utils/router'
 import { getProducts } from '../../../../core/libs/requests'
 
 const router = useRouter()
+onShareAppMessage(() => ({
+  title: '微信代运营',
+}))
+onShareTimeline(() => ({
+  title: '微信代运营',
+}))
 </script>
 <template>
   <PageHelper

+ 9 - 0
packages/app/src/pages/home/study-tour/list.vue

@@ -14,7 +14,10 @@ import StudyTourCard from './components/study-tour-card.vue'
 import PageHelper from '@/components/page-helper.vue'
 import { CircleType, DictType } from '@/core/libs/models'
 import { zipToObject } from 'radash'
+import {messages} from "@/core/libs/messages";
+import {useShare} from "@/composables/share";
 
+const {} = useShare()
 // const title = computed(() => `${dayjs().year()}年游学计划`)
 const designStudyAbroadYear = ref('')
 const title = ref('')
@@ -38,6 +41,12 @@ onLoad(async (query) => {
 onMounted(async () => {
   await setLevels()
 })
+onShareAppMessage(() => ({
+  title: '游学计划',
+}))
+onShareTimeline(() => ({
+  title: '游学计划',
+}))
 </script>
 <template>
   <div class="flex flex-col gap-6 p-3.5">

+ 6 - 0
packages/app/src/pages/material/detail/index.vue

@@ -80,6 +80,12 @@ onLoad(async (query: { id: number }) => {
     setMaterialsManageBrands(),
   ])
 })
+onShareAppMessage(() => ({
+  title: data.value?.materialsName,
+}))
+onShareTimeline(() => ({
+  title: data.value?.materialsName,
+}))
 </script>
 <template>
   <view class="flex-grow flex flex-col">