feat: 新增提审防审模式,隐藏发布及评论相关入口
本次新增由后台 virtualPayAudit 开关控制的审核模式,在该模式下: 1. 隐藏底部 Tab 栏的发布按钮 2. 隐藏空状态、分类页、个人页的发布入口 3. 隐藏帖子卡片、详情页、个人发布页的评论数及评价入口 4. 发布页在审核模式下直接拦截并跳转至首页 5. 详情页的用户评价及评价弹层在审核模式下隐藏,避免 UGC 判定
这个提交包含在:
@@ -52,7 +52,7 @@
|
||||
<image class="fc-post-card__stat-icon" :src="iconUrl('eye')" mode="aspectFit" />
|
||||
<text class="fc-post-card__stat-num">{{ post.views || 0 }}</text>
|
||||
</view>
|
||||
<view class="fc-post-card__stat">
|
||||
<view v-if="!isAudit" class="fc-post-card__stat">
|
||||
<image class="fc-post-card__stat-icon" :src="iconUrl('comment-gray')" mode="aspectFit" />
|
||||
<text class="fc-post-card__stat-num">{{ post.commentCount || 0 }}</text>
|
||||
</view>
|
||||
@@ -63,7 +63,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { iconUrl, categoryIconUrl } from '@/common/store/ui.js'
|
||||
import { iconUrl, categoryIconUrl, uiState } from '@/common/store/ui.js'
|
||||
import { fromNow, formatKm, assetUrl } from '@/common/utils/format.js'
|
||||
|
||||
export default {
|
||||
@@ -75,6 +75,13 @@ export default {
|
||||
compact: { type: Boolean, default: false },
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
* 是否处于提审防审模式(由后台 virtualPayAudit 开关统一控制)
|
||||
* @returns {boolean} true=审核中(隐藏评论数统计)
|
||||
*/
|
||||
isAudit() {
|
||||
return uiState.virtualPayAudit !== false
|
||||
},
|
||||
/** 相对发布时间描述 */
|
||||
timeText() {
|
||||
return fromNow(this.post.createdAt)
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
<view class="fc-tabbar">
|
||||
<view class="fc-tabbar__nav">
|
||||
<view
|
||||
v-for="(item, idx) in tabs"
|
||||
v-for="item in displayTabs"
|
||||
:key="item.path"
|
||||
class="fc-tabbar__item"
|
||||
:class="{
|
||||
'fc-tabbar__item--active': current === idx,
|
||||
'fc-tabbar__item--active': item.rawIndex === current,
|
||||
'fc-tabbar__item--primary': item.primary
|
||||
}"
|
||||
hover-class="none"
|
||||
@click="switchTo(item, idx)"
|
||||
@click="switchTo(item)"
|
||||
>
|
||||
<!-- 中间突出加号悬浮球(发布) -->
|
||||
<template v-if="item.primary">
|
||||
@@ -27,7 +27,7 @@
|
||||
<view class="fc-tabbar__icon">
|
||||
<image
|
||||
class="fc-tabbar__img"
|
||||
:src="iconUrl(current === idx ? item.active : item.icon)"
|
||||
:src="iconUrl(item.rawIndex === current ? item.active : item.icon)"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<!-- 未读通知红点/数字徽章 -->
|
||||
@@ -47,7 +47,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { iconUrl } from '@/common/store/ui.js'
|
||||
import { iconUrl, uiState } from '@/common/store/ui.js'
|
||||
import messageApi from '@/common/api/message.js'
|
||||
import { useUserStore } from '@/common/store/index.js'
|
||||
import { safeNavigateTo, safeRedirectTo } from '@/common/utils/nav.js'
|
||||
@@ -70,15 +70,32 @@ export default {
|
||||
return {
|
||||
unreadCount: 0,
|
||||
tabs: [
|
||||
{ text: '首页', icon: 'tab-home', active: 'tab-home-on', path: '/pages/index/index' },
|
||||
{ text: '分类', icon: 'tab-category', active: 'tab-category-on', path: '/pages/category/index' },
|
||||
{ text: '发布', icon: 'tab-post', active: 'tab-post-on', path: '/pages/post/create', primary: true },
|
||||
{ text: '通知', icon: 'tab-message', active: 'tab-message-on', path: '/pages/message/index', badgeKey: 'message' },
|
||||
{ text: '我的', icon: 'tab-mine', active: 'tab-mine-on', path: '/pages/mine/index' },
|
||||
{ text: '首页', icon: 'tab-home', active: 'tab-home-on', path: '/pages/index/index', rawIndex: 0 },
|
||||
{ text: '分类', icon: 'tab-category', active: 'tab-category-on', path: '/pages/category/index', rawIndex: 1 },
|
||||
{ text: '发布', icon: 'tab-post', active: 'tab-post-on', path: '/pages/post/create', primary: true, rawIndex: 2 },
|
||||
{ text: '通知', icon: 'tab-message', active: 'tab-message-on', path: '/pages/message/index', badgeKey: 'message', rawIndex: 3 },
|
||||
{ text: '我的', icon: 'tab-mine', active: 'tab-mine-on', path: '/pages/mine/index', rawIndex: 4 },
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
* 是否处于提审防审模式(由后台 virtualPayAudit 开关统一控制)
|
||||
* @returns {boolean} true=审核中(隐藏发布按钮); false=正常运营模式
|
||||
*/
|
||||
isAudit() {
|
||||
return uiState.virtualPayAudit !== false
|
||||
},
|
||||
/**
|
||||
* 实际渲染呈现的 Tab 项列表(审核模式下彻底隐藏加号发布球)
|
||||
* @returns {Array<Object>} 过滤后的 Tab 列表
|
||||
*/
|
||||
displayTabs() {
|
||||
if (this.isAudit) {
|
||||
return this.tabs.filter((t) => !t.primary && t.path !== '/pages/post/create')
|
||||
}
|
||||
return this.tabs
|
||||
},
|
||||
/**
|
||||
* 格式化未读角标文本(超过99显示99+)
|
||||
* @returns {string} 角标数字文本
|
||||
@@ -137,10 +154,9 @@ export default {
|
||||
* 切换底部导航目标页面
|
||||
* 杜绝 reLaunch 全局冷重启白屏,常驻 Tab 统一采用 safeRedirectTo 平滑切换
|
||||
* @param {Object} item 目标 Tab 配置对象
|
||||
* @param {number} idx 目标 Tab 索引
|
||||
*/
|
||||
switchTo(item, idx) {
|
||||
if (idx === this.current) return
|
||||
switchTo(item) {
|
||||
if (item.rawIndex === this.current) return
|
||||
|
||||
// 中间突出加号(发布):作为独立模态表单页推入,保留前序页面栈,支持原路返回
|
||||
if (item.primary) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户