detail.vue 5.0 KB

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