Notice.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <doc-header></doc-header>
  3. <div class="notice">
  4. <div class="notice-main">
  5. <div class="notice-main-tab">
  6. <div class="notice-main-tab-title">
  7. <img
  8. class="notice-main-tab-title-img"
  9. src="../../assets/images/order.png"
  10. alt=""
  11. />
  12. <div class="notice-main-tab-title-tip">站内消息</div>
  13. </div>
  14. <div
  15. v-for="(item, index) in tips"
  16. :key="index"
  17. class="notice-main-tab-panel"
  18. >
  19. {{ item.name }}
  20. </div>
  21. </div>
  22. <div class="notice-main-content">
  23. <div class="notice-main-title">常见问题</div>
  24. <div class="notice-main-line"></div>
  25. <div
  26. v-for="(item, index) in list"
  27. :key="index"
  28. class="notice-main-item"
  29. @click="link(item)"
  30. >
  31. <div class="article-title">{{ item.title }} </div>
  32. <div class="article-time">{{ item.update_time }}</div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <!-- 设计资源 -->
  38. <doc-footer></doc-footer>
  39. </template>
  40. <script lang="ts">
  41. import { defineComponent, onMounted, reactive, toRefs } from 'vue';
  42. import {
  43. onBeforeRouteUpdate,
  44. RouteLocationNormalized,
  45. useRoute,
  46. useRouter
  47. } from 'vue-router';
  48. import Header from '@/sites/doc/components/Header.vue';
  49. import { ApiService } from '@/sites/service/ApiService';
  50. import Footer from '@/sites/doc/components/Footer.vue';
  51. import { RefData } from '@/sites/assets/util/ref';
  52. export default defineComponent({
  53. name: 'doc',
  54. components: {
  55. [Header.name]: Header,
  56. [Footer.name]: Footer
  57. },
  58. setup() {
  59. const data = reactive({
  60. list: [],
  61. tips: [{ name: 'FAQ' }]
  62. });
  63. const router = useRouter();
  64. const watchDemoUrl = (router: RouteLocationNormalized) => {
  65. RefData.getInstance().currentRoute.value = router.name as string;
  66. };
  67. const link = (item: any) => {
  68. console.log(item);
  69. window.open(item.link);
  70. // router.push('/noticedetail');
  71. };
  72. // 文章列表接口
  73. const getFaq = () => {
  74. const apiService = new ApiService();
  75. apiService.getFaq().then((res) => {
  76. if (res?.state == 0) {
  77. data.list = res.value.data.arrays;
  78. }
  79. });
  80. };
  81. onMounted(() => {
  82. // 路由
  83. const route = useRoute();
  84. watchDemoUrl(route);
  85. getFaq();
  86. });
  87. onBeforeRouteUpdate((to) => {
  88. watchDemoUrl(to);
  89. });
  90. return {
  91. ...toRefs(data),
  92. link
  93. };
  94. }
  95. });
  96. </script>
  97. <style lang="scss" scoped>
  98. .notice {
  99. background: #f7f8fa;
  100. .notice-main {
  101. width: 1006px;
  102. margin: 30px auto;
  103. display: flex;
  104. justify-content: space-between;
  105. .notice-main-tab {
  106. width: 296px;
  107. height: 210px;
  108. background: rgba(255, 255, 255, 1);
  109. .notice-main-tab-title {
  110. margin: 19px 0 14px 22px;
  111. display: flex;
  112. align-items: center;
  113. .notice-main-tab-title-img {
  114. width: 13px;
  115. height: 14px;
  116. margin-right: 8px;
  117. display: block;
  118. }
  119. }
  120. .notice-main-tab-panel {
  121. padding: 14px 66px;
  122. width: 296px;
  123. height: 48px;
  124. background: rgba(250, 36, 0, 0.06);
  125. position: relative;
  126. &:after {
  127. content: '';
  128. display: inline-block;
  129. width: 10px;
  130. height: 22px;
  131. background: url('../../assets/images/item-rotate-active.png')
  132. no-repeat;
  133. position: absolute;
  134. left: 42px;
  135. }
  136. }
  137. }
  138. .notice-main-content {
  139. width: 696px;
  140. height: 747px;
  141. background: rgba(255, 255, 255, 1);
  142. padding: 16px 36px;
  143. .notice-main-title {
  144. line-height: 36px;
  145. font-size: 16px;
  146. font-family: PingFangSC;
  147. font-weight: 500;
  148. color: rgba(26, 26, 26, 1);
  149. }
  150. .notice-main-line {
  151. width: 644px;
  152. height: 1px;
  153. background: rgba(247, 248, 250, 1);
  154. margin: 11px auto 0;
  155. margin-bottom: 15px;
  156. }
  157. .notice-main-item {
  158. padding-top: 18px;
  159. height: 54px;
  160. border-bottom: 1px solid rgba(247, 248, 250, 1);
  161. &:hover {
  162. .article-title,
  163. .article-time {
  164. color: rgba(250, 36, 0, 1);
  165. }
  166. cursor: pointer;
  167. }
  168. .article-title {
  169. line-height: 20px;
  170. font-size: 14px;
  171. font-family: PingFangSC;
  172. font-weight: normal;
  173. color: rgba(26, 26, 26, 1);
  174. float: left;
  175. }
  176. .article-time {
  177. float: right;
  178. line-height: 17px;
  179. font-size: 12px;
  180. font-family: PingFangSC;
  181. font-weight: normal;
  182. color: rgba(154, 155, 157, 1);
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>