|
@@ -29,7 +29,7 @@ Component({
|
|
QRCodeImagePath: '',
|
|
QRCodeImagePath: '',
|
|
QRCodeImageLocalPath: '',
|
|
QRCodeImageLocalPath: '',
|
|
groupPurchaseInfo: {},
|
|
groupPurchaseInfo: {},
|
|
- groupType:'',
|
|
|
|
|
|
+ groupType: '',
|
|
animationData: {},
|
|
animationData: {},
|
|
touchMove: true
|
|
touchMove: true
|
|
},
|
|
},
|
|
@@ -73,7 +73,7 @@ Component({
|
|
console.log('下载content成功1')
|
|
console.log('下载content成功1')
|
|
console.log(res.path)
|
|
console.log(res.path)
|
|
//res.path是网络图片的本地地址
|
|
//res.path是网络图片的本地地址
|
|
- ctx.drawImage(res.path, 127, 423, 121, 121);
|
|
|
|
|
|
+ ctx.drawImage(res.path, 35, 358, 90, 90);
|
|
console.log('下载content成功2')
|
|
console.log('下载content成功2')
|
|
ctx.draw(true, function (res) {
|
|
ctx.draw(true, function (res) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -150,6 +150,7 @@ Component({
|
|
groupPurchaseInfo: data.groupPurchaseInfo,
|
|
groupPurchaseInfo: data.groupPurchaseInfo,
|
|
groupType: data.groupType
|
|
groupType: data.groupType
|
|
})
|
|
})
|
|
|
|
+ this.poster();
|
|
}
|
|
}
|
|
|
|
|
|
if (this.data.shareType === 'class') {
|
|
if (this.data.shareType === 'class') {
|
|
@@ -217,8 +218,6 @@ Component({
|
|
|
|
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
- console.log(this.data.QRCodeImagePath)
|
|
|
|
- console.log(res)
|
|
|
|
resolve();
|
|
resolve();
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -262,7 +261,7 @@ Component({
|
|
let background = new Promise((resolve, reject) => {
|
|
let background = new Promise((resolve, reject) => {
|
|
wx.showLoading({
|
|
wx.showLoading({
|
|
title: '海报生成中',
|
|
title: '海报生成中',
|
|
- mask: true
|
|
|
|
|
|
+ // mask: true
|
|
})
|
|
})
|
|
if (this.data.shareType === 'works') {
|
|
if (this.data.shareType === 'works') {
|
|
ctx.drawImage('../../../static/image/works_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片
|
|
ctx.drawImage('../../../static/image/works_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片
|
|
@@ -292,16 +291,21 @@ Component({
|
|
ctx.setFillStyle('#ff9209')
|
|
ctx.setFillStyle('#ff9209')
|
|
ctx.fillText('播音主持特长生', (300 - ctx.measureText('播音主持特长生').width) / 2, 253)
|
|
ctx.fillText('播音主持特长生', (300 - ctx.measureText('播音主持特长生').width) / 2, 253)
|
|
} else {
|
|
} else {
|
|
- ctx.arc(52, 58, 36, 0, 2 * Math.PI, false)
|
|
|
|
|
|
+ ctx.arc(64, 146, 29, 0, 2 * Math.PI, true)
|
|
|
|
+ ctx.clip(); //剪切头像区域
|
|
|
|
+ ctx.drawImage(this.data.avatar, 37, 119, 54, 54);
|
|
|
|
+ ctx.arc(64, 146, 27, 0, 2 * Math.PI, false)
|
|
|
|
+ ctx.setFillStyle('#ff6f42')
|
|
|
|
+ ctx.fill();
|
|
ctx.clip(); //剪切头像区域
|
|
ctx.clip(); //剪切头像区域
|
|
- ctx.fill('ff6f42')
|
|
|
|
- ctx.drawImage(this.data.avatar, 16, 22, 72, 72); //插入图片
|
|
|
|
|
|
+ //插入图片
|
|
ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
|
|
ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
|
|
- ctx.setFontSize(20)
|
|
|
|
- ctx.setFillStyle('#fff')
|
|
|
|
- ctx.fillText(this.data.author, 97, 49)
|
|
|
|
- ctx.setFontSize(22)
|
|
|
|
- ctx.fillText('邀您一起来拼团', 97, 77)
|
|
|
|
|
|
+ ctx.setFontSize(18)
|
|
|
|
+ ctx.setFillStyle('#ff6f42')
|
|
|
|
+ ctx.fillText(this.data.author, 100, 143.5)
|
|
|
|
+ ctx.setFontSize(16)
|
|
|
|
+ ctx.setFillStyle('#434343')
|
|
|
|
+ ctx.fillText('邀您和我一起大声朗读', 100, 167.5)
|
|
}
|
|
}
|
|
resolve();
|
|
resolve();
|
|
})
|
|
})
|
|
@@ -344,43 +348,39 @@ Component({
|
|
// 分享团购的主体内容
|
|
// 分享团购的主体内容
|
|
drawGroupGut: function (ctx) {
|
|
drawGroupGut: function (ctx) {
|
|
let group = new Promise((resolve, reject) => {
|
|
let group = new Promise((resolve, reject) => {
|
|
- ctx.setFontSize(28)
|
|
|
|
- ctx.setFillStyle('#ff670d')
|
|
|
|
- ctx.fillText('小学语文 朗读配音', (300 - ctx.measureText('小学语文 朗读配音').width) / 2, 152)
|
|
|
|
|
|
+ ctx.setFontSize(25)
|
|
|
|
+ ctx.setFillStyle('#fff')
|
|
|
|
+ ctx.fillText('课文朗读 每天5分钟', (300 - ctx.measureText('课文朗读 每天5分钟').width) / 2, 54.5)
|
|
ctx.setFontSize(16)
|
|
ctx.setFontSize(16)
|
|
- ctx.setFillStyle('#444')
|
|
|
|
- ctx.fillText('朗朗读书声,是世上最美的声音', (300 - ctx.measureText('朗朗读书声,是世上最美的声音').width) / 2, 351)
|
|
|
|
- // if (this.data.groupPurchaseInfo.productId === 1) {
|
|
|
|
- ctx.drawImage(this.data.iconImg, 12, 176, 351, 145);
|
|
|
|
- // }
|
|
|
|
- // if (this.data.groupPurchaseInfo.productId === 2) {
|
|
|
|
- // ctx.drawImage('../../../static/share/poster_2.jpg', 12, 176, 351, 145);
|
|
|
|
- // }
|
|
|
|
- // if (this.data.groupPurchaseInfo.productId === 3) {
|
|
|
|
- // ctx.drawImage('../../../static/share/poster_3.jpg', 12, 176, 351, 145);
|
|
|
|
|
|
+ ctx.fillText('大声朗读是语感形成的必走之路', (300 - ctx.measureText('大声朗读是语感形成的必走之路').width) / 2, 75.5)
|
|
|
|
+ ctx.drawImage(this.data.iconImg, 27, 194, 247, 103.5);
|
|
|
|
+
|
|
|
|
+ ctx.setFontSize(15)
|
|
|
|
+ ctx.setFillStyle('#434343')
|
|
|
|
+ ctx.fillText('朗朗读书声,是世界上最美妙的声音', (300 - ctx.measureText('朗朗读书声,是世界上最美妙的声音').width) / 2, 327.5)
|
|
|
|
+ // if(this.data.groupType === 'IOS'){
|
|
|
|
+ // ctx.setFillStyle('#ff670d')
|
|
|
|
+ // ctx.fillText(`助力成功,您还可以获得本课程7天VIP`, (300 - ctx.measureText('助力成功,您还可以获得本课程7天VIP').width) / 2, 412)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // } else {
|
|
|
|
+ // ctx.setFillStyle('#A95A00')
|
|
|
|
+ // ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`, 96, 412)
|
|
|
|
+ // ctx.setFontSize(19)
|
|
|
|
+ // ctx.fillText('每人仅需', 151, 412)
|
|
|
|
+ // // ctx.fillText('元', 120, 495)
|
|
|
|
+ // ctx.setFontSize(28)
|
|
|
|
+ // ctx.setStrokeStyle('red')
|
|
|
|
+ // ctx.setFillStyle('red')
|
|
|
|
+ // ctx.fillText(`${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}元`, 235, 415)
|
|
// }
|
|
// }
|
|
- ctx.setFontSize(17)
|
|
|
|
- console.log(this.data.groupType)
|
|
|
|
- if(this.data.groupType === 'IOS'){
|
|
|
|
- ctx.setFillStyle('#ff670d')
|
|
|
|
- ctx.fillText(`助力成功,您还可以获得本课程7天VIP`, (300 - ctx.measureText('助力成功,您还可以获得本课程7天VIP').width) / 2, 412)
|
|
|
|
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- ctx.setFillStyle('#A95A00')
|
|
|
|
- ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`, 96, 412)
|
|
|
|
- ctx.setFontSize(19)
|
|
|
|
- ctx.fillText('每人仅需', 151, 412)
|
|
|
|
- // ctx.fillText('元', 120, 495)
|
|
|
|
- ctx.setFontSize(28)
|
|
|
|
- ctx.setStrokeStyle('red')
|
|
|
|
- ctx.setFillStyle('red')
|
|
|
|
- ctx.fillText(`${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}元`, 235, 415)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ ctx.setFontSize(15)
|
|
|
|
+ ctx.setFillStyle('#838383')
|
|
|
|
+ ctx.fillText('长按识别二维码', 130.5, 391)
|
|
ctx.setFontSize(12)
|
|
ctx.setFontSize(12)
|
|
- ctx.setFillStyle('#666666')
|
|
|
|
- ctx.fillText('长按识别二维码', (300 - ctx.measureText('长按识别二维码').width) / 2, 574)
|
|
|
|
|
|
+ ctx.setFillStyle('#838383')
|
|
|
|
+ ctx.fillText('接收邀请,获得你的课程吧', 130.5, 409.5)
|
|
//})
|
|
//})
|
|
resolve();
|
|
resolve();
|
|
})
|
|
})
|
|
@@ -395,20 +395,20 @@ Component({
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
const data = {};
|
|
const data = {};
|
|
- console.log('productId',this.data.productId)
|
|
|
|
|
|
+ console.log('productId', this.data.productId)
|
|
// 团购分享记录
|
|
// 团购分享记录
|
|
- if(this.data.shareType === 'group'){
|
|
|
|
|
|
+ if (this.data.shareType === 'group') {
|
|
data.shareTypeEnum = 'POSTER';
|
|
data.shareTypeEnum = 'POSTER';
|
|
data.shareContentEnum = 'GROUP';
|
|
data.shareContentEnum = 'GROUP';
|
|
data.productId = this.data.groupPurchaseInfo.productId;
|
|
data.productId = this.data.groupPurchaseInfo.productId;
|
|
}
|
|
}
|
|
// 朗读分享记录
|
|
// 朗读分享记录
|
|
- if(this.data.shareType === 'works'){
|
|
|
|
|
|
+ if (this.data.shareType === 'works') {
|
|
data.shareTypeEnum = 'POSTER';
|
|
data.shareTypeEnum = 'POSTER';
|
|
data.shareContentEnum = 'READ';
|
|
data.shareContentEnum = 'READ';
|
|
data.productId = this.data.productId;
|
|
data.productId = this.data.productId;
|
|
}
|
|
}
|
|
- httpRequestApi.shareRecord(data).success((res)=>{
|
|
|
|
|
|
+ httpRequestApi.shareRecord(data).success((res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
})
|
|
})
|
|
this.setData({
|
|
this.setData({
|