feat 个人中心_帮助中心整改

This commit is contained in:
Ironsp
2026-10-13 15:56:12 +08:00
parent 77dbabb1f1
commit 367380e44c
3 changed files with 114 additions and 68 deletions

View File

@@ -1,36 +1,50 @@
<script setup lang="ts">
import type { HelpFaqGroup } from '@/types/business/profile'
import { computed } from 'vue'
import type { HelpFaqGroup, HelpFaqItem } from '@/types/business/profile'
interface Props {
groups: HelpFaqGroup[]
}
defineProps<Props>()
const props = defineProps<Props>()
const questions = computed<HelpFaqItem[]>(() =>
props.groups.flatMap((group) => group.items),
)
</script>
<template>
<div class="help-faq">
<section
v-for="(group, gi) in groups"
:key="group.title"
class="help-faq__group"
>
<h3 class="help-faq__group-title">
{{ gi + 1 }}、{{ group.title }}
</h3>
<div
v-for="item in group.items"
<aside class="help-faq__aside">
<p
v-for="item in questions"
:key="item.q"
class="help-faq__item"
class="help-faq__q"
>
<p class="help-faq__q">
Q: {{ item.q }}
</p>
<p class="help-faq__a text-secondary">
{{ item.a }}
</p>
Q: {{ item.q }}
</p>
</aside>
<div class="help-faq__main">
<div class="help-faq__main-inner">
<section
v-for="(group, gi) in groups"
:key="group.title"
class="help-faq__group"
>
<h3 class="help-faq__group-title">
{{ gi + 1 }}、{{ group.title }}
</h3>
<p
v-for="item in group.items"
:key="`${group.title}-${item.q}`"
class="help-faq__a"
>
{{ item.a }}
</p>
</section>
</div>
</section>
</div>
<p v-if="groups.length === 0" class="help-faq__empty text-secondary">
暂无常见问题
@@ -40,48 +54,79 @@ defineProps<Props>()
<style lang="less" scoped>
.help-faq {
.flex(column, flex-start);
display: grid;
grid-template-columns: max-content 1fr;
column-gap: @spacing-xxl;
align-items: start;
width: 100%;
min-width: 0;
&__aside {
.flex(column, flex-start, flex-start);
gap: @spacing-xl;
text-align: left;
}
&__q {
margin: 0;
font-size: @font-size-base;
font-weight: 600;
color: @heading-color;
line-height: 1.6;
text-align: left;
white-space: nowrap;
}
&__main {
display: flex;
justify-content: center;
align-items: flex-start;
width: 100%;
min-width: 0;
box-sizing: border-box;
}
&__main-inner {
width: 100%;
max-width: 480px;
margin: 0 auto;
text-align: center;
}
&__group {
.flex(column, flex-start, center);
gap: @spacing-base;
width: 100%;
& + & {
margin-top: @spacing-xl;
margin-top: @spacing-xxl;
}
}
&__group-title {
margin: 0;
width: 100%;
font-size: @font-size-base;
font-weight: 600;
color: @heading-color;
line-height: 1.4;
text-align: left;
}
&__item {
margin-top: @spacing-base;
padding: @spacing-base;
border-radius: @radius-base;
background: @bg-color-light;
}
&__q {
font-size: @font-size-base;
font-weight: 600;
color: @heading-color;
line-height: 1.4;
text-align: center;
}
&__a {
margin: @spacing-sm 0 0;
margin: 0;
width: 100%;
font-size: @font-size-sm;
line-height: 1.6;
line-height: 1.8;
color: @text-color-secondary;
text-align: center;
}
&__empty {
grid-column: 1 / -1;
padding: @spacing-xxl 0;
text-align: center;
font-size: 13px;
font-size: @font-size-sm;
}
}
</style>

View File

@@ -37,11 +37,11 @@ onMounted(() => {
&__title {
position: relative;
padding-left: 12px;
font-size: 14px;
font-weight: 700;
color: @heading-color;
line-height: 20px;
padding-left: 14px;
font-size: @font-size-base;
font-weight: 600;
color: @profile-ink;
line-height: 1.4;
&::before {
content: '';