Files
cz-web/src/views/profile/cpns/HelpFaq.vue
2026-09-24 09:09:47 +08:00

121 lines
2.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import type { HelpFaqGroup } from '@/types/business/profile'
interface Props {
groups: HelpFaqGroup[]
}
defineProps<Props>()
</script>
<template>
<div class="help-faq">
<details
v-for="group in groups"
:key="group.title"
class="help-faq__group"
open
>
<summary class="help-faq__summary">
{{ group.title }}
</summary>
<ul class="help-faq__list">
<li
v-for="item in group.items"
:key="item.q"
class="help-faq__item"
>
<p class="help-faq__q">
Q:{{ item.q }}
</p>
<p class="help-faq__a text-secondary">
A:{{ item.a }}
</p>
</li>
</ul>
</details>
<p v-if="groups.length === 0" class="help-faq__empty text-secondary">
暂无常见问题
</p>
</div>
</template>
<style lang="less" scoped>
.help-faq {
.flex(column, flex-start);
gap: @spacing-base;
&__group {
border-radius: @radius-lg;
background: @white;
box-shadow: @shadow-base;
overflow: hidden;
}
&__summary {
.flex(row, flex-start, center);
padding: @spacing-base @spacing-xl;
font-size: @font-size-lg;
font-weight: 600;
color: @heading-color;
cursor: pointer;
list-style: none;
transition: background 0.2s;
user-select: none;
&::-webkit-details-marker {
display: none;
}
&::after {
content: '▾';
margin-left: auto;
font-size: @font-size-base;
color: @text-color-secondary;
transition: transform 0.2s;
}
&:hover {
background: @bg-color-light;
}
}
&__group[open] > .help-faq__summary::after {
transform: rotate(180deg);
}
&__list {
.flex(column, flex-start);
gap: @spacing-base;
margin: 0;
padding: 0 @spacing-xl @spacing-lg;
list-style: none;
border-top: 1px solid @border-color;
}
&__item {
.flex(column, flex-start);
gap: @spacing-xs;
padding-top: @spacing-base;
}
&__q {
font-size: @font-size-base;
font-weight: 600;
color: @heading-color;
}
&__a {
font-size: @font-size-base;
line-height: 1.7;
}
&__empty {
padding: @spacing-xxl 0;
text-align: center;
font-size: @font-size-base;
}
}
</style>