feat(share): 微信小程序全页面支持分享到好友和朋友圈,并自动携带分销邀请裂变参数

这个提交包含在:
xcbyy
2026-10-23 11:05:48 +08:00
父节点 8613d40588
当前提交 d0693c6d9e
共有 31 个文件被更改,包括 474 次插入 和 0 次删除

查看文件

@@ -173,6 +173,7 @@ import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
import { ensureLoginOrRedirect } from '@/common/role.js';
import { getNavBarInfo } from '@/common/nav.js';
import { useShare } from '@/common/share.js';
import {
getPosts,
deletePost,
@@ -191,6 +192,18 @@ const currentThemeKey = ref(getCurrentThemeKey());
const navInfo = ref(getNavBarInfo());
const postId = ref(null);
const post = ref(null);
useShare(() => {
const p = post.value;
const content = p && p.content ? (p.content.length > 30 ? p.content.slice(0, 30) + '...' : p.content) : '友圈精彩动态分享';
return {
title: content,
timelineTitle: `【友圈动态】${content}`,
path: '/pages/community/detail',
params: { id: postId.value || '' },
imageUrl: (p && Array.isArray(p.images) && p.images[0]) || ''
};
});
const commentsList = ref([]);
const commentInput = ref('');
const loadingComments = ref(false);

查看文件

@@ -404,6 +404,13 @@ import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
import { ensureLoginOrRedirect } from '@/common/role.js';
import { getNavBarInfo } from '@/common/nav.js';
import { getPosts, createPost, deletePost, likePost, viewPost, getPostComments, addPostComment, applyPostParty, getPostApplies, handlePostApply, uploadImage, getPlatformConfigs, getUserProfile, normalizeUserId } from '@/common/api.js';
import { useShare } from '@/common/share.js';
useShare({
title: '友圈广场 · 发现同城精彩动态与生活日常',
timelineTitle: '友圈广场 · 看看同城小伙伴的精彩日常',
path: '/pages/community/index'
});
const DEFAULT_USER_AVATAR = 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=120';
const isLoading = ref(true);