detail.vue 5.1 KB

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