Files
JayuCloud/JC-Salon-Frontend/src/views/SettingsView.vue
T

259 lines
6.0 KiB
Vue

<template>
<div class="mobile-container">
<header class="header">
<a-button class="back-btn" type="text" @click="handleBackClick">
<LeftOutlined :style="{ fontSize: '20px' }" />
</a-button>
<h1>设置中心</h1>
<div class="empty"></div>
</header>
<div class="settings-menu">
<a-card :bordered="false" class="settings-card">
<a-list :data-source="settingsSections" :split="false">
<template #renderItem="{ item }">
<a-list-item v-if="item.type === 'title'" class="section-title">
<span>{{ item.title }}</span>
</a-list-item>
<a-list-item v-else class="setting-item" @click="handleSettingClick(item.key)">
<template #actions>
<RightOutlined />
</template>
<a-list-item-meta>
<template #avatar>
<div class="setting-icon" :style="{ backgroundColor: item.bgColor }">
<component :is="item.icon" />
</div>
</template>
<template #title>
<span>{{ item.title }}</span>
</template>
<template #description>
<span>{{ item.desc }}</span>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</a-card>
</div>
<div class="version-info">
<a-typography-text type="secondary">版本 0.0.1</a-typography-text>
</div>
</div>
</template>
<script setup lang="ts">
/**
* SettingsView page script.
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
*/
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import {
LeftOutlined,
LockOutlined,
RightOutlined,
} from '@ant-design/icons-vue'
/**
* Purpose: router supports SettingsView.vue by holding or executing the router page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const router = useRouter()
/** settingsSections is a reactive state variable used by the template and event handlers. */
const settingsSections = ref([
{
type: 'title',
title: '账号与安全'
},
{
key: 'account',
title: '账号设置',
desc: '管理手机号、登录密码和账号安全',
icon: LockOutlined,
bgColor: 'var(--theme-primary-soft)'
}
])
/** handleBackClick is a local helper used by this page script. */
const handleBackClick = () => {
router.back()
}
/** handleSettingClick is a local helper used by this page script. */
const handleSettingClick = (key: string) => {
if (key === 'account') {
router.push('/settings/account')
return
}
}
</script>
<style scoped>
.mobile-container {
min-height: 100vh;
padding-top: 60px;
background:
linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.92)),
var(--theme-background-image),
var(--theme-page-bg);
background-size: cover, cover, auto;
background-position: center top;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
justify-content: space-between;
align-items: center;
height: 60px;
padding: 10px 15px;
background: rgba(255, 255, 255, 0.92);
border-bottom: 1px solid var(--theme-border);
backdrop-filter: blur(14px);
}
.header h1 {
font-size: 18px;
font-weight: bold;
margin: 0;
color: var(--text-primary);
}
.back-btn,
.empty {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.settings-menu {
padding: 15px;
}
.settings-card {
border-radius: 16px;
overflow: hidden;
background: var(--theme-card-bg);
border: 1px solid var(--theme-border);
box-shadow: 0 14px 34px rgba(122, 67, 88, 0.08);
}
.settings-card :deep(.ant-card-body) {
padding: 0;
}
.section-title {
padding: 12px 16px;
font-size: 13px;
color: var(--theme-accent);
background: var(--theme-primary-soft);
}
.setting-item {
padding: 16px;
cursor: pointer;
transition: background 0.3s;
border-bottom: 1px solid var(--theme-border);
}
.setting-item:hover {
background: var(--theme-primary-soft);
}
.setting-item:last-child {
border-bottom: none;
}
.setting-item :deep(.ant-list-item-action) {
margin-left: 8px;
color: var(--text-secondary);
}
.setting-icon {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: var(--theme-primary);
}
.setting-item :deep(.ant-list-item-meta-title) {
font-size: 15px;
font-weight: 500;
color: var(--text-primary);
}
.setting-item :deep(.ant-list-item-meta-description) {
font-size: 12px;
color: var(--text-secondary);
}
.version-info {
padding: 20px;
text-align: center;
}
.mobile-container {
padding-top: 68px;
background:
radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--theme-primary) 28%, transparent), transparent 32%),
linear-gradient(180deg, color-mix(in srgb, var(--theme-card-bg) 78%, transparent), var(--theme-page-bg));
}
.header {
height: 64px;
padding: 12px 18px 10px;
background: color-mix(in srgb, var(--theme-card-bg) 92%, transparent);
}
.header h1 {
font-size: 17px;
font-weight: 820;
}
.back-btn {
border-radius: 999px;
background: color-mix(in srgb, var(--theme-card-bg) 74%, transparent);
}
.settings-menu {
padding: 18px;
}
.settings-card {
border-radius: 24px;
background: color-mix(in srgb, var(--theme-card-bg) 90%, transparent);
box-shadow: 0 20px 42px color-mix(in srgb, var(--theme-neutral) 9%, transparent);
}
.section-title {
color: var(--theme-primary-action);
background: color-mix(in srgb, var(--theme-primary) 18%, var(--theme-card-bg));
font-weight: 800;
}
.setting-item {
padding: 18px 16px;
}
.setting-icon {
border-radius: 14px;
color: var(--theme-primary-action);
background: color-mix(in srgb, var(--theme-primary) 22%, var(--theme-card-bg)) !important;
}
</style>