html52.com
我爱小程序-开发者交流社区

使用官方的上传文件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({

网友回复

stop eating:

不能

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付