feat(share): 微信小程序全页面支持分享到好友和朋友圈,并自动携带分销邀请裂变参数
这个提交包含在:
171
pwuniapp/common/share.js
普通文件
171
pwuniapp/common/share.js
普通文件
@@ -0,0 +1,171 @@
|
||||
// 已读取AGENTS.md
|
||||
import { onShareAppMessage, onShareTimeline, onShow } from '@dcloudio/uni-app';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
const DEFAULT_SHARE_TITLE = '同城陪伴 · 专业游戏陪玩与生活陪伴';
|
||||
const DEFAULT_INDEX_PATH = '/pages/index/index';
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的邀请码/用户ID,用于分销裂变与邀请自动绑定
|
||||
*/
|
||||
export function getShareInviterParams() {
|
||||
try {
|
||||
const uid = uni.getStorageSync('userId');
|
||||
if (uid) {
|
||||
return {
|
||||
inviterId: String(uid),
|
||||
code: `PW${uid}`
|
||||
};
|
||||
}
|
||||
} catch (_) {}
|
||||
return {
|
||||
inviterId: '',
|
||||
code: ''
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造携带邀请人参数与页面参数的分享路径 (用于 onShareAppMessage)
|
||||
*/
|
||||
export function buildSharePath(basePath = DEFAULT_INDEX_PATH, extraParams = {}) {
|
||||
const { inviterId, code } = getShareInviterParams();
|
||||
const params = { ...extraParams };
|
||||
if (inviterId && !params.inviterId) {
|
||||
params.inviterId = inviterId;
|
||||
}
|
||||
if (code && !params.code) {
|
||||
params.code = code;
|
||||
}
|
||||
|
||||
const queryParts = [];
|
||||
for (const key of Object.keys(params)) {
|
||||
const val = params[key];
|
||||
if (val !== undefined && val !== null && val !== '') {
|
||||
queryParts.push(`${encodeURIComponent(key)}=${encodeURIComponent(val)}`);
|
||||
}
|
||||
}
|
||||
|
||||
const cleanBase = (basePath || DEFAULT_INDEX_PATH).split('?')[0];
|
||||
const queryStr = queryParts.join('&');
|
||||
return queryStr ? `${cleanBase}?${queryStr}` : cleanBase;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造朋友圈分享的 query 参数字符串 (用于 onShareTimeline,微信规范 query 不带 ?)
|
||||
*/
|
||||
export function buildTimelineQuery(extraParams = {}) {
|
||||
const { inviterId, code } = getShareInviterParams();
|
||||
const params = { ...extraParams };
|
||||
if (inviterId && !params.inviterId) {
|
||||
params.inviterId = inviterId;
|
||||
}
|
||||
if (code && !params.code) {
|
||||
params.code = code;
|
||||
}
|
||||
|
||||
const queryParts = [];
|
||||
for (const key of Object.keys(params)) {
|
||||
const val = params[key];
|
||||
if (val !== undefined && val !== null && val !== '') {
|
||||
queryParts.push(`${encodeURIComponent(key)}=${encodeURIComponent(val)}`);
|
||||
}
|
||||
}
|
||||
return queryParts.join('&');
|
||||
}
|
||||
|
||||
/**
|
||||
* 显式唤起微信小程序分享菜单 (同时激活【转发给朋友】与【分享到朋友圈】)
|
||||
*/
|
||||
export function enableShareMenu() {
|
||||
// #ifdef MP-WEIXIN
|
||||
try {
|
||||
if (uni.canIUse && uni.canIUse('showShareMenu')) {
|
||||
uni.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ['shareAppMessage', 'shareTimeline']
|
||||
});
|
||||
}
|
||||
} catch (_) {}
|
||||
// #endif
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面级分享统一 Composable (支持在 Vue3 <script setup> 内直接调用)
|
||||
* @param {Object|Function} options - 分享配置或动态 Getter 函数
|
||||
*/
|
||||
export function useShare(options = {}) {
|
||||
onMounted(() => {
|
||||
enableShareMenu();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
enableShareMenu();
|
||||
});
|
||||
|
||||
// 1. 监听【发送给朋友 / 微信好友 / 微信群】
|
||||
onShareAppMessage((res) => {
|
||||
const opt = typeof options === 'function' ? options(res) : options;
|
||||
const title = (opt && opt.title) || DEFAULT_SHARE_TITLE;
|
||||
const basePath = (opt && opt.path) || DEFAULT_INDEX_PATH;
|
||||
const extraParams = (opt && opt.params) || {};
|
||||
const finalPath = buildSharePath(basePath, extraParams);
|
||||
const result = {
|
||||
title,
|
||||
path: finalPath
|
||||
};
|
||||
if (opt && opt.imageUrl) {
|
||||
result.imageUrl = opt.imageUrl;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
// 2. 监听【分享到朋友圈】
|
||||
onShareTimeline(() => {
|
||||
const opt = typeof options === 'function' ? options() : options;
|
||||
const title = (opt && opt.timelineTitle) || (opt && opt.title) || DEFAULT_SHARE_TITLE;
|
||||
const extraParams = (opt && opt.params) || (opt && opt.query) || {};
|
||||
const query = typeof extraParams === 'string' ? extraParams : buildTimelineQuery(extraParams);
|
||||
const result = {
|
||||
title,
|
||||
query
|
||||
};
|
||||
if (opt && opt.imageUrl) {
|
||||
result.imageUrl = opt.imageUrl;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局共享 Mixin (在 main.js 中注册,为所有未显式定义分享的页面提供兜底分享能力)
|
||||
*/
|
||||
export const shareMixin = {
|
||||
onMounted() {
|
||||
enableShareMenu();
|
||||
},
|
||||
onShow() {
|
||||
enableShareMenu();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
let currentPath = DEFAULT_INDEX_PATH;
|
||||
try {
|
||||
const pages = getCurrentPages();
|
||||
if (pages && pages.length > 0) {
|
||||
const cur = pages[pages.length - 1];
|
||||
if (cur && cur.route) {
|
||||
currentPath = '/' + cur.route;
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
return {
|
||||
title: DEFAULT_SHARE_TITLE,
|
||||
path: buildSharePath(currentPath)
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return {
|
||||
title: DEFAULT_SHARE_TITLE,
|
||||
query: buildTimelineQuery()
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -1,9 +1,11 @@
|
||||
import App from './App'
|
||||
import { shareMixin } from './common/share.js'
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
Vue.mixin(shareMixin)
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
...App
|
||||
@@ -17,6 +19,7 @@ import {
|
||||
} from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
app.mixin(shareMixin)
|
||||
return {
|
||||
app
|
||||
}
|
||||
|
||||
@@ -402,6 +402,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { createActivity, createOrder, payOrder as payOrderApi, requestWechatPayment, normalizeUserId, getSafetyPlaces, getNavCategories, getPlatformConfigs } from '@/common/api.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { ensureLoginOrRedirect } from '@/common/role.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城发单组队 · 快速发起AA聚会与同行邀约',
|
||||
timelineTitle: '同城组队发单 · 来和我一起组局吧',
|
||||
path: '/pages/activity/create'
|
||||
});
|
||||
|
||||
const games = ref([]);
|
||||
const configLoading = ref(true);
|
||||
|
||||
@@ -429,6 +429,7 @@ import { openSupportSheet } from '@/common/support.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { ensureLoginOrRedirect } from '@/common/role.js';
|
||||
import { preloadSubscribeTemplates, requestSubscribeFor } from '@/common/subscribe.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
const currentUserId = computed(() => {
|
||||
try {
|
||||
@@ -510,6 +511,19 @@ const activity = ref({
|
||||
priceAdjustHistory: []
|
||||
});
|
||||
|
||||
useShare(() => {
|
||||
const act = activity.value;
|
||||
const title = act && act.title ? `【组局】${act.title}` : '同城热门组局活动邀你加入';
|
||||
const timelineTitle = act && act.title ? `【同城组局】${act.title}` : '同城热门组局活动邀你加入';
|
||||
return {
|
||||
title,
|
||||
timelineTitle,
|
||||
path: '/pages/activity/detail',
|
||||
params: { id: currentActId.value },
|
||||
imageUrl: (act && (act.coverImage || act.image)) || ''
|
||||
};
|
||||
});
|
||||
|
||||
const loadLiveDetail = async (id) => {
|
||||
try {
|
||||
const detail = await getActivityDetail(id);
|
||||
|
||||
@@ -190,6 +190,13 @@ import { getActivities, getNavCategories, normalizeUserId } from '@/common/api.j
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城热门组局 · 美食探店/KTV/桌游/电竞AA拼单',
|
||||
timelineTitle: '同城热门组局大厅 · 附近精彩活动邀你加入',
|
||||
path: '/pages/activity/list'
|
||||
});
|
||||
|
||||
const CURRENT_USER_ID = normalizeUserId();
|
||||
|
||||
|
||||
@@ -129,6 +129,16 @@ import { getActivityDetail, getMyActivities, leaveActivity, normalizeUserId } fr
|
||||
import { encodeCode128B } from '@/common/barcode.js';
|
||||
import { generateQRCodeMatrix } from '@/common/qrcode.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare(() => {
|
||||
const t = ticketData.value;
|
||||
return {
|
||||
title: t && t.title ? `我的活动门票 · 【${t.title}】` : '我的活动门票 · 同行凭据与4位核销码',
|
||||
timelineTitle: t && t.title ? `【活动门票】${t.title}` : '同城活动同行门票',
|
||||
path: '/pages/activity/list'
|
||||
};
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
|
||||
|
||||
@@ -43,6 +43,13 @@ import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getPlatformConfigs, loginWithWechatPhone } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 账号登录与注册',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const APP_LOGO = 'https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=200';
|
||||
const DEFAULT_AVATAR = 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200';
|
||||
|
||||
@@ -73,6 +73,7 @@ import { ref, computed, onMounted } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getPlatformConfigs } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const protocolType = ref('service'); // 'service' | 'privacy'
|
||||
@@ -92,6 +93,16 @@ const pageTitle = computed(() => {
|
||||
return protocolData.value.userAgreementTitle || '用户服务协议';
|
||||
});
|
||||
|
||||
useShare(() => {
|
||||
const t = pageTitle.value || '用户服务协议与隐私政策';
|
||||
return {
|
||||
title: `同城陪伴 · ${t}`,
|
||||
timelineTitle: `同城陪伴 · ${t}`,
|
||||
path: '/pages/common/protocol',
|
||||
params: { type: protocolType.value }
|
||||
};
|
||||
});
|
||||
|
||||
const pageSummary = computed(() => {
|
||||
return protocolData.value.summary || '平台全面遵循微信官方内容安全风控与用户隐私保护标准。';
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -232,6 +232,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getExpertCertStatus, setExpertCertStatus, CERT_STATUS } from '@/common/role.js';
|
||||
import { applyExpertCert, getPlatformConfigs, getUserProfile, uploadVoiceIntro, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '诚邀优秀陪伴师入驻 · 高收益免抽佣开启接单',
|
||||
timelineTitle: '同城陪伴师招募中 · 期待优秀的你加入',
|
||||
path: '/pages/expert/apply'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const certStatus = ref(getExpertCertStatus());
|
||||
|
||||
@@ -265,6 +265,7 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { openSupportSheet } from '@/common/support.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { ensureLoginOrRedirect } from '@/common/role.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
|
||||
@@ -327,6 +328,21 @@ const refreshFavoriteState = async () => {
|
||||
} catch (_) {}
|
||||
};
|
||||
|
||||
useShare(() => {
|
||||
const exp = expert.value;
|
||||
const name = exp && exp.nickname ? exp.nickname : '同城金牌陪伴师';
|
||||
const tag = exp && (exp.game || exp.levelTag || exp.rankTag) ? ` · ${exp.game || exp.levelTag || exp.rankTag}` : '';
|
||||
const title = `【金牌陪伴】${name}${tag} 邀你一起组局畅玩`;
|
||||
const timelineTitle = `推荐同城金牌陪伴师:${name}${tag}`;
|
||||
return {
|
||||
title,
|
||||
timelineTitle,
|
||||
path: '/pages/expert/detail',
|
||||
params: { id: currentExpertTargetId || '1' },
|
||||
imageUrl: (exp && exp.avatar) || ''
|
||||
};
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
|
||||
@@ -255,6 +255,13 @@ import { claimOrder, getOrdersPool, getExpertStats, updateCompanionProfile, getU
|
||||
import { getUserLocation } from '@/common/location.js';
|
||||
import { startHeartbeat, stopHeartbeat } from '@/common/expert-heartbeat.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城接单大厅 · 实时海量高收益陪玩订单',
|
||||
timelineTitle: '同城接单大厅 · 实时海量高收益陪玩订单',
|
||||
path: '/pages/expert/hall'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const DEFAULT_EXPERT_AVATAR = 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300';
|
||||
|
||||
@@ -192,6 +192,13 @@ import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getOrdersPool, claimOrder, reverseGeocode } from '@/common/api.js';
|
||||
import { getUserLocation } from '@/common/location.js';
|
||||
import { startHeartbeat, stopHeartbeat } from '@/common/expert-heartbeat.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '附近接单雷达 · 5公里即时速配派单',
|
||||
timelineTitle: '附近接单雷达 · 5公里即时速配派单',
|
||||
path: '/pages/expert/radar'
|
||||
});
|
||||
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
const navStyle = computed(() => ({
|
||||
|
||||
@@ -468,6 +468,13 @@ import { onShow, onHide } from '@dcloudio/uni-app';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { openSupportSheet } from '@/common/support.js';
|
||||
import { isExpertCertified } from '@/common/role.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 大神接单工作台',
|
||||
timelineTitle: '同城陪伴 · 诚邀优秀陪伴师入驻接单',
|
||||
path: '/pages/expert/hall'
|
||||
});
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import {
|
||||
queryCheckinCode,
|
||||
|
||||
@@ -286,6 +286,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getCurrentRole, ROLE_TYPES, isExpertCertified, safeRedirectToExpertHall } from '@/common/role.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
timelineTitle: '同城陪伴 · 发现附近精选大神与热门组局',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const isLoading = ref(true);
|
||||
const banners = ref([]);
|
||||
|
||||
@@ -283,6 +283,13 @@ import { preloadSubscribeTemplates, requestSubscribeFor } from '@/common/subscri
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { ensureLoginOrRedirect } from '@/common/role.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 确认预约订单',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const currentUserId = ref(normalizeUserId());
|
||||
|
||||
@@ -379,6 +379,13 @@ import { openSupportSheet } from '@/common/support.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';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 订单中心与履约保障',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/order/list'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -183,6 +183,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserFinanceRecords, getUserProfile, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 账单明细',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -109,6 +109,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getMarketingCoupons, claimCoupon, getMyCoupons } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴优惠中心 · 限量超值立减神券限时抢',
|
||||
timelineTitle: '同城陪伴优惠中心 · 限量立减神券等你来领',
|
||||
path: '/pages/user/coupons'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -124,6 +124,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getFavorites, removeFavorite, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 我的精选收藏大神',
|
||||
timelineTitle: '同城陪伴 · 发现附近精选高颜值大神',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -48,6 +48,13 @@ import { ref, onMounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getPlatformConfigs } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 帮助中心与常见问题解答',
|
||||
timelineTitle: '同城陪伴 · 常见问题解答与服务指引',
|
||||
path: '/pages/user/help-faq'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const isLoading = ref(true);
|
||||
|
||||
@@ -365,6 +365,13 @@ import { getCurrentRole, setCurrentRole, ROLE_TYPES, toggleRole as toggleUserRol
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserProfile, rechargeBalance, withdrawCommission, getUserFinanceRecords, updateUserProfile, uploadImage, getRechargeTiers, getPlatformConfigs, applyExpertCert, getUserWithdrawals, getFavorites, removeFavorite, getDistributionTeam, getDistributionRecords, getMyReports, bindInviteCode, getNotifications, getMyCoupons, normalizeUserId } from '@/common/api.js';
|
||||
import { preloadSubscribeTemplates, requestSubscribeAll } from '@/common/subscribe.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 专业游戏陪玩与生活陪伴中心',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与同城生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const DEFAULT_GUEST_AVATAR = 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200';
|
||||
const initialUserId = typeof uni !== 'undefined' ? (uni.getStorageSync('userId') || null) : null;
|
||||
|
||||
@@ -76,6 +76,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getNotifications, markNotificationsRead } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 消息与通知中心',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -224,6 +224,7 @@ import {
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
@@ -240,6 +241,19 @@ const user = ref({
|
||||
invitedCount: 0
|
||||
});
|
||||
|
||||
useShare(() => {
|
||||
const uid = normalizeUserId();
|
||||
return {
|
||||
title: '邀请你加入同城陪伴,海量高颜值大神随心约,立享新人专属礼包!',
|
||||
timelineTitle: '加入同城陪伴,海量高颜值大神随心约,同城组局随心享!',
|
||||
path: '/pages/index/index',
|
||||
params: {
|
||||
code: uid ? `PW${uid}` : '',
|
||||
inviterId: uid ? String(uid) : ''
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
const distActiveTab = ref('poster');
|
||||
const teamLevelTab = ref(1);
|
||||
|
||||
|
||||
@@ -220,6 +220,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserProfile, rechargeBalance, getRechargeTiers, requestWechatPayment, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 钱包充值与优惠档位',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -184,6 +184,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getMyReports, getPlatformConfigs, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 我的维权与服务监督',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -187,6 +187,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserSettings, updateUserSettings, getSubscribeTemplates, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 系统与隐私设置',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -181,6 +181,13 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserWithdrawals, normalizeUserId } from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 提现审批明细',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -192,6 +192,13 @@ import {
|
||||
getPlatformConfigs,
|
||||
normalizeUserId
|
||||
} from '@/common/api.js';
|
||||
import { useShare } from '@/common/share.js';
|
||||
|
||||
useShare({
|
||||
title: '同城陪伴 · 收益佣金提现',
|
||||
timelineTitle: '同城陪伴 · 专业游戏陪玩与生活陪伴',
|
||||
path: '/pages/index/index'
|
||||
});
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
在新工单中引用
屏蔽一个用户