...
|
...
|
@@ -164,64 +164,65 @@ Page({ |
|
|
},
|
|
|
//保存图片
|
|
|
saveImg() {
|
|
|
wx.showToast({
|
|
|
title: '正在开发中~',
|
|
|
icon: 'none',
|
|
|
duration: 2000,
|
|
|
})
|
|
|
|
|
|
let that=this;
|
|
|
let params = {
|
|
|
pages: '/pages/share_record/share_record',
|
|
|
scene: that.data.poster_id,
|
|
|
}
|
|
|
// let params={
|
|
|
// file: wx.getStorageSync('staticsrc'),
|
|
|
// poster_id: that.data.poster_id,
|
|
|
// page: '/pages/share_record/share_record'
|
|
|
// let params = {
|
|
|
// pages: '/pages/share_record/share_record',
|
|
|
// scene: that.data.poster_id,
|
|
|
// }
|
|
|
let url = 'home/home/code';
|
|
|
// let url = 'home/home/poster';
|
|
|
console.log(typeof wx.getStorageSync('staticsrc'))
|
|
|
let params={
|
|
|
file: wx.getStorageSync('staticsrc'),
|
|
|
poster_id: that.data.poster_id,
|
|
|
page: 'pages/start/start'
|
|
|
}
|
|
|
// let url = 'home/home/code';
|
|
|
let url = 'home/home/poster';
|
|
|
app.post(url, params,{}).then((res) => {
|
|
|
console.log(res)
|
|
|
// let imgUrl = res
|
|
|
// wx.showLoading({
|
|
|
// title: '加载中',
|
|
|
// })
|
|
|
// wx.downloadFile({
|
|
|
// url: imgUrl,
|
|
|
// success: function (res) {
|
|
|
// wx.saveImageToPhotosAlbum({
|
|
|
// filePath: res.tempFilePath,
|
|
|
// success: function (res) {
|
|
|
// wx.hideLoading()
|
|
|
// wx.showToast({
|
|
|
// icon: 'none',
|
|
|
// title: '图片保存成功,可以分享到朋友圈'
|
|
|
// })
|
|
|
// },
|
|
|
// fail: function (res) {
|
|
|
// wx.showToast({
|
|
|
// icon: 'none',
|
|
|
// title: '图片保存失败'
|
|
|
// })
|
|
|
// console.log(res)
|
|
|
// }
|
|
|
// })
|
|
|
// },
|
|
|
// fail: function (res) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '图片保存失败,请重试',
|
|
|
// showCancel: false
|
|
|
// })
|
|
|
// }
|
|
|
// })
|
|
|
|
|
|
if(res.code == 20000){
|
|
|
|
|
|
let imgUrl = res.url
|
|
|
wx.showLoading({
|
|
|
title: '加载中',
|
|
|
})
|
|
|
wx.downloadFile({
|
|
|
url: imgUrl,
|
|
|
success: function (res) {
|
|
|
wx.saveImageToPhotosAlbum({
|
|
|
filePath: res.tempFilePath,
|
|
|
success: function (res) {
|
|
|
wx.hideLoading()
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '图片保存成功,可以分享到朋友圈'
|
|
|
})
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '图片保存失败'
|
|
|
})
|
|
|
console.log(res)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '图片保存失败,请重试',
|
|
|
// showCancel: false
|
|
|
// })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}).catch((errMsg) => {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: errMsg,
|
|
|
showCancel: false
|
|
|
})
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: errMsg,
|
|
|
// showCancel: false
|
|
|
// })
|
|
|
})
|
|
|
},
|
|
|
/**
|
...
|
...
|
|