|
@@ -39,7 +39,7 @@
|
|
|
<!-- 搜索结果列表 -->
|
|
|
<div v-if="searchResults.length > 0" class="search-results question-list">
|
|
|
<h2>
|
|
|
- <span>{{
|
|
|
+ <span style="flex: 1; padding-right: 16px; padding-right: 1rem; line-height: 1.3">{{
|
|
|
$t('questionPage["searchResultTitle"]', { count: searchResults.length })
|
|
|
}}</span>
|
|
|
<div class="category-menu-btn" @click="showCategoryDrawer">
|
|
@@ -56,37 +56,41 @@
|
|
|
<div class="question-title">
|
|
|
{{ item.title }}
|
|
|
</div>
|
|
|
- <div class="question-preview">{{ item.preview }}</div>
|
|
|
+ <div class="question-preview" v-html="item.content"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 问题列表 -->
|
|
|
<div v-else class="question-list">
|
|
|
<h2>
|
|
|
- <span>{{ getCategoryName(activeCategory) }}</span>
|
|
|
+ <span style="flex: 1; padding-right: 16px; padding-right: 1rem; line-height: 1.3">{{
|
|
|
+ activeCategoryInfo ? activeCategoryInfo.name : ''
|
|
|
+ }}</span>
|
|
|
<div class="category-menu-btn" @click="showCategoryDrawer">
|
|
|
<span>{{ $t('questionPage["questionCategoryMenuBtn"]') }}</span>
|
|
|
<img src="@/public/images/icons/menu_icon.png" alt="" />
|
|
|
</div>
|
|
|
</h2>
|
|
|
|
|
|
- <div
|
|
|
- v-for="question in questionList"
|
|
|
- :key="question.id"
|
|
|
- class="question-item"
|
|
|
- @click="showQuestionDetail(question)"
|
|
|
- >
|
|
|
- <div class="question-title">
|
|
|
- {{ question.title }}
|
|
|
- <div v-if="question.isHot" class="question-tag hot-tag">
|
|
|
- {{ $t('questionPage["questionTagHot"]') }}
|
|
|
- </div>
|
|
|
- <div v-if="question.isNew" class="question-tag new-tag">
|
|
|
- {{ $t('questionPage["questionTagNew"]') }}
|
|
|
+ <template v-if="activeCategoryInfo">
|
|
|
+ <div
|
|
|
+ v-for="(question, index) in activeCategoryInfo.lists"
|
|
|
+ :key="index"
|
|
|
+ class="question-item"
|
|
|
+ @click="showQuestionDetail(question)"
|
|
|
+ >
|
|
|
+ <div class="question-title">
|
|
|
+ {{ question.title }}
|
|
|
+ <!-- <div v-if="question.isHot" class="question-tag hot-tag">
|
|
|
+ {{ $t('questionPage["questionTagHot"]') }}
|
|
|
+ </div>
|
|
|
+ <div v-if="question.isNew" class="question-tag new-tag">
|
|
|
+ {{ $t('questionPage["questionTagNew"]') }}
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
+ <div class="question-preview" v-html="question.content"></div>
|
|
|
</div>
|
|
|
- <div class="question-preview">{{ question.preview }}</div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -118,21 +122,15 @@
|
|
|
|
|
|
<div class="detail-header">
|
|
|
<h2>{{ currentQuestion.title }}</h2>
|
|
|
- <div class="meta">
|
|
|
- <span>{{
|
|
|
- $t('system["updateTimeTxt"]', {
|
|
|
- updateTime: formatDate(currentQuestion.updateTime, locale),
|
|
|
- })
|
|
|
- }}</span>
|
|
|
- <span>{{
|
|
|
- $t('questionPage["questionReadCount"]', { count: currentQuestion.views })
|
|
|
- }}</span>
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="detail-content" v-html="currentQuestion.content"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="loading-box" v-show="isLoading">
|
|
|
+ <a-spin :spinning="isLoading" size="large" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 分类导航侧边抽屉 -->
|
|
@@ -151,12 +149,12 @@
|
|
|
v-for="category in categoryList"
|
|
|
:key="category.id"
|
|
|
class="category-item"
|
|
|
- :class="{ active: activeCategory === category.id }"
|
|
|
- @click="changeCategory(category.id)"
|
|
|
+ :class="{ active: activeCategoryId === category.id }"
|
|
|
+ @click="changeCategory(category)"
|
|
|
>
|
|
|
- {{ category.name }}
|
|
|
+ <label class="category-item__name">{{ category.name }}</label>
|
|
|
<span class="count">{{
|
|
|
- $t('questionPage["questionCategoryCountTxt"]', { count: category.count })
|
|
|
+ $t('questionPage["questionCategoryCountTxt"]', { count: category.lists.length })
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -167,22 +165,32 @@
|
|
|
<div class="question-main__container question-main-normal width-1200">
|
|
|
<!-- 左侧分类导航 -->
|
|
|
<div class="question-sidebar">
|
|
|
- <div
|
|
|
- v-for="category in categoryList"
|
|
|
- :key="category.id"
|
|
|
- class="category-item"
|
|
|
- :class="{ active: activeCategory === category.id }"
|
|
|
- @click="changeCategory(category.id)"
|
|
|
- >
|
|
|
- {{ category.name }}
|
|
|
- <span class="count">{{
|
|
|
- $t('questionPage["questionCategoryCountTxt"]', { count: category.count })
|
|
|
- }}</span>
|
|
|
- </div>
|
|
|
+ <a-skeleton-button
|
|
|
+ :active="true"
|
|
|
+ size="large"
|
|
|
+ shape="default"
|
|
|
+ block="true"
|
|
|
+ v-if="isLoading"
|
|
|
+ />
|
|
|
+ <template v-else>
|
|
|
+ <div
|
|
|
+ v-for="category in categoryList"
|
|
|
+ :key="category.id"
|
|
|
+ class="category-item"
|
|
|
+ :class="{ active: activeCategoryId === category.id }"
|
|
|
+ @click="changeCategory(category)"
|
|
|
+ >
|
|
|
+ <label class="category-item__name">{{ category.name }}</label>
|
|
|
+ <span class="count">{{
|
|
|
+ $t('questionPage["questionCategoryCountTxt"]', { count: category.lists.length })
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
|
|
|
<!-- 右侧内容 -->
|
|
|
<div class="question-content">
|
|
|
+ <!-- 问题列表 -->
|
|
|
<template v-if="!currentQuestion">
|
|
|
<!-- 搜索结果列表 -->
|
|
|
<div v-if="searchResults.length > 0" class="search-results">
|
|
@@ -199,25 +207,27 @@
|
|
|
|
|
|
<!-- 问题列表 -->
|
|
|
<div v-else class="question-list">
|
|
|
- <h2>{{ getCategoryName(activeCategory) }}</h2>
|
|
|
+ <h2>{{ activeCategoryInfo ? activeCategoryInfo.name : '' }}</h2>
|
|
|
|
|
|
- <div
|
|
|
- v-for="question in questionList"
|
|
|
- :key="question.id"
|
|
|
- class="question-item"
|
|
|
- @click="showQuestionDetail(question)"
|
|
|
- >
|
|
|
- <div class="question-title">
|
|
|
- {{ question.title }}
|
|
|
- <div v-if="question.isHot" class="question-tag hot-tag">
|
|
|
- {{ $t('questionPage["questionTagHot"]') }}
|
|
|
- </div>
|
|
|
- <div v-if="question.isNew" class="question-tag new-tag">
|
|
|
- {{ $t('questionPage["questionTagNew"]') }}
|
|
|
+ <template v-if="activeCategoryInfo">
|
|
|
+ <div
|
|
|
+ v-for="question in activeCategoryInfo.lists"
|
|
|
+ :key="question.id"
|
|
|
+ class="question-item"
|
|
|
+ @click="showQuestionDetail(question)"
|
|
|
+ >
|
|
|
+ <div class="question-title">
|
|
|
+ {{ question.title }}
|
|
|
+ <!-- <div v-if="question.isHot" class="question-tag hot-tag">
|
|
|
+ {{ $t('questionPage["questionTagHot"]') }}
|
|
|
+ </div>
|
|
|
+ <div v-if="question.isNew" class="question-tag new-tag">
|
|
|
+ {{ $t('questionPage["questionTagNew"]') }}
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
+ <div class="question-preview" v-html="question.content"></div>
|
|
|
</div>
|
|
|
- <div class="question-preview">{{ question.preview }}</div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -225,16 +235,6 @@
|
|
|
<div v-else class="question-detail">
|
|
|
<div class="detail-header">
|
|
|
<h2>{{ currentQuestion.title }}</h2>
|
|
|
- <div class="meta">
|
|
|
- <span>{{
|
|
|
- $t('system["updateTimeTxt"]', {
|
|
|
- updateTime: formatDate(currentQuestion.updateTime, locale),
|
|
|
- })
|
|
|
- }}</span>
|
|
|
- <span>{{
|
|
|
- $t('questionPage["questionReadCount"]', { count: currentQuestion.views })
|
|
|
- }}</span>
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="detail-content" v-html="currentQuestion.content"></div>
|
|
@@ -263,6 +263,10 @@
|
|
|
</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="loading-box" v-show="isLoading">
|
|
|
+ <a-spin :spinning="isLoading" size="large" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -285,7 +289,7 @@
|
|
|
</svg>
|
|
|
<div>
|
|
|
<strong>{{ $t('questionPage["contactForPhoneTitle"]') }}</strong>
|
|
|
- <p>400-888-9999</p>
|
|
|
+ <p>+852-30623063</p>
|
|
|
<p>{{ $t('questionPage["contactForPhoneWorkTime"]') }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -304,7 +308,7 @@
|
|
|
</svg>
|
|
|
<div>
|
|
|
<strong>{{ $t('questionPage["contactForEmailTitle"]') }}</strong>
|
|
|
- <p>support@example.com</p>
|
|
|
+ <p>vavabuy@163.com</p>
|
|
|
<p>{{ $t('questionPage["contactForEmailWorkTime"]') }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -315,8 +319,8 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
-import { storeToRefs } from 'pinia'
|
|
|
import { ref } from 'vue'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
import useSystemStore from '@/stores/useSystemStore'
|
|
|
import useData from './hooks/useData'
|
|
|
|
|
@@ -326,13 +330,12 @@ const { locale } = storeToRefs(systemStore)
|
|
|
|
|
|
const {
|
|
|
categoryList,
|
|
|
- activeCategory,
|
|
|
- questionList,
|
|
|
+ isLoading,
|
|
|
+ activeCategoryId,
|
|
|
+ activeCategoryInfo,
|
|
|
currentQuestion,
|
|
|
- questions,
|
|
|
searchQuery,
|
|
|
searchResults,
|
|
|
- getCategoryName,
|
|
|
changeCategory,
|
|
|
showQuestionDetail,
|
|
|
searchQuestions,
|
|
@@ -367,6 +370,13 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
margin: 0 auto 3.125rem;
|
|
|
}
|
|
|
|
|
|
+.loading-box {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+}
|
|
|
+
|
|
|
.width-1200 {
|
|
|
padding: 0 15px 60px;
|
|
|
padding: 0 0.9375rem 3.75rem;
|
|
@@ -439,13 +449,14 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
gap: 1.875rem;
|
|
|
|
|
|
.question-sidebar {
|
|
|
- width: 250px;
|
|
|
- width: 15.625rem;
|
|
|
- width: 250px;
|
|
|
- width: 15.625rem;
|
|
|
+ min-width: 250px;
|
|
|
+ min-width: 15.625rem;
|
|
|
+ max-width: 300px;
|
|
|
+ max-width: 18.75rem;
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
.category-item {
|
|
|
+ flex: 1;
|
|
|
padding: 12px 15px;
|
|
|
padding: 0.75rem 0.9375rem;
|
|
|
border-left: 4px solid transparent;
|
|
@@ -466,10 +477,21 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
.category-item.active {
|
|
|
border-left-color: var(--color-active);
|
|
|
background: #e3f2fd;
|
|
|
- font-weight: bold;
|
|
|
+ // font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .category-item__name {
|
|
|
+ flex: 1;
|
|
|
+ padding-right: 12px;
|
|
|
+ padding-right: 0.75rem;
|
|
|
+ /* white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis; */
|
|
|
}
|
|
|
|
|
|
.count {
|
|
|
+ min-width: 64px;
|
|
|
+ min-width: 4rem;
|
|
|
color: #757575;
|
|
|
font-size: 0.9rem;
|
|
|
}
|
|
@@ -533,8 +555,13 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
}
|
|
|
|
|
|
.question-preview {
|
|
|
+ max-height: 24px;
|
|
|
+ max-height: 1.5rem;
|
|
|
color: #666;
|
|
|
font-size: 0.9375rem;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
}
|
|
|
|
|
|
.question-tag {
|
|
@@ -570,16 +597,6 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
margin-bottom: 0.625rem;
|
|
|
text-align: center;
|
|
|
}
|
|
|
-
|
|
|
- .meta {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- gap: 15px;
|
|
|
- gap: 0.9375rem;
|
|
|
- color: #757575;
|
|
|
- font-size: 15px;
|
|
|
- font-size: 0.9375rem;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.detail-footer {
|
|
@@ -640,9 +657,16 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.question-main-normal {
|
|
|
+ position: relative;
|
|
|
+ min-height: 370px;
|
|
|
+}
|
|
|
+
|
|
|
.question-main-768 {
|
|
|
+ position: relative;
|
|
|
display: none;
|
|
|
padding-bottom: 0;
|
|
|
+ min-height: 320px;
|
|
|
}
|
|
|
|
|
|
.question-main__container-768 {
|
|
@@ -667,6 +691,7 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
+ align-items: flex-start;
|
|
|
margin-bottom: 8px;
|
|
|
margin-bottom: 0.5rem;
|
|
|
color: var(--color-active);
|
|
@@ -675,6 +700,8 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
}
|
|
|
|
|
|
.category-menu-btn {
|
|
|
+ min-width: 60px;
|
|
|
+ min-width: 3.75rem;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
color: #333;
|
|
@@ -798,6 +825,11 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
+.question-sidebar .ant-skeleton.ant-skeleton-element,
|
|
|
+.question-sidebar .ant-skeleton.ant-skeleton-element .ant-skeleton-button {
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
/* 富文本内容样式 */
|
|
|
.detail-content h3,
|
|
|
.detail-content h4 {
|
|
@@ -832,6 +864,11 @@ const formatDate = (dateString: string, lang: string) => {
|
|
|
margin: 0.5rem 0;
|
|
|
}
|
|
|
|
|
|
+.question-content img,
|
|
|
+.detail-content img {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
.payment-method {
|
|
|
margin: 20px 0;
|
|
|
margin: 1.25rem 0;
|