package.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <div class="page">
  3. <div class="page-top flex flex-col justify-center items-center">
  4. <img
  5. class="logo"
  6. src="https://static.caimei365.com/www/authentic/pc/ldm-logo-rect.png"
  7. />
  8. <div class="name mt-2">
  9. Bring you into a new era<br />
  10. of high-tech non-invasive beauty care
  11. </div>
  12. </div>
  13. <div class="page-content">
  14. <div class="list">
  15. <div
  16. class="section flex justify-between items-center"
  17. v-for="item in list"
  18. :key="item.fileId"
  19. >
  20. <div class="info">
  21. <div class="name" v-text="item.fileName"></div>
  22. <div class="download" @click="downloadLink(item)">点击下载</div>
  23. </div>
  24. </div>
  25. </div>
  26. <!-- 列表为空 -->
  27. <SimpleEmpty
  28. v-if="!total && !isRequest"
  29. description="敬请期待~"
  30. ></SimpleEmpty>
  31. <!-- 页码 -->
  32. <SimplePagination
  33. themeType="black"
  34. v-if="total > listQuery.pageSize"
  35. :total="total"
  36. :pageItems="listQuery.pageSize"
  37. @change="onPagiantionChange"
  38. ></SimplePagination>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import { mapGetters } from 'vuex'
  44. import downloadLink from '@/utils/download-link'
  45. export default {
  46. layout: 'app-ldm',
  47. data() {
  48. return {
  49. isRequest: true,
  50. listQuery: {
  51. fileType: 2,
  52. fileTitle: '',
  53. authUserId: '',
  54. pageNum: 1,
  55. pageSize: 4,
  56. },
  57. list: [],
  58. total: 0,
  59. }
  60. },
  61. computed: {
  62. ...mapGetters(['userInfo', 'supplierInfo']),
  63. },
  64. mounted() {
  65. this.fetchList()
  66. },
  67. methods: {
  68. // 下载方法
  69. downloadLink(item) {
  70. const url = `${process.env.BASE_URL}/download/file?ossName=${item.fileDownloadUrl}&fileName=${item.fileName}`
  71. downloadLink(url)
  72. },
  73. // 获取列表
  74. async fetchList() {
  75. try {
  76. this.listQuery.authUserId = this.userInfo.authUserId
  77. const res = await this.$http.api.getFileList(this.listQuery)
  78. this.list = res.data.list
  79. this.total = res.data.total
  80. } catch (error) {
  81. console.log(error)
  82. } finally {
  83. this.isRequest = false
  84. }
  85. },
  86. // 页码变化
  87. onPagiantionChange(index) {
  88. this.listQuery.pageNum = index
  89. this.fetchList()
  90. },
  91. },
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. /* scss中可以用mixin来扩展 */
  96. @mixin ellipsis($line: 1) {
  97. overflow: hidden;
  98. text-overflow: ellipsis;
  99. display: -webkit-box;
  100. -webkit-line-clamp: $line;
  101. -webkit-box-orient: vertical;
  102. }
  103. @media screen and (min-width: 768px) {
  104. .page-top {
  105. height: 466px;
  106. .logo {
  107. height: 61px;
  108. width: 311px;
  109. display: block;
  110. }
  111. .name {
  112. font-size: 19px;
  113. color: #221815;
  114. margin-top: 80px;
  115. text-align: center;
  116. line-height: 36px;
  117. text-transform: uppercase;
  118. }
  119. }
  120. .page-content {
  121. width: 973px;
  122. margin: 0 auto;
  123. .list {
  124. .section {
  125. position: relative;
  126. padding: 32px 16px;
  127. background: #fff;
  128. border-bottom: 1px solid #d8d8d8;
  129. &:first-child {
  130. border-top: 1px solid #d8d8d8;
  131. }
  132. .info {
  133. .name {
  134. width: 800px;
  135. font-size: 19px;
  136. color: #404040;
  137. line-height: 1.5;
  138. text-align: justify;
  139. @include ellipsis(1);
  140. }
  141. .download {
  142. position: absolute;
  143. right: 16px;
  144. bottom: 50%;
  145. transform: translateY(50%);
  146. font-size: 16px;
  147. color: #0080ed;
  148. cursor: pointer;
  149. &::after {
  150. content: '>';
  151. margin-left: 8px;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. @media screen and (max-width: 768px) {
  160. .page-top {
  161. height: 76.4vw;
  162. .logo {
  163. height: 11.5vw;
  164. width: 59vw;
  165. display: block;
  166. }
  167. .name {
  168. font-size: 3.5vw;
  169. color: #221815;
  170. margin-top: 15vw;
  171. text-align: center;
  172. line-height: 6.6vw;
  173. text-transform: uppercase;
  174. }
  175. }
  176. .page-content {
  177. .list {
  178. .section {
  179. position: relative;
  180. padding: 6vw 2.6vw;
  181. margin: 0 4vw;
  182. background: #fff;
  183. border-bottom: 0.1vw solid #d8d8d8;
  184. &:first-child {
  185. border-top: 0.1vw solid #d8d8d8;
  186. }
  187. .info {
  188. .name {
  189. width: 66vw;
  190. font-size: 3.6vw;
  191. color: #404040;
  192. line-height: 1.5;
  193. text-align: justify;
  194. @include ellipsis(1);
  195. }
  196. .download {
  197. position: absolute;
  198. right: 2.6vw;
  199. bottom: 50%;
  200. transform: translateY(50%);
  201. font-size: 3vw;
  202. color: #0080ed;
  203. cursor: pointer;
  204. &::after {
  205. content: '>';
  206. margin-left: 8px;
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. </style>