hookehuyr

refactor(profile): 移除设置菜单项并优化样式和配置

移除ProfilePage.vue中的设置菜单项,删除UsernameSettingPage.vue中冗余的按钮样式类,并添加vant.config.js文件以集中管理Vant组件主题配置。同时,更新App.vue以应用新的主题配置。
......@@ -9,6 +9,8 @@
import { RouterView } from "vue-router";
import { provideAuth } from "@/contexts/auth";
import { provideCart } from "@/contexts/cart";
import { ConfigProvider as VanConfigProvider } from 'vant';
import { themeVars } from './vant.config';
// 会根据配置判断是否显示调试控件
// eslint-disable-next-line no-unused-vars
import vConsole from "@/utils/vconsole";
......@@ -18,11 +20,13 @@ import { wxJsAPI } from "@/api/wx/config";
import { apiList } from "@/api/wx/jsApiList.js";
import { wxInfo, getUrlParams, stringifyQuery } from "@/utils/tools";
provideAuth(); // 提供全局认证状态
provideCart('single'); // 提供全局购物车状态,单一商品模式
</script>
<template>
<van-config-provider :theme-vars="themeVars">
<!-- 通过v-slot获取当前路由组件。使用component是为了实现动态组件渲染和加载状态的控制:当Component存在时渲染路由组件,不存在时显示加载动画。直接使用 -->
<router-view v-slot="{ Component }">
<div v-if="Component">
......@@ -35,6 +39,7 @@ provideCart('single'); // 提供全局购物车状态,单一商品模式
</div>
</div>
</router-view>
</van-config-provider>
</template>
<style>
......
/*
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-20 23:51:13
* @LastEditTime: 2025-03-24 13:52:52
* @FilePath: /mlaj/src/main.js
* @Description: 文件描述
*/
......@@ -10,7 +10,6 @@ import './style.css'
import App from './App.vue'
import router from './router'
import axios from '@/utils/axios';
import 'vant/lib/index.css'
const app = createApp(App)
......
/*
* @Date: 2025-03-24 13:44:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-24 13:54:49
* @FilePath: /mlaj/src/vant.config.js
* @Description: 文件描述
*/
// vant.config.js
export const themeVars = {
// 主题色
primaryColor: '#22c55e',
successColor: '#22c55e',
warningColor: '#f59e0b',
dangerColor: '#ef4444',
infoColor: '#3b82f6',
// 圆角
borderRadiusSm: '2px',
borderRadiusMd: '4px',
borderRadiusLg: '8px',
borderRadiusMax: '999px',
// 字体
fontSizeXs: '10px',
fontSizeSm: '12px',
fontSizeMd: '14px',
fontSizeLg: '16px',
// 按钮
buttonPrimaryBackground: '#22c55e',
buttonPrimaryBorderColor: '#22c55e',
buttonBorderRadius: 'var(--van-border-radius-lg)',
// 输入框
fieldLabelColor: '#374151',
fieldInputTextColor: '#111827',
fieldPlaceholderTextColor: '#9ca3af',
fieldErrorMessageColor: '#ef4444',
// Cell
cellBackgroundColor: 'transparent',
cellBorderColor: '#e5e7eb',
cellActiveColor: '#f3f4f6',
cellRequiredColor: '#ef4444',
cellLabelColor: '#374151',
cellValueColor: '#111827',
// 弹出层
popupBackgroundColor: '#ffffff',
popupCloseIconColor: '#9ca3af',
popupCloseIconActiveColor: '#6b7280'
};
......@@ -328,11 +328,6 @@ const menuItems3 = [
badge: "3",
},
{
icon: "settings",
title: "设置",
path: "/profile/settings",
},
{
icon: "question",
title: "帮助中心",
path: "/profile/help",
......
<!--
* @Date: 2025-03-24 13:04:21
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-24 13:33:27
* @LastEditTime: 2025-03-24 13:46:15
* @FilePath: /mlaj/src/views/profile/settings/UsernameSettingPage.vue
* @Description: 修改用户名页面
-->
......@@ -27,7 +27,6 @@
type="primary"
block
round
class="bg-green-500 hover:bg-green-600 transition-colors"
>
保存修改
</van-button>
......