收藏
回答

使用官方的上传文件demo时,选择文件后会调用onShow(),能不能不调用onshow()?

使用官方的上传文件demo时,选择文件后会调用onShow(),能不能在选择文件后不调用onshow()?下面是我的代码:

wx.chooseImage({
      count1,
      sizeType: ['compressed'],
      sourceType: ['album'],
      success(res) {
        for(var i=0;i<res.tempFilePaths.length;i++){
          console.log('chooseImage success, temp path is', res.tempFilePaths[i])
        }
        
        const filePath = res.tempFilePaths[0]
        wx.showLoading({
          title'上传中'
        })
        app.getUserOpenIdViaCloud()
          .then(openid => {
            const cloudPath = 'upload/' + openid + filePath.match(/\.[^.]+?$/)[0]+"_"+(new Date()).getTime()
            console.log('cloudPath', cloudPath)
            wx.cloud.uploadFile({
回答关注问题邀请回答
收藏
登录 后发表内容
问题标签