index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="page">
  3. <div class="page-top"></div>
  4. <div class="page-content">
  5. <keep-alive>
  6. <div class="list">
  7. <div
  8. class="section flex flex-col justify-center items-center rounded-md"
  9. v-for="item in list"
  10. :key="item.id"
  11. >
  12. <icon-image class="icon" :name="item.image"></icon-image>
  13. <div
  14. class="name mt-4"
  15. v-text="item.name"
  16. @click="toDetail(item)"
  17. ></div>
  18. </div>
  19. </div>
  20. </keep-alive>
  21. </div>
  22. <div class="page-footer flex flex-col justify-center">
  23. <div class="name mb-1">需要帮助吗?</div>
  24. <div class="contact">联系我们 +86 1382160616</div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. layout: 'app-ldm',
  31. data() {
  32. return {
  33. list: [],
  34. }
  35. },
  36. asyncData() {
  37. return {
  38. list: [
  39. {
  40. id: 0,
  41. name: '授权认证',
  42. image: 'ldm-icon-approve.png',
  43. path: '/ldm/approve',
  44. },
  45. {
  46. id: 1,
  47. name: '官方产品资料',
  48. image: 'ldm-icon-database.png',
  49. path: '/ldm/database/package',
  50. },
  51. ],
  52. }
  53. },
  54. methods: {
  55. toDetail(item) {
  56. const hasLogin = this.$store.getters.accessToken
  57. if (item.id > 0 && !hasLogin) {
  58. this.$toast({ message: '请先登录', duration: 1000 })
  59. this.$store.commit('app/SHOW_LOGIN')
  60. return
  61. }
  62. const authUserId = this.$store.getters.authUserId
  63. this.$router.push(`/${authUserId}${item.path}`)
  64. },
  65. },
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. @media screen and (min-width: 768px) {
  70. .page-top {
  71. height: 596px;
  72. background: url(https://static.caimei365.com/www/authentic/pc/ldm-bg-home.png)
  73. no-repeat center;
  74. background-size: auto 596px;
  75. }
  76. .page-content {
  77. width: 700px;
  78. margin: 0 auto;
  79. min-height: calc(100vh - 596px - 100px);
  80. overflow: hidden;
  81. .list {
  82. display: flex;
  83. align-items: center;
  84. justify-content: space-between;
  85. margin-top: 124px;
  86. margin-bottom: 314px;
  87. .section {
  88. .icon {
  89. width: 120px;
  90. height: 120px;
  91. }
  92. .name {
  93. width: 241px;
  94. height: 73px;
  95. background: #000;
  96. text-align: center;
  97. line-height: 73px;
  98. color: #fff;
  99. font-size: 22px;
  100. cursor: pointer;
  101. }
  102. }
  103. }
  104. }
  105. .page-footer {
  106. position: relative;
  107. height: 100px;
  108. padding-left: 194px;
  109. background: linear-gradient(to bottom, #f1f1f1, #fdfdfd, #f1f1f1);
  110. .name {
  111. font-size: 24px;
  112. color: #9d9d9d;
  113. }
  114. .contact {
  115. font-size: 19px;
  116. color: #9d9d9d;
  117. }
  118. &::before {
  119. position: absolute;
  120. left: 120px;
  121. top: 50%;
  122. transform: translateY(-50%);
  123. content: '';
  124. display: block;
  125. width: 56px;
  126. height: 56px;
  127. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-contact1.png)
  128. no-repeat center;
  129. background-size: 56px auto;
  130. }
  131. }
  132. }
  133. @media screen and (max-width: 768px) {
  134. .page-top {
  135. height: 59.6vw;
  136. background: url(https://static.caimei365.com/www/authentic/h5/ldm-bg-home.png);
  137. background-size: auto 59.6vw;
  138. }
  139. .page-content {
  140. min-height: calc(100vh - 59.6vw - 15.4vw);
  141. overflow: hidden;
  142. .list {
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. margin-top: 10.9vw;
  147. .section {
  148. display: block;
  149. width: 80vw;
  150. height: 48vw;
  151. background: #f8f8f8;
  152. border: 0.1vw solid #bfbfbf;
  153. margin-bottom: 5.8vw;
  154. .icon {
  155. width: 18.9vw;
  156. height: 18.9vw;
  157. }
  158. .name {
  159. width: 37.8vw;
  160. height: 11.4vw;
  161. background: #000;
  162. text-align: center;
  163. line-height: 11.4vw;
  164. color: #fff;
  165. }
  166. }
  167. }
  168. }
  169. .page-footer {
  170. position: relative;
  171. height: 15.4vw;
  172. padding-left: 12.5vw;
  173. background: linear-gradient(to bottom, #f1f1f1, #fdfdfd, #f1f1f1);
  174. .name {
  175. font-size: 3.2vw;
  176. color: #9d9d9d;
  177. }
  178. .contact {
  179. font-size: 2.6vw;
  180. color: #9d9d9d;
  181. }
  182. &::before {
  183. position: absolute;
  184. left: 2.4vw;
  185. top: 50%;
  186. transform: translateY(-50%);
  187. content: '';
  188. display: block;
  189. width: 7.5vw;
  190. height: 7.5vw;
  191. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-contact1.png)
  192. no-repeat center;
  193. background-size: 7.4vw auto;
  194. }
  195. }
  196. }
  197. </style>