SsCommonProblem.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <script setup lang="ts">
  2. import {ref, defineEmits, onMounted} from 'vue'
  3. import {Refresh} from '@element-plus/icons-vue'
  4. import {useGlobalStore} from "@/stores/global";
  5. const emit = defineEmits(['finish', 'quickSend', 'loaded'])
  6. const global = useGlobalStore()
  7. const isRefresh = ref(false);
  8. const refresh = () => {
  9. isRefresh.value = true;
  10. global.loadCommonProblem('', () => {
  11. isRefresh.value = false;
  12. emit('finish')
  13. })
  14. }
  15. const quickSend = (msg: string) => {
  16. emit('quickSend', msg)
  17. }
  18. defineExpose({
  19. refresh
  20. });
  21. onMounted(() => {
  22. emit('loaded', 'footer')
  23. })
  24. </script>
  25. <template>
  26. <div class="problem hover-scale">
  27. <div class="problem-content">
  28. <div class="header">
  29. <el-image class="header-logo" src="/images/common_problem.png" fit="contain"/>
  30. <div class="header-content">
  31. <div class="header-title">常见问题</div>
  32. <div class="header-subject">聚焦商贸投资热点,回应企业民生关切</div>
  33. <el-button class="refresh is-mobile" :icon="Refresh" :loading="isRefresh" @click="refresh">
  34. 换一换
  35. </el-button>
  36. </div>
  37. </div>
  38. <div class="problem-list">
  39. <template v-for="(item, index) in global.commonProblem">
  40. <div class="problem-item ellipsis" @click="quickSend(item.questionContent)">
  41. {{ index + 1 }}.{{ item.questionContent }}
  42. </div>
  43. </template>
  44. </div>
  45. </div>
  46. <el-image class="problem-image is-pc" fit="contain" src="/images/bg01.png"/>
  47. <el-image class="problem-image is-mobile" fit="contain" src="/images/bg011.png"/>
  48. </div>
  49. </template>
  50. <style scoped lang="scss">
  51. .problem {
  52. border-radius: var(--border-radius);
  53. position: relative;
  54. overflow: hidden;
  55. color: #ffffff;
  56. background: linear-gradient(180deg, #5A92F8, #2943D6);
  57. box-shadow: 0 0.25rem 1.25rem 0 rgba(52, 149, 239, 0.4);
  58. min-height: 16rem;
  59. .problem-content {
  60. position: relative;
  61. z-index: 2;
  62. padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 1.25);
  63. .header {
  64. display: flex;
  65. align-items: center;
  66. margin-bottom: 2.45rem;
  67. .header-logo {
  68. width: 2.13rem;
  69. height: 2.13rem;
  70. margin-right: 0.5rem;
  71. }
  72. .header-content {
  73. width: calc(100% - 2.65rem);
  74. position: relative;
  75. .header-title {
  76. font-size: var(--body-font-size);
  77. font-weight: 600;
  78. margin-bottom: 0.3rem;
  79. line-height: 1.2em;
  80. cursor: pointer;
  81. }
  82. .header-subject {
  83. font-size: var(--small-font-size);
  84. font-weight: 400;
  85. line-height: 1.3em;
  86. cursor: pointer;
  87. }
  88. .refresh {
  89. position: absolute;
  90. right: 0;
  91. top: 0;
  92. padding: 0;
  93. line-height: 0.75rem;
  94. font-size: 0.75rem;
  95. height: 0.75rem;
  96. color: #FFEF7C;
  97. background-color: transparent;
  98. border: 0;
  99. }
  100. }
  101. }
  102. .problem-list {
  103. .problem-item {
  104. font-size: var(--small-font-size);
  105. line-height: 1.5em;
  106. margin-bottom: 0.65rem;
  107. cursor: pointer;
  108. padding-bottom: 0.1rem;
  109. min-height: var(--min-touch-target);
  110. display: flex;
  111. align-items: center;
  112. &:last-child {
  113. margin-bottom: 0;
  114. }
  115. &:hover {
  116. text-decoration: underline;
  117. }
  118. }
  119. }
  120. }
  121. .problem-image {
  122. position: absolute;
  123. bottom: 0;
  124. right: 1rem;
  125. width: 18rem;
  126. height: 10rem;
  127. z-index: 1;
  128. background-size: contain;
  129. }
  130. }
  131. /* 1080x1920 中等尺寸设备 - 垂直布局优化 */
  132. @media screen and (min-width: 751px) and (max-width: 1200px) and (min-height: 1700px) {
  133. .problem {
  134. min-height: 20rem;
  135. box-shadow: 0 0.5rem 1.5rem 0 rgba(52, 149, 239, 0.5);
  136. .problem-content {
  137. padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.75);
  138. .header {
  139. margin-bottom: 3rem;
  140. .header-logo {
  141. width: 3rem;
  142. height: 3rem;
  143. margin-right: 0.75rem;
  144. }
  145. .header-content {
  146. width: calc(100% - 3.75rem);
  147. .header-title {
  148. font-size: 1.75rem; /* 1.5rem → 1.75rem */
  149. margin-bottom: 0.5rem;
  150. }
  151. }
  152. }
  153. .problem-list {
  154. .problem-item {
  155. margin-bottom: 1rem;
  156. }
  157. }
  158. }
  159. .problem-image {
  160. width: 22rem;
  161. height: 12rem;
  162. }
  163. }
  164. }
  165. @media screen and (max-width: 750px) {
  166. .problem {
  167. .problem-content {
  168. .header {
  169. margin-bottom: 1.5rem;
  170. }
  171. }
  172. .problem-image {
  173. width: 7.94rem;
  174. height: 7.81rem;
  175. bottom: 1rem;
  176. right: 0.75rem;
  177. }
  178. }
  179. }
  180. </style>