|
@@ -56,6 +56,7 @@ import { useTheme } from '@/components/theme/ThemeDefine';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
import { useVillageStore } from '@/store/village';
|
|
import { useVillageStore } from '@/store/village';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
|
|
+import { useShareLink } from './home/composeabe/ShareLink';
|
|
|
import { isDevEnv } from '@/common/config/AppCofig';
|
|
import { isDevEnv } from '@/common/config/AppCofig';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
import { waitTimeOut } from '@imengyu/imengyu-utils';
|
|
import { waitTimeOut } from '@imengyu/imengyu-utils';
|
|
@@ -79,6 +80,7 @@ const themeContext = useTheme();
|
|
|
const villageStore = useVillageStore();
|
|
const villageStore = useVillageStore();
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
const appConfiguration = injectAppConfiguration();
|
|
const appConfiguration = injectAppConfiguration();
|
|
|
|
|
+const { recommendUserId, setRecommendUserId } = useShareLink();
|
|
|
const currentScrollTop = ref(0);
|
|
const currentScrollTop = ref(0);
|
|
|
|
|
|
|
|
const backToTop = ref<InstanceType<typeof BackToTop>>();
|
|
const backToTop = ref<InstanceType<typeof BackToTop>>();
|
|
@@ -98,23 +100,25 @@ const { querys } = useLoadQuerys({
|
|
|
switch (sp[0]) {
|
|
switch (sp[0]) {
|
|
|
case 'invg':
|
|
case 'invg':
|
|
|
//处理从二维码进入村社情况
|
|
//处理从二维码进入村社情况
|
|
|
- if (sp.length > 1) {
|
|
|
|
|
|
|
+ if (sp.length >= 2)
|
|
|
querys.value.villageId = Number(sp[1]);
|
|
querys.value.villageId = Number(sp[1]);
|
|
|
- }
|
|
|
|
|
|
|
+ if (sp.length >= 3)
|
|
|
|
|
+ setRecommendUserId(Number(sp[2]));
|
|
|
break;
|
|
break;
|
|
|
case 'offical':
|
|
case 'offical':
|
|
|
//处理从推广文章返回跳转小程序点击量情况
|
|
//处理从推广文章返回跳转小程序点击量情况
|
|
|
- if (sp.length >= 2) {
|
|
|
|
|
|
|
+ if (sp.length >= 3) {
|
|
|
OfficialApi.traceOfficalLogApi('offical_card_clickback', {
|
|
OfficialApi.traceOfficalLogApi('offical_card_clickback', {
|
|
|
user_id: Number(sp[1]),
|
|
user_id: Number(sp[1]),
|
|
|
wechat_content_id: Number(sp[2]),
|
|
wechat_content_id: Number(sp[2]),
|
|
|
});
|
|
});
|
|
|
|
|
+ setRecommendUserId(Number(sp[1]));
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (_querys.userId) {
|
|
if (_querys.userId) {
|
|
|
- villageStore.setShareFromVillageUserId(_querys.userId);
|
|
|
|
|
|
|
+ setRecommendUserId(Number(_querys.userId));
|
|
|
}
|
|
}
|
|
|
//普通分享进入村社情况
|
|
//普通分享进入村社情况
|
|
|
if (querys.value.villageId) {
|
|
if (querys.value.villageId) {
|
|
@@ -139,13 +143,13 @@ function getShareVillageInfo() {
|
|
|
const myNickName = villageInfoInList?.villageNickname || authStore.userInfo?.nickname || authStore.userInfo?.username || '老友';
|
|
const myNickName = villageInfoInList?.villageNickname || authStore.userInfo?.nickname || authStore.userInfo?.username || '老友';
|
|
|
return {
|
|
return {
|
|
|
title: `同乡 ${myNickName} 邀您回 ${villageStore.currentVillage.name} 看看,心系故土,携手共建美好家乡`,
|
|
title: `同乡 ${myNickName} 邀您回 ${villageStore.currentVillage.name} 看看,心系故土,携手共建美好家乡`,
|
|
|
- path: `/pages/index?villageId=${villageStore.currentVillage.id}&userId=${authStore.userInfo?.id || 0}`,
|
|
|
|
|
|
|
+ path: `/pages/index?scene=invg:${villageStore.currentVillage.id}:${authStore.userInfo?.id || 0}`,
|
|
|
imageUrl: villageStore.currentVillage.image || appConfiguration.value.sharePost.villageDefault,
|
|
imageUrl: villageStore.currentVillage.image || appConfiguration.value.sharePost.villageDefault,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
title: '村社文化资源挖掘平台',
|
|
title: '村社文化资源挖掘平台',
|
|
|
- path: '/pages/index',
|
|
|
|
|
|
|
+ path: '/pages/index?userId=' + (authStore.userId || 0),
|
|
|
imageUrl: appConfiguration.value.sharePost.default,
|
|
imageUrl: appConfiguration.value.sharePost.default,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|