小程序that调用问题:that.savepic is not a function;?
success(res){
if(res.data.person_num){
var imgData=res.data.foreground
that.setData({
imgData:imgData
})
that.savepic(imgData)
}
else{
wx.showToast({
title: '上传图片不符合要求!',
})
}
},
savepic:function(imgData){
var save = wx.getFileSystemManager()
var timestamp = new DataCue().getTime()
var filePath = wx.env.USER_DATA_PATH +'/'+timestamp+'.png'
save.writeFile({
filePath:filePath,
data:imgData,
encoding:'base64',
success(res){
console.log(res)
}