_fileId.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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. ::v-deep {
  113. .el-breadcrumb {
  114. white-space: nowrap;
  115. overflow-y: scroll;
  116. padding-bottom: 16px;
  117. .el-breadcrumb__item {
  118. float: unset !important;
  119. }
  120. }
  121. }
  122. .page {
  123. margin-bottom: 16px;
  124. }
  125. .page-top {
  126. height: 466px;
  127. .logo {
  128. height: 61px;
  129. width: 311px;
  130. display: block;
  131. background: #fff;
  132. }
  133. .name {
  134. font-size: 19px;
  135. color: #221815;
  136. margin-top: 80px;
  137. text-align: center;
  138. line-height: 36px;
  139. text-transform: uppercase;
  140. }
  141. }
  142. .page-content {
  143. width: 1000px;
  144. margin: 0 auto;
  145. background-color: #fff;
  146. margin-top: 16px;
  147. box-sizing: border-box;
  148. overflow: hidden;
  149. padding: 32px 0;
  150. .el-breadcrumb {
  151. margin: 0 24px 32px;
  152. }
  153. .list-header,
  154. .list-body {
  155. font-size: 14px;
  156. color: #282828;
  157. .col {
  158. &:nth-child(1) {
  159. flex: 1;
  160. }
  161. &:nth-child(2),
  162. &:nth-child(3),
  163. &:nth-child(4) {
  164. width: 120px;
  165. text-align: center;
  166. }
  167. }
  168. }
  169. .list-header {
  170. .row {
  171. display: flex;
  172. justify-content: space-between;
  173. padding: 0 24px 16px;
  174. }
  175. }
  176. .list-body {
  177. .row {
  178. line-height: 70px;
  179. color: #666666;
  180. padding: 0 24px;
  181. transition: all 0.4s;
  182. &:hover {
  183. background: #fff1f2;
  184. }
  185. .section {
  186. display: flex;
  187. justify-content: space-between;
  188. border-top: 1px solid #f7f7f7;
  189. &.mobile {
  190. display: none;
  191. }
  192. }
  193. img {
  194. display: inline-block;
  195. width: 32px;
  196. height: 32px;
  197. background: #eee;
  198. margin-right: 24px;
  199. }
  200. .file-name {
  201. cursor: pointer;
  202. transition: all 0.4s;
  203. margin-left: 24px;
  204. &:hover {
  205. color: #bc1724;
  206. }
  207. }
  208. .control {
  209. display: flex;
  210. justify-content: center;
  211. align-items: center;
  212. .download {
  213. display: block;
  214. width: 24px;
  215. height: 24px;
  216. background: url(~assets/theme-images/common/pc-icon-download.png)
  217. no-repeat center;
  218. background-size: 24px;
  219. margin: 0 auto;
  220. cursor: pointer;
  221. &:hover {
  222. background-image: url(~assets/theme-images/common/pc-icon-download-hover.png);
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. // 移动 端
  231. @media screen and (max-width: 768px) {
  232. ::v-deep {
  233. .el-breadcrumb {
  234. white-space: nowrap;
  235. overflow-y: scroll;
  236. padding-bottom: 2.4vw;
  237. .el-breadcrumb__item {
  238. float: unset !important;
  239. }
  240. }
  241. }
  242. .page-top {
  243. height: 76.4vw;
  244. .logo {
  245. height: 11.5vw;
  246. width: 59vw;
  247. display: block;
  248. background: #fff;
  249. }
  250. .name {
  251. font-size: 3.5vw;
  252. color: #221815;
  253. margin-top: 15vw;
  254. text-align: center;
  255. line-height: 6.6vw;
  256. text-transform: uppercase;
  257. }
  258. }
  259. .page-content {
  260. position: relative;
  261. padding: 8vw 0;
  262. .el-breadcrumb {
  263. margin: 0 4vw 4vw;
  264. }
  265. .list-header {
  266. display: none;
  267. }
  268. .list-body {
  269. font-size: 3.6vw;
  270. color: #282828;
  271. .row {
  272. color: #666666;
  273. padding: 0 4vw;
  274. .section {
  275. display: flex;
  276. justify-content: space-between;
  277. align-items: center;
  278. border-bottom: 0.1vw solid #f7f7f7;
  279. height: 17.6vw;
  280. &.pc {
  281. display: none;
  282. }
  283. .file-cover {
  284. img {
  285. width: 8.8vw;
  286. height: 8.8vw;
  287. background: #eee;
  288. }
  289. }
  290. .file-content {
  291. flex: 1;
  292. margin: 0 4.8vw;
  293. .file-name {
  294. font-size: 3.6vw;
  295. @include ellipsis(1);
  296. }
  297. .file-info {
  298. font-size: 3vw;
  299. color: #999999;
  300. margin-top: 1.6vw;
  301. .size {
  302. margin-left: 4vw;
  303. }
  304. }
  305. }
  306. .control {
  307. width: 6.4vw;
  308. height: 6.4vw;
  309. .download {
  310. display: block;
  311. width: 6.4vw;
  312. height: 6.4vw;
  313. background: url(~assets/theme-images/common/h5-icon-download.png)
  314. no-repeat center;
  315. background-size: 6.4vw;
  316. margin: 0 auto;
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. </style>