为什么返回后数据没有刷新?
_send() {
var that = this
var temperature = this.data.currentTemperature
var content = this.data.currentContent
var contactWay = this.data.currentContactWay
var type = this.data.typesOf
wx.getLocation({
type: 'gcj02',
success(location) {
const latitude = location.latitude
const longitude = location.longitude
wx.cloud.callFunction({
// 云函数名称
name: 'addPublishTask',
// 传给云函数的参数
data: {
temperature: temperature,
longitude: longitude,
latitude: latitude,
type: type,
content: content,
contentImages: uploadImageList,
contactWay: contactWay
},
}).then(res => {
console.log(res.result)
if (res.result.errCode) { // // 发布失败
that._sendFail(res.result)
return
}
localImageList = []
uploadImageList = []
wx.hideLoading()
// 刷新首页的列表
that._postRefreshHomeList()
wx.navigateBack()
}).catch(error => {
wx.hideLoading()
that._sendFail(error)
})
}
})
},
console.log(prePage)已经成功获取到数据
_postRefreshHomeList(e) {
var pages = getCurrentPages();
var prePage = pages[pages.length - 2]
// prePage.fetchMyCommunityActivityFollower()
console.log(prePage)
},