|
@@ -28,7 +28,32 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
modalConfirm(){
|
|
|
- this.setData({buyModel:false})
|
|
|
+ var imgSrc= this.data.code_url;
|
|
|
+ var save = wx.getFileSystemManager();
|
|
|
+ var number = Math.random();
|
|
|
+ let that = this
|
|
|
+ save.writeFile({
|
|
|
+ filePath: wx.env.USER_DATA_PATH + '/pic' + number + '.png',
|
|
|
+ data: imgSrc,
|
|
|
+ encoding: 'base64',
|
|
|
+ success: res => {
|
|
|
+ wx.saveImageToPhotosAlbum({
|
|
|
+ filePath: wx.env.USER_DATA_PATH + '/pic' + number + '.png',
|
|
|
+ success: function (res) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '保存成功',
|
|
|
+ })
|
|
|
+ that.setData({buyModel:false})
|
|
|
+ },
|
|
|
+ fail: function (err) {
|
|
|
+ that.setData({buyModel:false})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, fail: err => {
|
|
|
+ that.setData({buyModel:false})
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
if (!this.loading) {
|