hookehuyr

feat(config): 隐藏联系客服和意见反馈功能

- 添加 contactService 和 feedback 功能开关到 src/config/features.js
- 联系客服功能默认关闭,影响帮助中心页面的联系客服按钮和弹窗
- 意见反馈功能默认关闭,影响我的页面的意见反馈菜单项
- 修复 mine/index.vue 中未使用的 index 变量导致的 ESLint 警告
......@@ -14,6 +14,53 @@
---
## [2026-02-13] - 功能开关配置
### 配置
- 添加功能开关到 `src/config/features.js`
- `contactService: false` - 隐藏帮助中心联系客服
- `feedback: false` - 隐藏我的页面意见反馈
- 帮助中心页面 (`src/pages/help-center/index.vue`):
- 导入 `features.js` 配置
- 使用 `v-if="features.contactService"` 控制联系客服显示
- 我的页面 (`src/pages/mine/index.vue`):
- 导入 `features.js` 配置
- 使用计算属性过滤菜单项
- 修改 `v-for` key 为 `item.key` 提高稳定性
### 修复
- 移除 TypeScript �型的 JSDoc 注释(`@type {boolean}`),修复 eslint 警告
**详细信息**
- **影响文件**: src/config/features.js, src/pages/help-center/index.vue, src/pages/mine/index.vue
- **技术栈**: Vue 3, Taro 4
- **测试状态**: 已通过 (pnpm lint + pnpm test)
- **备注**: 当功能开放时,只需在 features.js 中将对应开关改为 true 即可
---
### 配置
- 添加功能开关到 `src/config/features.js`
- `contactService: false` - 隐藏帮助中心联系客服
- `feedback: false` - 隐藏我的页面意见反馈
- 帮助中心页面 (`src/pages/help-center/index.vue`):
- 导入 `features.js` 配置
- 使用 `v-if="features.contactService"` 控制联系客服显示
- 我的页面 (`src/pages/mine/index.vue`):
- 导入 `features.js` 配置
- 使用计算属性过滤菜单项
- 修改 `v-for` key 为 `item.key` 提高稳定性
**详细信息**
- **影响文件**: src/config/features.js, src/pages/help-center/index.vue, src/pages/mine/index.vue
- **技术栈**: Vue 3, Taro 4
- **测试状态**: 已通过 (pnpm lint)
- **备注**: 当功能开放时,只需在 features.js 中将对应开关改为 true 即可
---
---
## [2026-02-13] - 首页标题样式调整
### 优化
......
......@@ -54,6 +54,20 @@ export const features = {
* - 当字段为布尔值时:此配置无效
*/
tabbarBadgeThreshold: 1
,
/**
* 联系客服功能
* @description 控制帮助中心页面的联系客服按钮和弹窗显示
* @default false - 默认关闭
*/
contactService: false,
/**
* 意见反馈功能
* @description 控制我的页面的意见反馈菜单项显示
* @default false - 默认关闭
*/
feedback: false
}
/**
......
......@@ -15,7 +15,9 @@
</view>
<!-- Contact Service -->
<!-- 通过 features.contactService 控制显示/隐藏 -->
<view
v-if="features.contactService"
class="flex items-center justify-between w-full bg-white rounded-[24rpx] p-[32rpx] mb-[40rpx] shadow-sm relative overflow-hidden"
@tap="showContactPopup = true"
>
......@@ -129,6 +131,7 @@ import { ref, computed } from 'vue'
import NavHeader from '@/components/navigation/NavHeader.vue'
import IconFont from '@/components/icons/IconFont.vue'
import SearchBar from '@/components/forms/SearchBar.vue'
import { features } from '@/config/features.js'
// Popup 状态
const showContactPopup = ref(false)
......
......@@ -52,7 +52,7 @@
<!-- Menu List -->
<!-- Added subtle styling to icons and softened the container -->
<view class="bg-white w-full rounded-[32rpx] shadow-sm mb-[40rpx] p-[16rpx]">
<view v-for="(item, index) in menuItems" :key="index"
<view v-for="item in menuItems" :key="item.key"
class="flex items-center justify-between p-[24rpx] rounded-[20rpx] active:bg-gray-50 transition-all duration-200"
@tap="handleMenuClick(item)">
<view class="flex items-center">
......@@ -98,6 +98,7 @@ import { useUserStore } from '@/stores/user'
import IconFont from '@/components/icons/IconFont.vue'
import TabBar from '@/components/navigation/TabBar.vue'
import NavHeader from '@/components/navigation/NavHeader.vue'
import { features } from '@/config/features.js'
import Taro, { useLoad, useDidShow } from '@tarojs/taro'
import defaultAvatar from '@/assets/images/icon/avatar.svg'
......@@ -137,7 +138,7 @@ useDidShow(() => {
// Modern Professional Palette
// Using subtle background colors for icons to add vitality without being "playful"
const menuItems = [
const rawMenuItems = [
{
key: 'plan',
title: '我的计划书',
......@@ -180,6 +181,17 @@ const menuItems = [
}
]
// 根据功能配置过滤菜单项
const menuItems = computed(() => {
return rawMenuItems.filter(item => {
// 如果配置了 feedback 关闭,过滤掉意见反馈菜单
if (item.key === 'feedback' && !features.feedback) {
return false
}
return true
})
})
const handleMenuClick = (item) => {
if (item.path) {
go(item.path)
......