修复部分安卓机的缓存导致生成的分享图不变的问题
This commit is contained in:
parent
0cb480ec06
commit
bd97eb01ad
@ -22,8 +22,9 @@ Page({
|
|||||||
},
|
},
|
||||||
getQrcodeJpg(code) {
|
getQrcodeJpg(code) {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
let num = Math.floor(Math.random() * 50);
|
||||||
let promise = new Promise((resolve, reject) => {
|
let promise = new Promise((resolve, reject) => {
|
||||||
const filePath = `${wx.env.USER_DATA_PATH}/temp_image.jpeg`;
|
const filePath = wx.env.USER_DATA_PATH + '/temp_image' + num + '.jpeg';
|
||||||
const buffer = wx.base64ToArrayBuffer(code);
|
const buffer = wx.base64ToArrayBuffer(code);
|
||||||
wx.getFileSystemManager().writeFile({
|
wx.getFileSystemManager().writeFile({
|
||||||
filePath,
|
filePath,
|
||||||
@ -59,7 +60,7 @@ Page({
|
|||||||
id: id
|
id: id
|
||||||
}).then(function(res) {
|
}).then(function(res) {
|
||||||
if (res.errno === 0) {
|
if (res.errno === 0) {
|
||||||
console.log(res.data);
|
// console.log(res.data);
|
||||||
that.setData({
|
that.setData({
|
||||||
goods: res.data,
|
goods: res.data,
|
||||||
});
|
});
|
||||||
@ -187,7 +188,7 @@ Page({
|
|||||||
tempFilePath,
|
tempFilePath,
|
||||||
errMsg
|
errMsg
|
||||||
} = event.detail
|
} = event.detail
|
||||||
console.log(errMsg);
|
// console.log(errMsg);
|
||||||
if (errMsg === 'canvasdrawer:ok') {
|
if (errMsg === 'canvasdrawer:ok') {
|
||||||
this.setData({
|
this.setData({
|
||||||
shareImage: tempFilePath
|
shareImage: tempFilePath
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user