报错 is not defined,如何解决?
console.log(serviceList)
打印serviceList时报错
data: {
serviceList: []
},
getNearServices: function () {
let that = this;
const { latitude, longitude } = this.data;
console.log(this.data)
wx.cloud.callFunction({
name: 'getService',
data: {
latitude,
longitude
},
success: function (res) {
console.log('getNearServices-->',res);
that.setData({
serviceList: res.result.list
})
console.log(serviceList)
},
fail: console.error
})
},