helpCenter.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="sub-page">
  3. <TopBar title="帮助中心" show-back />
  4. <view class="px-4 pt-3">
  5. <!-- 角色提示 -->
  6. <view class="glass-card p-4">
  7. <view class="flex items-center">
  8. <view class="icon-chip mr-3">
  9. <text class="uni-icons uniui-person-filled chip-glyph"></text>
  10. </view>
  11. <view>
  12. <text class="meta-label">当前角色</text>
  13. <text class="role-text">{{ roleText }}</text>
  14. </view>
  15. </view>
  16. </view>
  17. <!-- 常见问题 -->
  18. <view class="glass-card">
  19. <view class="section-head">
  20. <view class="section-bar mr-2"></view>
  21. <text class="section-title flex-1">常见问题</text>
  22. </view>
  23. <view
  24. v-for="(faq, index) in roleFaqs"
  25. :key="faq.id"
  26. class="faq-row"
  27. >
  28. <view class="flex justify-between items-center" @click="toggleFaq(index)">
  29. <text class="faq-question flex-1 pr-2">{{ faq.question }}</text>
  30. <text
  31. class="uni-icons uniui-arrowdown faq-arrow transition-transform"
  32. :class="expandedIndex === index ? 'rotate-180' : ''"
  33. ></text>
  34. </view>
  35. <view v-if="expandedIndex === index" class="faq-answer">
  36. {{ faq.answer }}
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 联系客服 -->
  41. <view class="glass-card">
  42. <view class="section-head">
  43. <view class="section-bar mr-2"></view>
  44. <text class="section-title flex-1">联系客服</text>
  45. </view>
  46. <view class="contact-row" hover-class="row-hover" :hover-start-time="0" :hover-stay-time="120" @click="makePhoneCall('400-888-8888')">
  47. <view class="flex items-center">
  48. <text class="uni-icons uniui-phone contact-icon mr-3"></text>
  49. <text class="contact-label">客服热线</text>
  50. </view>
  51. <text class="contact-value">400-888-8888</text>
  52. </view>
  53. <view class="contact-row">
  54. <view class="flex items-center">
  55. <text class="uni-icons uniui-email contact-icon mr-3"></text>
  56. <text class="contact-label">电子邮箱</text>
  57. </view>
  58. <text class="contact-plain">service@qingdaofu.com</text>
  59. </view>
  60. <view class="contact-row">
  61. <view class="flex items-center">
  62. <text class="uni-icons uniui-clock-filled contact-icon mr-3"></text>
  63. <text class="contact-label">服务时间</text>
  64. </view>
  65. <text class="contact-plain">9:00-18:00</text>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script setup lang="ts">
  72. import { ref, computed } from 'vue'
  73. import TopBar from '@/components/common/TopBar.vue'
  74. import { useAuthStore } from '@/stores/auth'
  75. import { useCommonStore } from '@/stores/common'
  76. import { getRoleText } from '@/utils'
  77. const authStore = useAuthStore()
  78. const commonStore = useCommonStore()
  79. const role = computed(() => authStore.userRole || 'sales')
  80. const roleText = computed(() => getRoleText(role.value))
  81. const roleFaqs = computed(() => {
  82. return commonStore.faqs.filter((faq) => faq.category === role.value || faq.category === 'common')
  83. })
  84. const expandedIndex = ref<number | null>(null)
  85. function toggleFaq(index: number) {
  86. expandedIndex.value = expandedIndex.value === index ? null : index
  87. }
  88. function makePhoneCall(phone: string) {
  89. uni.makePhoneCall({ phoneNumber: phone })
  90. }
  91. </script>
  92. <style scoped>
  93. .sub-page {
  94. max-width: 430px;
  95. margin: 0 auto;
  96. min-height: 100vh;
  97. background-color: #f6fbf9;
  98. padding-bottom: 24px;
  99. }
  100. .glass-card {
  101. background-color: rgba(255, 255, 255, 0.85);
  102. backdrop-filter: blur(14px);
  103. -webkit-backdrop-filter: blur(14px);
  104. border: 1px solid rgba(164, 216, 152, 0.35);
  105. border-radius: 24px;
  106. box-shadow: 0 18px 50px -12px rgba(54, 143, 111, 0.28);
  107. overflow: hidden;
  108. margin-bottom: 12px;
  109. }
  110. .icon-chip {
  111. width: 42px;
  112. height: 42px;
  113. border-radius: 50%;
  114. flex-shrink: 0;
  115. display: flex;
  116. align-items: center;
  117. justify-content: center;
  118. background-color: rgba(164, 216, 152, 0.2);
  119. }
  120. .chip-glyph {
  121. font-size: 20px;
  122. color: #368f6f;
  123. }
  124. .meta-label {
  125. display: block;
  126. font-size: 12px;
  127. color: #9ca3af;
  128. }
  129. .role-text {
  130. display: block;
  131. font-size: 16px;
  132. font-weight: 700;
  133. color: #1f2937;
  134. }
  135. .section-head {
  136. display: flex;
  137. align-items: center;
  138. padding: 16px 16px 12px;
  139. }
  140. .section-bar {
  141. width: 4px;
  142. height: 16px;
  143. border-radius: 2px;
  144. background: linear-gradient(180deg, #368f6f 0%, #5ab8d0 100%);
  145. }
  146. .section-title {
  147. font-size: 16px;
  148. font-weight: 700;
  149. color: #1f2937;
  150. }
  151. .faq-row {
  152. padding: 13px 16px;
  153. border-top: 1px solid rgba(164, 216, 152, 0.18);
  154. }
  155. .faq-question {
  156. font-size: 14px;
  157. color: #4b5563;
  158. }
  159. .faq-arrow {
  160. font-size: 12px;
  161. color: #9ca3af;
  162. }
  163. .faq-answer {
  164. margin-top: 10px;
  165. padding: 10px 12px;
  166. border-radius: 12px;
  167. font-size: 13px;
  168. line-height: 1.7;
  169. color: #6b7280;
  170. background-color: rgba(164, 216, 152, 0.12);
  171. }
  172. .contact-row {
  173. display: flex;
  174. align-items: center;
  175. justify-content: space-between;
  176. padding: 13px 16px;
  177. border-top: 1px solid rgba(164, 216, 152, 0.18);
  178. }
  179. .row-hover {
  180. background-color: rgba(164, 216, 152, 0.1);
  181. }
  182. .contact-icon {
  183. font-size: 16px;
  184. color: #368f6f;
  185. }
  186. .contact-label {
  187. font-size: 14px;
  188. color: #4b5563;
  189. }
  190. .contact-value {
  191. font-size: 14px;
  192. font-weight: 600;
  193. color: #368f6f;
  194. }
  195. .contact-plain {
  196. font-size: 14px;
  197. color: #6b7280;
  198. }
  199. </style>