# checkUploadProgress

查看上传进度,调接口后,app会调起上报,weex通过监听获取进度

# 调用方式

checkUploadProgress()
1

无直接返回值;不要对调用结果使用 then/catch。

# 请求参数

无。

# 接口调用示例

this.$bridge.checkUploadProgress();
1

# 返回参数

无直接返回值。以下为 receiveMessageFromApp 消息中上传进度的字段,不是本方法的返回值:

Prop Type Values Description
messageType String 'receiveOSSUploadProgress' 监听信息种类
messageBody Object -- 返回体
percent Number 0-1 上传进度

# 接口返回示例

globalEvent.addEventListener('receiveMessageFromApp', (data) => {
  // 监听进度
  this.$bridge.getItem('logUploadFrom', (res) => {
    if (res.data === 'logUpload') {
      if (data.messageType === 'receiveOSSUploadProgress') {
        this.progress = data.messageBody.percent || 0;
        if (this.progress <= 1 && this.progress > 0) {
          this.showProgerss = true;
          this.uploadedFlag = false;
        }
        console.log(data.messageBody);
      }
    }
  });
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15