uniapp,h5

uploadMgr.vue 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="container">
  3. <!-- 顶部按钮栏 -->
  4. <view class="button-bar">
  5. <button :class="{ 'active': isImageActive }" @click="switchTab('image')">图片</button>
  6. <button :class="{ 'active': isVideoActive }" @click="switchTab('video')">视频</button>
  7. <button :class="{ 'active': isFileActive }" @click="switchTab('file')">文件</button>
  8. </view>
  9. <!-- 根据选中的tab显示不同的下载管理界面 -->
  10. <view v-if="activeTab === 'image'">
  11. <!-- 这里是图片下载管理界面的内容 -->
  12. <view class="uni-list uni-common-mt">
  13. <uni-section title="上传列表" type="line">
  14. <uni-list v-for="(v, k) in imageDownloadList" :key="k">
  15. <uni-list-item clickable @click="onPlayListClick(v)">
  16. <template v-slot:header>
  17. <view class="slot-box">
  18. <image class="slot-image" :src="v.imSrc"></image>
  19. </view>
  20. </template>
  21. <template v-slot:body>
  22. <text class="slot-box slot-text">{{v.title}}</text>
  23. <!-- <text class="slot-box slot-text"></text> -->
  24. </template>
  25. <template v-slot:footer>
  26. <text class="slot-box slot-text-play">立即载入</text>
  27. </template>
  28. </uni-list-item>
  29. </uni-list>
  30. </uni-section>
  31. </view>
  32. </view>
  33. <view v-if="activeTab === 'video'">
  34. <!-- 这里是视频下载管理界面的内容 -->
  35. <view class="uni-list uni-common-mt">
  36. <uni-section title="上传列表" type="line">
  37. <uni-list v-for="(v, k) in videoDownloadList" :key="k">
  38. <uni-list-item @click="onPlayListClick(v)">
  39. <template v-slot:header>
  40. <view class="slot-box">
  41. <image class="slot-image" :src="v.imSrc"></image>
  42. </view>
  43. </template>
  44. <template v-slot:body>
  45. <text class="slot-box slot-text">{{v.title}}</text>
  46. <!-- <text class="slot-box slot-text"></text> -->
  47. </template>
  48. <template v-slot:footer>
  49. <button class="slot-box slot-text-play" @click="showDetile(v)">详情</button>
  50. </template>
  51. </uni-list-item>
  52. </uni-list>
  53. </uni-section>
  54. </view>
  55. </view>
  56. <view v-if="activeTab === 'file'">
  57. <!-- 这里是文件下载管理界面的内容 -->
  58. <view class="uni-list uni-common-mt">
  59. <uni-section title="上传列表" type="line">
  60. <uni-list v-for="(v, k) in fileDownloadList" :key="k">
  61. <uni-list-item clickable @click="onPlayListClick(v)">
  62. <template v-slot:header>
  63. <view class="slot-box">
  64. <image class="slot-image" :src="v.imSrc"></image>
  65. </view>
  66. </template>
  67. <template v-slot:body>
  68. <text class="slot-box slot-text">{{v.title}}</text>
  69. <!-- <text class="slot-box slot-text"></text> -->
  70. </template>
  71. <template v-slot:footer>
  72. <text class="slot-box slot-text-play">立即载入</text>
  73. </template>
  74. </uni-list-item>
  75. </uni-list>
  76. </uni-section>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. export default {
  83. data() {
  84. return {
  85. activeTab: 'video' ,// 默认显示图片下载管理界面
  86. videoDownloadList: [{
  87. title: '鞠婧祎视频 1 ',
  88. viSrc: 'https://afanai.top:8088/video/982789760.mp4',
  89. imSrc: 'https://afanai.top:8088/video/982789760frame.jpg',
  90. },
  91. {
  92. title: '鞠婧祎视频 2 ',
  93. viSrc: 'https://afanai.top:8088/video/428743782.mp4',
  94. imSrc: 'https://afanai.top:8088/video/428743782frame.jpg',
  95. }
  96. ],
  97. imageDownloadList: [],
  98. fileDownloadList: [],
  99. isImageActive: false,
  100. isVideoActive: true,
  101. isFileActive: false
  102. };
  103. },
  104. methods: {
  105. switchTab(tab) {
  106. this.activeTab = tab;
  107. this.isImageActive = tab == 'image';
  108. this.isVideoActive = tab == 'video';
  109. this.isFileActive = tab == 'file';
  110. },
  111. showDetile(v) {
  112. console.log(v);
  113. }
  114. }
  115. }
  116. </script>
  117. <style scoped>
  118. /* .downlod-container {
  119. display: flex;
  120. flex-direction: column;
  121. } */
  122. .button-bar {
  123. background-color: #ffffff;
  124. display: flex;
  125. justify-content: space-around;
  126. padding: 10px;
  127. }
  128. .button {
  129. border: 1px;
  130. border-radius: 2px;
  131. font-size: 28rpx;
  132. }
  133. .button:active {
  134. background-color: #d0d0d0;
  135. }
  136. .active {
  137. background-color: #00aaff;
  138. }
  139. .slot-box {
  140. /* #ifndef APP-NVUE */
  141. display: flex;
  142. /* #endif */
  143. flex-direction: row;
  144. align-items: center;
  145. }
  146. .slot-image {
  147. /* #ifndef APP-NVUE */
  148. display: block;
  149. /* #endif */
  150. margin-right: 10px;
  151. width: 72px;
  152. height: 48px;
  153. }
  154. .slot-text {
  155. flex: 1;
  156. font-size: 16px;
  157. margin-right: 10px;
  158. }
  159. .slot-text-play {
  160. font-size: 14px;
  161. color: #008acf;
  162. margin-right: 5px;
  163. background-color: #ffffff;
  164. }
  165. button::after {
  166. border: none;
  167. }
  168. </style>