_fileId.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. <!-- 面包屑 -->
  15. <el-breadcrumb separator-class="el-icon-arrow-right">
  16. <el-breadcrumb-item :to="{ path: `${routePrefix}/docs/0` }"
  17. >全部文件</el-breadcrumb-item
  18. >
  19. <template v-for="(item, index) in crumbList">
  20. <template v-if="index === crumbList.length - 1">
  21. <el-breadcrumb-item :key="item.id">
  22. <span class="cell">{{ item.fileName }}</span>
  23. </el-breadcrumb-item>
  24. </template>
  25. <template v-else>
  26. <el-breadcrumb-item
  27. :key="item.id"
  28. :to="{ path: `${routePrefix}/docs/${item.id}` }"
  29. >
  30. <span>{{ item.fileName | crumbFormat }}</span>
  31. </el-breadcrumb-item>
  32. </template>
  33. </template>
  34. </el-breadcrumb>
  35. <!-- 列表 -->
  36. <div class="list-header">
  37. <div class="row">
  38. <div class="col">文件名</div>
  39. <div class="col">时间</div>
  40. <div class="col">大小</div>
  41. <div class="col">操作</div>
  42. </div>
  43. </div>
  44. <div class="list-body">
  45. <div class="row" v-for="item in list" :key="item.id">
  46. <div class="section pc">
  47. <div class="col">
  48. <doc-icon :type="item.fileType" :src="item.screenshot" />
  49. <span
  50. class="file-name"
  51. @click="onRowClick(item)"
  52. v-text="item.fileName"
  53. ></span>
  54. </div>
  55. <div class="col">{{ item.saveTime | dateFormat }}</div>
  56. <div class="col">
  57. <span v-if="item.packageType > 0">{{
  58. item.fileSize | fileSize
  59. }}</span>
  60. <span v-else>-</span>
  61. </div>
  62. <div class="col control">
  63. <div class="download" @click="onDownload(item, $event)"></div>
  64. </div>
  65. </div>
  66. <div class="section mobile">
  67. <div class="col file-cover">
  68. <doc-icon :type="item.fileType" :src="item.screenshot" />
  69. </div>
  70. <div class="col file-content" @click="onRowClick(item)">
  71. <div class="file-name" v-if="item.fileType === 'article'">
  72. {{ item.fileName | fileNameFormat }}
  73. </div>
  74. <div class="file-name" v-else>{{ item.fileName }}</div>
  75. <div class="file-info">
  76. <span class="date">{{ item.saveTime | dateFormat }}</span>
  77. <span class="size">
  78. <span v-if="item.packageType > 0">{{
  79. item.fileSize | fileSize
  80. }}</span>
  81. <span v-else>-</span>
  82. </span>
  83. </div>
  84. </div>
  85. <div class="col control">
  86. <div class="download" @click="onDownload(item, $event)"></div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. import fileListMixin from '@/mixins/fileList'
  96. export default {
  97. layout: 'app-ldm',
  98. mixins: [fileListMixin],
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. /* scss中可以用mixin来扩展 */
  103. @mixin ellipsis($line: 1) {
  104. overflow: hidden;
  105. text-overflow: ellipsis;
  106. display: -webkit-box;
  107. -webkit-line-clamp: $line;
  108. -webkit-box-orient: vertical;
  109. }
  110. // pc 端
  111. @media screen and (min-width: 768px) {
  112. .page {
  113. margin-bottom: 16px;
  114. }
  115. .page-top {
  116. height: 466px;
  117. .logo {
  118. height: 61px;
  119. width: 311px;
  120. display: block;
  121. background: #fff;
  122. }
  123. .name {
  124. font-size: 19px;
  125. color: #221815;
  126. margin-top: 80px;
  127. text-align: center;
  128. line-height: 36px;
  129. text-transform: uppercase;
  130. }
  131. }
  132. .page-content {
  133. width: 1000px;
  134. margin: 0 auto;
  135. background-color: #fff;
  136. margin-top: 16px;
  137. box-sizing: border-box;
  138. overflow: hidden;
  139. padding: 32px 0;
  140. .el-breadcrumb {
  141. margin: 0 24px 32px;
  142. }
  143. .list-header,
  144. .list-body {
  145. font-size: 14px;
  146. color: #282828;
  147. .col {
  148. &:nth-child(1) {
  149. flex: 1;
  150. }
  151. &:nth-child(2),
  152. &:nth-child(3),
  153. &:nth-child(4) {
  154. width: 120px;
  155. text-align: center;
  156. }
  157. }
  158. }
  159. .list-header {
  160. .row {
  161. display: flex;
  162. justify-content: space-between;
  163. padding: 0 24px 16px;
  164. }
  165. }
  166. .list-body {
  167. .row {
  168. line-height: 70px;
  169. color: #666666;
  170. padding: 0 24px;
  171. transition: all 0.4s;
  172. &:hover {
  173. background: #fff1f2;
  174. }
  175. .section {
  176. display: flex;
  177. justify-content: space-between;
  178. border-top: 1px solid #f7f7f7;
  179. &.mobile {
  180. display: none;
  181. }
  182. }
  183. img {
  184. display: inline-block;
  185. width: 32px;
  186. height: 32px;
  187. background: #eee;
  188. margin-right: 24px;
  189. }
  190. .file-name {
  191. cursor: pointer;
  192. transition: all 0.4s;
  193. margin-left: 24px;
  194. &:hover {
  195. color: #bc1724;
  196. }
  197. }
  198. .control {
  199. display: flex;
  200. justify-content: center;
  201. align-items: center;
  202. .download {
  203. display: block;
  204. width: 24px;
  205. height: 24px;
  206. background: url(~assets/theme-images/common/pc-icon-download.png)
  207. no-repeat center;
  208. background-size: 24px;
  209. margin: 0 auto;
  210. cursor: pointer;
  211. &:hover {
  212. background-image: url(~assets/theme-images/common/pc-icon-download-hover.png);
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. // 移动 端
  221. @media screen and (max-width: 768px) {
  222. .page-top {
  223. height: 76.4vw;
  224. .logo {
  225. height: 11.5vw;
  226. width: 59vw;
  227. display: block;
  228. background: #fff;
  229. }
  230. .name {
  231. font-size: 3.5vw;
  232. color: #221815;
  233. margin-top: 15vw;
  234. text-align: center;
  235. line-height: 6.6vw;
  236. text-transform: uppercase;
  237. }
  238. }
  239. .page-content {
  240. position: relative;
  241. padding: 8vw 0;
  242. .el-breadcrumb {
  243. margin: 0 4vw 4vw;
  244. }
  245. .list-header {
  246. display: none;
  247. }
  248. .list-body {
  249. font-size: 3.6vw;
  250. color: #282828;
  251. .row {
  252. color: #666666;
  253. padding: 0 4vw;
  254. .section {
  255. display: flex;
  256. justify-content: space-between;
  257. align-items: center;
  258. border-bottom: 0.1vw solid #f7f7f7;
  259. height: 17.6vw;
  260. &.pc {
  261. display: none;
  262. }
  263. .file-cover {
  264. img {
  265. width: 8.8vw;
  266. height: 8.8vw;
  267. background: #eee;
  268. }
  269. }
  270. .file-content {
  271. flex: 1;
  272. margin: 0 4.8vw;
  273. .file-name {
  274. font-size: 3.6vw;
  275. @include ellipsis(1);
  276. }
  277. .file-info {
  278. font-size: 3vw;
  279. color: #999999;
  280. margin-top: 1.6vw;
  281. .size {
  282. margin-left: 4vw;
  283. }
  284. }
  285. }
  286. .control {
  287. width: 6.4vw;
  288. height: 6.4vw;
  289. .download {
  290. display: block;
  291. width: 6.4vw;
  292. height: 6.4vw;
  293. background: url(~assets/theme-images/common/h5-icon-download.png)
  294. no-repeat center;
  295. background-size: 6.4vw;
  296. margin: 0 auto;
  297. }
  298. }
  299. }
  300. }
  301. }
  302. }
  303. }
  304. </style>