style(UploadVideoPopup): 更新进度条样式并清除上传结果
更新进度条的颜色和渐变样式以提升视觉效果。在上传新文件前清除之前的上传结果,确保用户界面的一致性。
Showing
1 changed file
with
7 additions
and
1 deletions
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | </van-uploader> | 26 | </van-uploader> |
| 27 | 27 | ||
| 28 | <div v-if="uploadProgress > 0 && uploadProgress < 100" class="progress"> | 28 | <div v-if="uploadProgress > 0 && uploadProgress < 100" class="progress"> |
| 29 | - <van-progress :percentage="uploadProgress" :show-pivot="true" /> | 29 | + <van-progress :percentage="uploadProgress" :show-pivot="true" pivot-color="#7232dd" color="linear-gradient(to right, #be99ff, #7232dd)" /> |
| 30 | </div> | 30 | </div> |
| 31 | 31 | ||
| 32 | <div v-if="videoUrl" class="video-preview"> | 32 | <div v-if="videoUrl" class="video-preview"> |
| ... | @@ -84,6 +84,12 @@ const beforeRead = (file) => { | ... | @@ -84,6 +84,12 @@ const beforeRead = (file) => { |
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | const afterRead = async (file) => { | 86 | const afterRead = async (file) => { |
| 87 | + // 清除之前的上传结果 | ||
| 88 | + videoUrl.value = ''; | ||
| 89 | + videoId.value = ''; | ||
| 90 | + videoName.value = ''; | ||
| 91 | + uploadProgress.value = 0; | ||
| 92 | + | ||
| 87 | const formData = new FormData(); | 93 | const formData = new FormData(); |
| 88 | formData.append('file', file.file); | 94 | formData.append('file', file.file); |
| 89 | 95 | ... | ... |
-
Please register or login to post a comment