|
@@ -32,20 +32,7 @@ Page({
|
|
greeting: [],
|
|
greeting: [],
|
|
// 是否更改过头像
|
|
// 是否更改过头像
|
|
changeAvatarFlag: false,
|
|
changeAvatarFlag: false,
|
|
- greetingCard: {
|
|
|
|
- audioPath: "https://reader-wx.ai160.com/reader/resource/20230111/1673407488488535.mp3",
|
|
|
|
- cardUrl: "https://reader-wx.ai160.com/reader/resource/20230111/1673407490510737.png",
|
|
|
|
- duration: 6,
|
|
|
|
- gmtCreated: null,
|
|
|
|
- gmtModified: null,
|
|
|
|
- id: 1673407492033889,
|
|
|
|
- likeAmount: null,
|
|
|
|
- playAmount: null,
|
|
|
|
- status: null,
|
|
|
|
- templateId: 50,
|
|
|
|
- templateName: "",
|
|
|
|
- uid: "9db2bedb2b9b47c5b0358bb9bec39145"
|
|
|
|
- },
|
|
|
|
|
|
+ greetingCard: null,
|
|
userAudioState: false,
|
|
userAudioState: false,
|
|
// 当前音频播放时长
|
|
// 当前音频播放时长
|
|
playTime: '00:00',
|
|
playTime: '00:00',
|
|
@@ -254,12 +241,12 @@ Page({
|
|
bindKeyInput(e) {
|
|
bindKeyInput(e) {
|
|
if (e.currentTarget.dataset.type == 'from') {
|
|
if (e.currentTarget.dataset.type == 'from') {
|
|
this.setData({
|
|
this.setData({
|
|
- fromWidth: e.detail.cursor * this.data.configure.fromFontSize,
|
|
|
|
|
|
+ fromWidth: e.detail.value.length * this.data.configure.fromFontSize,
|
|
'configure.fromText': e.detail.value
|
|
'configure.fromText': e.detail.value
|
|
})
|
|
})
|
|
} else if (e.currentTarget.dataset.type == 'to') {
|
|
} else if (e.currentTarget.dataset.type == 'to') {
|
|
this.setData({
|
|
this.setData({
|
|
- toWidth: e.detail.cursor * this.data.configure.toFontSize,
|
|
|
|
|
|
+ toWidth: e.detail.value.length * this.data.configure.toFontSize,
|
|
'configure.toText': e.detail.value
|
|
'configure.toText': e.detail.value
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -315,8 +302,10 @@ Page({
|
|
bgImg.src = this.data.configure.bgImg
|
|
bgImg.src = this.data.configure.bgImg
|
|
bgImg.onload = () => {
|
|
bgImg.onload = () => {
|
|
ctx.drawImage(bgImg, 0, 0, 375, 300);
|
|
ctx.drawImage(bgImg, 0, 0, 375, 300);
|
|
|
|
+ ctx.fillStyle = `${this.data.configure.toColor}`;
|
|
ctx.font = `${this.data.configure.fromFontSize/2}px PingFang`;
|
|
ctx.font = `${this.data.configure.fromFontSize/2}px PingFang`;
|
|
ctx.fillText(this.data.configure.toText, this.data.configure.templateBase.toLeft / 2, this.data.configure.templateBase.toTop / 2 + this.data.configure.fromFontSize / 2)
|
|
ctx.fillText(this.data.configure.toText, this.data.configure.templateBase.toLeft / 2, this.data.configure.templateBase.toTop / 2 + this.data.configure.fromFontSize / 2)
|
|
|
|
+ ctx.fillStyle = `${this.data.configure.fromColor}`;
|
|
ctx.fillText(this.data.configure.fromText, this.data.configure.templateBase.fromLeft / 2, this.data.configure.templateBase.fromTop / 2 + this.data.configure.toFontSize / 2)
|
|
ctx.fillText(this.data.configure.fromText, this.data.configure.templateBase.fromLeft / 2, this.data.configure.templateBase.fromTop / 2 + this.data.configure.toFontSize / 2)
|
|
console.log(this.data.configure.toText, this.data.configure.templateBase.toLeft / 2, this.data.configure.templateBase.toTop / 2);
|
|
console.log(this.data.configure.toText, this.data.configure.templateBase.toLeft / 2, this.data.configure.templateBase.toTop / 2);
|
|
console.log(this.data.configure.fromText, this.data.configure.templateBase.fromLeft / 2, this.data.configure.templateBase.fromTop / 2);
|
|
console.log(this.data.configure.fromText, this.data.configure.templateBase.fromLeft / 2, this.data.configure.templateBase.fromTop / 2);
|