|
@@ -20,10 +20,10 @@ Page({
|
|
vipTime: '',
|
|
vipTime: '',
|
|
tasks: [],
|
|
tasks: [],
|
|
isIos: app.globalData.isIOS,
|
|
isIos: app.globalData.isIOS,
|
|
- activationModal: true,
|
|
|
|
- isPay: true,
|
|
|
|
- // activationModal: false,
|
|
|
|
- // isPay: false,
|
|
|
|
|
|
+ /* activationModal: true,
|
|
|
|
+ isPay: true, */
|
|
|
|
+ activationModal: false,
|
|
|
|
+ isPay: false,
|
|
activationRes: {},
|
|
activationRes: {},
|
|
products: []
|
|
products: []
|
|
},
|
|
},
|
|
@@ -36,6 +36,7 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.getProducts()
|
|
this.getProducts()
|
|
|
|
+ this.creatShare()
|
|
},
|
|
},
|
|
async onShow() {
|
|
async onShow() {
|
|
if (typeof this.getTabBar === 'function') {
|
|
if (typeof this.getTabBar === 'function') {
|
|
@@ -201,6 +202,46 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ creatShare() {
|
|
|
|
+ let context = wx.createSelectorQuery();
|
|
|
|
+ context
|
|
|
|
+ .select('#vip')
|
|
|
|
+ .fields({
|
|
|
|
+ node: true,
|
|
|
|
+ size: true
|
|
|
|
+ }).exec((res) => {
|
|
|
|
+ const canvas = res[0].node;
|
|
|
|
+ const ctx = canvas.getContext('2d');
|
|
|
|
+ const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
|
|
+ canvas.width = res[0].width * dpr;
|
|
|
|
+ canvas.height = res[0].height * dpr;
|
|
|
|
+ ctx.scale(dpr, dpr);
|
|
|
|
+ ctx.font = '20px PingFang';
|
|
|
|
+ let pic = canvas.createImage();
|
|
|
|
+ pic.src = 'http://reader-wx.ai160.com/images/reader/v3/learn/vip1.png'
|
|
|
|
+ pic.onload = () => {
|
|
|
|
+ ctx.drawImage(pic, 0, 0, 375, 201);
|
|
|
|
+ ctx.fillText('终身使用', 144, 135)
|
|
|
|
+ // ctx.fillStyle("#39029B");
|
|
|
|
+ ctx.fillStyle = 'red'
|
|
|
|
+ console.log(ctx);
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ wx.canvasToTempFilePath({
|
|
|
|
+ canvas: canvas,
|
|
|
|
+ success(res) {
|
|
|
|
+ /* wx.saveImageToPhotosAlbum({
|
|
|
|
+ filePath: res.tempFilePath,
|
|
|
|
+ success(res) {}
|
|
|
|
+ }) */
|
|
|
|
+ },
|
|
|
|
+ fail(res) {
|
|
|
|
+ console.log('fail', res);
|
|
|
|
+ }
|
|
|
|
+ }, this)
|
|
|
|
+ }, 500)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 分享配置
|
|
// 分享配置
|
|
onShareAppMessage: function (res) {
|
|
onShareAppMessage: function (res) {
|
|
return {
|
|
return {
|