uploadAlert.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view v-if="updateProgress != ''">
  3. <u-popup v-model="show" mode="center" width="80%" border-radius="15" :mask-close-able="false">
  4. <view class="upload-alert-container">
  5. <view class="title">视频上传</view>
  6. <u-line-progress :striped="true" :percent="updateProgress.progress" :striped-active="true" :active-color="vuex_theme.bgColor"></u-line-progress>
  7. <view class="upload-content">
  8. <view class="">{{(updateProgress.totalBytesSent/1024/1024).toFixed(2)}}M/{{(updateProgress.totalBytesExpectedToSend/1024/1024).toFixed(2)}}M</view>
  9. </view>
  10. <view class="cancel-upload" @click="cancelUpload">取消上传</view>
  11. </view>
  12. </u-popup>
  13. <toast ref="toast"></toast>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. updateProgress: ''
  20. },
  21. data() {
  22. return {
  23. show: false,
  24. };
  25. },
  26. created() {},
  27. computed: {},
  28. methods: {
  29. cancelUpload(){
  30. this.$emit('cancelUpload')
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .upload-alert-container {
  37. padding: 30rpx 50rpx;
  38. .title {
  39. width: 100%;
  40. text-align: center;
  41. padding: 0rpx 10rpx 50rpx 10rpx;
  42. font-weight: 500;
  43. color: #353535;
  44. letter-spacing: 2rpx;
  45. font-size: 30rpx;
  46. }
  47. .upload-content{
  48. display: flex;
  49. justify-content: flex-end;
  50. margin-top: 4rpx;
  51. }
  52. .cancel-upload{
  53. width: 300rpx;
  54. height: 60rpx;
  55. text-align: center;
  56. line-height: 60rpx;
  57. border-radius: 40rpx;
  58. background: var(--bgColor);
  59. color: #FFFFFF;
  60. margin: 30rpx auto 0;
  61. }
  62. }
  63. </style>