index.vue 5.0 KB

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