用云函数调用二维码,有二维码生成,但是不跳转?
var code="bihao"
var name2="namewhat"
wx.cloud.callFunction({
name: 'mmm', // 云函数的名字
data: {
url: 'pages/page2/index?name2='+name2
},
complete: res => {
const buffer = res.result.buffer;
console.log('test',res.result.buffer);
var manager = wx.getFileSystemManager();
manager.writeFile({
filePath: wx.env.USER_DATA_PATH + '/tes.png',
data: buffer,
success: res => {
console.log('test-----');
wx.cloud.uploadFile({
cloudPath:code,
filePath: wx.env.USER_DATA_PATH + '/tes.png',
success: (result) => {
console.log('seccess--')
this.setData({
imaget2:"cloud://testw/"+code
})
},
})
}
})
}
})