fixed bug
This commit is contained in:
@@ -113,7 +113,8 @@ export default {
|
||||
selectarr: [], //选中标签
|
||||
tagcontent: '', //新建标签名字
|
||||
selectvideo: '', //视频名字
|
||||
videostate: false //视频状态
|
||||
videostate: false, //视频状态
|
||||
progress:0
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
@@ -238,7 +239,7 @@ export default {
|
||||
let url = this.action;
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title:"上传中!"
|
||||
title:'上传中'+that.progress+'%'
|
||||
})
|
||||
uni.chooseVideo({
|
||||
count: 1,
|
||||
@@ -246,7 +247,7 @@ export default {
|
||||
success: function(res) {
|
||||
that.src = res.tempFilePath;
|
||||
const tempFilePaths = res.tempFilePath;
|
||||
uni.uploadFile({
|
||||
const uploadTask = uni.uploadFile({
|
||||
url: url, //仅为示例,非真实的接口地址
|
||||
filePath: tempFilePaths,
|
||||
name: 'article_video',
|
||||
@@ -268,6 +269,13 @@ export default {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
uploadTask.onProgressUpdate((res) => {
|
||||
console.log("上传进度",res.progress)
|
||||
that.progress = res.progress
|
||||
// 测试条件,取消上传任务。
|
||||
if (res.progress == 100) {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user