|
@@ -55,7 +55,6 @@ Page({
|
|
// 录音授权
|
|
// 录音授权
|
|
wx.getSetting({
|
|
wx.getSetting({
|
|
success(res) {
|
|
success(res) {
|
|
- console.log(res);
|
|
|
|
if (!res.authSetting['scope.record']) {
|
|
if (!res.authSetting['scope.record']) {
|
|
wx.authorize({
|
|
wx.authorize({
|
|
scope: 'scope.record',
|
|
scope: 'scope.record',
|
|
@@ -103,7 +102,6 @@ Page({
|
|
if (this.data.state == 'before') {
|
|
if (this.data.state == 'before') {
|
|
this.innerAudioContext.play();
|
|
this.innerAudioContext.play();
|
|
this.innerAudioContext.onEnded((res) => {
|
|
this.innerAudioContext.onEnded((res) => {
|
|
- console.log('音频播放完毕');
|
|
|
|
this.setData({
|
|
this.setData({
|
|
userAudioState: false
|
|
userAudioState: false
|
|
})
|
|
})
|
|
@@ -114,7 +112,6 @@ Page({
|
|
let countDown = Number(this.data.configure.bgMusicLength)
|
|
let countDown = Number(this.data.configure.bgMusicLength)
|
|
// 倒计时
|
|
// 倒计时
|
|
this.dsq = setInterval(item => {
|
|
this.dsq = setInterval(item => {
|
|
- console.log('仍然倒计时呢');
|
|
|
|
// 倒计时结束
|
|
// 倒计时结束
|
|
if (countDown == 1) {
|
|
if (countDown == 1) {
|
|
this.stopRecording()
|
|
this.stopRecording()
|
|
@@ -194,9 +191,7 @@ Page({
|
|
fromText: this.data.configure.fromText,
|
|
fromText: this.data.configure.fromText,
|
|
templateId: this.data.id
|
|
templateId: this.data.id
|
|
}
|
|
}
|
|
- console.log(data, 'data');
|
|
|
|
let greetingCard = await saveActivity(data)
|
|
let greetingCard = await saveActivity(data)
|
|
- console.log('贺卡生成', greetingCard);
|
|
|
|
this.setDuration('endTime', greetingCard.duration)
|
|
this.setDuration('endTime', greetingCard.duration)
|
|
this.setData({
|
|
this.setData({
|
|
greetingCard,
|
|
greetingCard,
|
|
@@ -221,8 +216,9 @@ Page({
|
|
this.innerAudioContext.src = this.data.greetingCard.audioPath;
|
|
this.innerAudioContext.src = this.data.greetingCard.audioPath;
|
|
this.innerAudioContext.onTimeUpdate(() => {
|
|
this.innerAudioContext.onTimeUpdate(() => {
|
|
this.setDuration('playTime', this.innerAudioContext.currentTime)
|
|
this.setDuration('playTime', this.innerAudioContext.currentTime)
|
|
|
|
+ let vProgress = Math.ceil((Math.ceil(this.innerAudioContext.currentTime) / this.innerAudioContext.duration) * 100)
|
|
this.setData({
|
|
this.setData({
|
|
- vProgress: Math.ceil((Math.ceil(this.innerAudioContext.currentTime) / this.innerAudioContext.duration) * 100)
|
|
|
|
|
|
+ vProgress: vProgress < 96 ? vProgress : 100
|
|
})
|
|
})
|
|
})
|
|
})
|
|
this.innerAudioContext.play();
|
|
this.innerAudioContext.play();
|