点击按钮更换并上传头像,setDate失效?
云存储和数据库都更新成功了,但是UI却没有刷新
icon: async function () { console.log(iurl) await wx.chooseImage({ count: 1, sizeType: [ 'original' , 'compressed' ], sourceType: [ 'album' , 'camera' ], success(res) { // tempFilePath可以作为img标签的src属性显示图片 iurl = res.tempFilePaths console.log(iurl) wx.cloud.uploadFile({ cloudPath: app.globalData.openid + '/icon.png' , filePath: String(iurl), success(res) { iurl = res.fileID console.log(iurl) db.collection( 'renyuan' ).doc(rdata.data[0]._id).update({ data: { icon: iurl } }) console.log(iurl) wx.cloud.getTempFileURL({ fileList: [iurl], success: res => { // get temp file URL console.log(res.fileList) this .setData({ iable1: false , imageurl: res.fileList[0].tempFileURL }) }, fail: err => { } }) } }) } }) }, |