feat(community,faq): support dynamic community topics, notice, and FAQ center
这个提交包含在:
@@ -21,6 +21,12 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 友圈置顶头条公告 (根据后台配置动态展示) -->
|
||||
<view class="community-notice-bar" v-if="communityNotice && communityNotice.title">
|
||||
<view class="notice-badge">{{ communityNotice.tag || '置顶公告' }}</view>
|
||||
<text class="notice-title-text">{{ communityNotice.title }}:{{ communityNotice.content }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 分类筛选栏 (高能矢量Tab标签与标准HOT角标) -->
|
||||
<view class="feed-tabs-wrap">
|
||||
<scroll-view class="feed-scroll" scroll-x :show-scrollbar="false">
|
||||
@@ -299,11 +305,20 @@ import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getPosts, createPost, likePost, getPostComments, addPostComment, applyPostParty, uploadImage } from '@/common/api.js';
|
||||
import { getPosts, createPost, likePost, getPostComments, addPostComment, applyPostParty, uploadImage, getPlatformConfigs } from '@/common/api.js';
|
||||
|
||||
const isLoading = ref(true);
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
const communityNotice = ref(null);
|
||||
const availableTopics = ref([
|
||||
'三里屯探店',
|
||||
'铜锅涮肉AA',
|
||||
'国服上分车队',
|
||||
'饭搭子招募',
|
||||
'工体纯K麦霸',
|
||||
'同城搭子招募'
|
||||
]);
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
@@ -334,6 +349,7 @@ onMounted(() => {
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
loadInitialCommunity();
|
||||
loadPlatformCommunityConfigs();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
@@ -342,6 +358,7 @@ onShow(() => {
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.hideTabBar({ animation: false, fail: () => {} });
|
||||
loadRemotePosts();
|
||||
loadPlatformCommunityConfigs();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -359,6 +376,22 @@ const loadRemotePosts = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const loadPlatformCommunityConfigs = async () => {
|
||||
try {
|
||||
const configs = await getPlatformConfigs();
|
||||
if (configs && typeof configs === 'object') {
|
||||
if (configs.community_notice && configs.community_notice.title) {
|
||||
communityNotice.value = configs.community_notice;
|
||||
}
|
||||
if (Array.isArray(configs.community_topics) && configs.community_topics.length > 0) {
|
||||
availableTopics.value = configs.community_topics.map((t) => t.name || t);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[Community] 获取平台话题公告异常降级:', e);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const feedTabs = ref([
|
||||
{ key: 'all', name: '全部推荐', icon: ICONS.gameAll, hot: false },
|
||||
@@ -588,15 +621,6 @@ const publishCategories = [
|
||||
{ key: 'highlight', name: '生活随笔' }
|
||||
];
|
||||
|
||||
const availableTopics = [
|
||||
'三里屯探店',
|
||||
'铜锅涮肉AA',
|
||||
'王者上分',
|
||||
'饭搭子招募',
|
||||
'KTV麦霸',
|
||||
'周末微醺'
|
||||
];
|
||||
|
||||
const newPostForm = ref({
|
||||
category: 'partner',
|
||||
content: '',
|
||||
@@ -865,6 +889,36 @@ const submitPublishPost = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
.community-notice-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(99, 102, 241, 0.12);
|
||||
border: 1px solid rgba(99, 102, 241, 0.3);
|
||||
border-radius: 12rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
gap: 12rpx;
|
||||
|
||||
.notice-badge {
|
||||
font-size: 20rpx;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
background: linear-gradient(135deg, #F43F5E, #FB7185);
|
||||
padding: 2rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.notice-title-text {
|
||||
font-size: 22rpx;
|
||||
color: #CBD5E1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.feed-tabs-wrap {
|
||||
margin-bottom: 24rpx;
|
||||
width: 100%;
|
||||
|
||||
@@ -129,6 +129,11 @@
|
||||
<text class="row-label">平台消息与通知</text>
|
||||
<image class="row-arrow-svg" :src="ICONS.chevronRight" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="list-row btn-active" @click="openFaq">
|
||||
<image class="row-svg" :src="ICONS.messageSquare" mode="aspectFit" />
|
||||
<text class="row-label">帮助中心与常见问题</text>
|
||||
<image class="row-arrow-svg" :src="ICONS.chevronRight" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="list-row btn-active" @click="openAbout">
|
||||
<image class="row-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<text class="row-label">平台规范与服务协议</text>
|
||||
@@ -674,6 +679,34 @@ const openNotice = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const openFaq = () => {
|
||||
const list = platformConfigs.value.faq_list || [];
|
||||
if (Array.isArray(list) && list.length > 0) {
|
||||
const questions = list.map((item, idx) => `${idx + 1}. ${item.question}`);
|
||||
uni.showActionSheet({
|
||||
itemList: questions,
|
||||
success: (res) => {
|
||||
const item = list[res.tapIndex];
|
||||
if (item) {
|
||||
uni.showModal({
|
||||
title: item.question,
|
||||
content: `【${item.category || '常见问题'}】\n${item.answer}`,
|
||||
showCancel: false,
|
||||
confirmText: '我知道了',
|
||||
confirmColor: '#6366F1'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '帮助中心与常见问题',
|
||||
content: '1. 什么是4位核销码?\n到达活动现场后出示给陪伴师或房主签到核销,保障真实履约。\n2. 如何申请退款?\n在未接单或未核销前可随时全额退款,或发起争议仲裁由官方判定。',
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const openAbout = () => {
|
||||
const proto = platformConfigs.value.platform_protocol || {};
|
||||
if (privacyModalRef.value && privacyModalRef.value.show) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户