detail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <div class="page-content">
  3. <div v-if="fileData" class="doc-header">
  4. <div class="info">
  5. <div class="cover">
  6. <doc-icon
  7. :type="fileData.fileType"
  8. :width="32"
  9. :height="32"
  10. :src="fileData.screenshot"
  11. />
  12. </div>
  13. <div class="content">
  14. <div class="name">{{ fileData.fileName }}</div>
  15. <div class="row">
  16. <span class="date">时间:{{ fileData.saveTime | dateFormat }}</span>
  17. <span class="size">大小:{{ fileData.fileSize | fileSize }}</span>
  18. </div>
  19. </div>
  20. </div>
  21. <div>
  22. <div @click="onDownload(fileData, $event)" class="download"></div>
  23. </div>
  24. </div>
  25. <div class="doc-content">
  26. <img v-if="fileType === 'image'" :src="fileData.ossUrl" alt="" />
  27. <video v-else-if="fileType === 'video'" :src="fileData.ossUrl" controls />
  28. <div v-else class="other">
  29. <doc-icon type="icon-other" :width="64" :height="64" />
  30. <div class="name">{{ fileData.fileName }}</div>
  31. <div class="download" @click="onDownload(fileData, $event)">
  32. 下载并打开
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import fileDetailMixin from '@/mixins/fileDetail'
  40. export default {
  41. layout: 'app-ldm',
  42. mixins: [fileDetailMixin],
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. @media screen and (min-width: 768px) {
  47. .page-content {
  48. width: 1000px;
  49. margin: 0 auto;
  50. background: #fff;
  51. margin-top: 16px;
  52. padding: 24px;
  53. box-sizing: border-box;
  54. }
  55. .doc-header {
  56. display: flex;
  57. justify-content: space-between;
  58. align-items: center;
  59. border-bottom: 1px solid #e8e8e8;
  60. padding-bottom: 26px;
  61. .download {
  62. width: 24px;
  63. height: 24px;
  64. background: url(~assets/theme-images/common/pc-icon-download.png)
  65. no-repeat center;
  66. background-size: 24px;
  67. cursor: pointer;
  68. &:hover {
  69. background-image: url(~assets/theme-images/common/pc-icon-download-hover.png);
  70. }
  71. }
  72. .info {
  73. display: flex;
  74. align-items: center;
  75. .cover {
  76. img {
  77. display: block;
  78. width: 48px;
  79. height: 48px;
  80. background: skyblue;
  81. }
  82. }
  83. .content {
  84. margin-left: 24px;
  85. .name {
  86. font-size: 16px;
  87. color: #282828;
  88. margin-bottom: 8px;
  89. }
  90. .date,
  91. .size {
  92. font-size: 14px;
  93. color: #999999;
  94. }
  95. .size {
  96. margin-left: 32px;
  97. }
  98. }
  99. }
  100. }
  101. .doc-content {
  102. display: flex;
  103. justify-content: center;
  104. img,
  105. video {
  106. display: block;
  107. max-height: 540px;
  108. // background: #000;
  109. margin-top: 40px;
  110. margin-bottom: 24px;
  111. }
  112. .other {
  113. display: flex;
  114. justify-content: center;
  115. align-items: center;
  116. flex-direction: column;
  117. height: 610px;
  118. .name {
  119. font-size: 16px;
  120. color: #666666;
  121. margin: 16px 0 24px;
  122. }
  123. .download {
  124. width: 88px;
  125. height: 36px;
  126. background: #bc1724;
  127. opacity: 1;
  128. border-radius: 2px;
  129. text-align: center;
  130. line-height: 36px;
  131. color: #ffffff;
  132. font-size: 14px;
  133. cursor: pointer;
  134. }
  135. }
  136. }
  137. }
  138. @media screen and (max-width: 768px) {
  139. .page-content {
  140. background: #fff;
  141. box-sizing: border-box;
  142. padding: 4vw;
  143. }
  144. .doc-header {
  145. display: flex;
  146. justify-content: space-between;
  147. align-items: center;
  148. border-bottom: 0.1vw solid #e8e8e8;
  149. padding-bottom: 4vw;
  150. .download {
  151. width: 6.4vw;
  152. height: 6.4vw;
  153. background: url(~assets/theme-images/common/pc-icon-download.png)
  154. no-repeat center;
  155. background-size: 6.4vw;
  156. cursor: pointer;
  157. &:hover {
  158. background-image: url(~assets/theme-images/common/pc-icon-download-hover.png);
  159. }
  160. }
  161. .info {
  162. display: flex;
  163. align-items: center;
  164. .cover {
  165. img {
  166. display: block;
  167. width: 12vw;
  168. height: 12vw;
  169. background: skyblue;
  170. }
  171. }
  172. .content {
  173. margin-left: 4vw;
  174. .name {
  175. font-size: 3.6vw;
  176. color: #282828;
  177. margin-bottom: 1vw;
  178. }
  179. .date,
  180. .size {
  181. font-size: 3vw;
  182. color: #999999;
  183. }
  184. .size {
  185. margin-left: 4vw;
  186. }
  187. }
  188. }
  189. }
  190. .doc-content {
  191. display: flex;
  192. justify-content: center;
  193. img,
  194. video {
  195. display: block;
  196. width: 100%;
  197. // background: #000;
  198. margin-top: 4vw;
  199. }
  200. .other {
  201. display: flex;
  202. justify-content: center;
  203. align-items: center;
  204. flex-direction: column;
  205. height: 100vw;
  206. .name {
  207. font-size: 3.4vw;
  208. color: #666666;
  209. margin: 2.4vw 0 6.4vw;
  210. }
  211. .download {
  212. width: 32vw;
  213. height: 8.8vw;
  214. background: #bc1724;
  215. opacity: 1;
  216. border-radius: 0.2vw;
  217. text-align: center;
  218. line-height: 8.8vw;
  219. color: #ffffff;
  220. font-size: 3.4vw;
  221. cursor: pointer;
  222. }
  223. }
  224. }
  225. }
  226. </style>