feat(system): implement dynamic platform configs for customer service, safety notice, and service agreement

这个提交包含在:
xcbyy
2026-10-10 09:47:53 +08:00
父节点 d9c8388711
当前提交 dc19189bc6
共有 10 个文件被更改,包括 613 次插入 和 10 次删除

查看文件

@@ -737,3 +737,16 @@ export async function checkTextSecurity(content) {
}
}
/**
* 获取平台通用配置(官方客服、履约公告指引、平台规范协议等)
*/
export async function getPlatformConfigs() {
try {
const res = await http.get('/system/configs');
return res;
} catch (err) {
console.warn('[API] 获取平台通用配置降级:', err.message);
return null;
}
}

查看文件

@@ -218,7 +218,7 @@ import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey, setTheme, THEME_KEYS, applyThemeToNativeUI } from '@/common/theme.js';
import { getCurrentRole, setCurrentRole, ROLE_TYPES, toggleRole as toggleUserRole, isExpertCertified, getExpertCertStatus, setExpertCertStatus, CERT_STATUS } from '@/common/role.js';
import { getNavBarInfo } from '@/common/nav.js';
import { getUserProfile, rechargeBalance, withdrawCommission, getUserFinanceRecords, updateUserProfile, uploadImage, getRechargeTiers } from '@/common/api.js';
import { getUserProfile, rechargeBalance, withdrawCommission, getUserFinanceRecords, updateUserProfile, uploadImage, getRechargeTiers, getPlatformConfigs } from '@/common/api.js';
const user = ref({
id: 1001,
@@ -236,6 +236,40 @@ const currentRole = ref(getCurrentRole());
const currentThemeKey = ref(getCurrentThemeKey());
const navInfo = ref(getNavBarInfo());
const privacyModalRef = ref(null);
const platformConfigs = ref({
customer_service: {
hotline: '400-888-6666',
hotlineDesc: '7x24h 官方客服服务热线',
wechat: 'peiwan_vip_kefu',
wechatDesc: '官方 VIP 客服微信号'
},
safety_notice: {
title: '平台官方公告与指引',
points: [
'【安全履约须知】为保障搭子与陪伴师人身与财产安全,线下约局须在合规公开商业街区进行。',
'【现场核销】现场碰面后请出示 4 位数字核销码进行签到确认。',
'【平台兜底】平台提供 7x24 小时争议仲裁与资金托管保障服务。'
]
},
platform_protocol: {
title: '用户服务协议与隐私规范',
summary: '严禁发布任何违规言论及低俗诈骗行为,平台全面遵循微信内容安全风控与用户隐私保护标准。'
}
});
const loadPlatformConfigs = async () => {
try {
const res = await getPlatformConfigs();
if (res && typeof res === 'object') {
platformConfigs.value = {
...platformConfigs.value,
...res
};
}
} catch (e) {
console.warn('[User] 加载系统配置失败降级:', e);
}
};
const navStyle = computed(() => {
return {
@@ -274,6 +308,7 @@ onMounted(() => {
uni.$on('theme-change', onThemeChanged);
uni.$on('role-change', onRoleChanged);
loadUserProfile();
loadPlatformConfigs();
});
onShow(() => {
@@ -283,6 +318,7 @@ onShow(() => {
applyThemeToNativeUI(currentThemeKey.value);
uni.hideTabBar({ animation: false, fail: () => {} });
loadUserProfile();
loadPlatformConfigs();
});
onUnmounted(() => {
@@ -588,23 +624,28 @@ const applyExpert = () => {
};
const contactService = () => {
const cs = platformConfigs.value.customer_service || {};
const hotline = cs.hotline || '400-888-6666';
const wechat = cs.wechat || 'peiwan_vip_kefu';
const cleanPhone = hotline.replace(/[^\d]/g, '');
uni.showActionSheet({
itemList: [
'拨打 7x24h 官方服务热线 (400-888-6666)',
'复制平台 VIP 客服微信号 (peiwan_vip_kefu)',
`拨打官方服务热线 (${hotline})`,
`复制平台 VIP 客服微信号 (${wechat})`,
'查看平台官方安全指引'
],
success: (res) => {
if (res.tapIndex === 0) {
uni.makePhoneCall({
phoneNumber: '4008886666',
phoneNumber: cleanPhone,
fail: () => {
uni.showToast({ title: '服务热线: 400-888-6666', icon: 'none' });
uni.showToast({ title: `服务热线: ${hotline}`, icon: 'none' });
}
});
} else if (res.tapIndex === 1) {
uni.setClipboardData({
data: 'peiwan_vip_kefu',
data: wechat,
success: () => {
uni.showToast({ title: '官方客服微信号已复制', icon: 'success' });
}
@@ -617,9 +658,16 @@ const contactService = () => {
};
const openNotice = () => {
const notice = platformConfigs.value.safety_notice || {};
const title = notice.title || '平台官方公告与指引';
let content = '【安全履约须知】\n1. 为保障搭子与陪伴师人身与财产安全,线下约局须在合规公开商业街区进行。\n2. 现场碰面后请出示 4 位数字核销码进行签到确认。\n3. 平台提供 7x24 小时争议仲裁与资金托管保障服务。';
if (Array.isArray(notice.points) && notice.points.length > 0) {
content = notice.points.map((p, idx) => `${idx + 1}. ${p}`).join('\n');
}
uni.showModal({
title: '平台官方公告与指引',
content: '【安全履约须知】\n1. 为保障搭子与陪伴师人身与财产安全,线下约局须在合规公开商业街区进行。\n2. 现场碰面后请出示 4 位数字核销码进行签到确认。\n3. 平台提供 7x24 小时争议仲裁与资金托管保障服务。',
title,
content,
showCancel: false,
confirmText: '我知道了',
confirmColor: '#6366F1'
@@ -627,12 +675,13 @@ const openNotice = () => {
};
const openAbout = () => {
const proto = platformConfigs.value.platform_protocol || {};
if (privacyModalRef.value && privacyModalRef.value.show) {
privacyModalRef.value.show();
} else {
uni.showModal({
title: '用户服务协议与隐私规范',
content: '严禁发布任何违规言论及低俗诈骗行为,平台全面遵循微信内容安全风控与用户隐私保护标准。',
title: proto.title || '用户服务协议与隐私规范',
content: proto.content || proto.summary || '严禁发布任何违规言论及低俗诈骗行为,平台全面遵循微信内容安全风控与用户隐私保护标准。',
showCancel: false
});
}