小程序that调用问题:that.savepic is not a function;?
发布于 5 年前 作者 chao07 7997 次浏览 来自 官方Issues
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)
          }

回到顶部