|
@@ -1,5 +1,6 @@
|
|
|
import {
|
|
|
getActivityInfo,
|
|
|
+ getShareText,
|
|
|
saveActivity
|
|
|
} from '~/api/activity'
|
|
|
/*微信录音*/
|
|
@@ -28,7 +29,20 @@ Page({
|
|
|
greeting: [],
|
|
|
// 是否更改过头像
|
|
|
changeAvatarFlag: false,
|
|
|
- greetingCard: null,
|
|
|
+ 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"
|
|
|
+ },
|
|
|
userAudioState: false,
|
|
|
// 当前音频播放时长
|
|
|
playTime: '00:00',
|
|
@@ -224,13 +238,15 @@ Page({
|
|
|
},
|
|
|
// 生成活动图片
|
|
|
createActivityImg(createType = 'share') {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- let cardUrl = !this.data.greetingCard ? '' : this.data.greetingCard.cardUrl
|
|
|
- if (cardUrl) {
|
|
|
+ return new Promise(async (resolve, reject) => {
|
|
|
+ if (createType == 'share') {
|
|
|
+ let title = await getShareText({
|
|
|
+ cardReadId: this.data.greetingCard.id
|
|
|
+ })
|
|
|
resolve({
|
|
|
- title: '请欣赏我的课文朗读作品,点赞+评论。',
|
|
|
- path: `/pages/index/index`,
|
|
|
- imageUrl: cardUrl
|
|
|
+ title,
|
|
|
+ path: `/pages/greeting/index?uid=${wx.getStorageSync('uid')}&cardId=${this.data.greetingCard.id}`,
|
|
|
+ imageUrl: this.data.greetingCard.cardUrl
|
|
|
})
|
|
|
}
|
|
|
let context = wx.createSelectorQuery();
|
|
@@ -263,15 +279,7 @@ Page({
|
|
|
wx.canvasToTempFilePath({
|
|
|
canvas: canvas,
|
|
|
success(res) {
|
|
|
- if (createType == 'share') {
|
|
|
- resolve({
|
|
|
- title: '请欣赏我的课文朗读作品,点赞+评论。',
|
|
|
- path: `/pages/index/index`,
|
|
|
- imageUrl: res.tempFilePath
|
|
|
- })
|
|
|
- } else {
|
|
|
- resolve(res.tempFilePath)
|
|
|
- }
|
|
|
+ resolve(res.tempFilePath)
|
|
|
},
|
|
|
fail(res) {
|
|
|
reject()
|