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