使用官方的上传文件demo时,选择文件后会调用onShow(),能不能在选择文件后不调用onshow()?下面是我的代码:
wx.chooseImage({
count: 1,
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({