uploadTask.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. <template v-for="fileTask in uploadTasks">
  4. <view class="upload-task-body">
  5. <view class="upload-task-item">
  6. <text class="upload-task-item-name">{{fileTask.name}}</text>
  7. <progress v-if="showProgress" class="upload-task-item-progress"
  8. :activeColor="fileTask.state !== -1 ? '#42b983' : '#ff5a5f'" :percent="fileTask.progress * 100"
  9. active :duration="5" />
  10. <view class="flex" style="justify-content: space-between;">
  11. <text class="upload-task-item-size">{{fileTask.size}}</text>
  12. <text class="upload-task-item-size">{{fileTask.state !== -1 ? '' : '失败'}}</text>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. uploadTasks: {
  23. type: Array,
  24. default: []
  25. },
  26. showProgress: {
  27. type: Boolean,
  28. default: true
  29. }
  30. }
  31. }
  32. </script>
  33. <style>
  34. .upload-task-body {
  35. background-color: #fff;
  36. padding: 0 25rpx;
  37. transition: background-color .4s;
  38. }
  39. .upload-task-body:hover {
  40. background-color: #f5f5f5;
  41. }
  42. .upload-task-item {
  43. padding: 20rpx 0;
  44. }
  45. .upload-task-item-progress {
  46. padding: 20rpx 0;
  47. }
  48. .upload-task-item-size {
  49. font-size: 12px;
  50. color: #999;
  51. }
  52. .upload-task-item-name {
  53. font-size: 14px;
  54. }
  55. </style>