|
@@ -40,7 +40,7 @@ Page({
|
|
|
scrollTop: 0,
|
|
|
//如果readingReset为true就是重读
|
|
|
readingReset: false,
|
|
|
- //readingType为public是普通阅读,为pk是pk逻辑
|
|
|
+ //readingType为public是普通阅读,为pk是pk逻辑,readMatch为朗读赛
|
|
|
readingType: 'public',
|
|
|
percent: 0,
|
|
|
uploadState: false,
|
|
@@ -72,14 +72,6 @@ Page({
|
|
|
id: 7,
|
|
|
text: '一天,大神醒来,睁眼一看,',
|
|
|
time: '20030'
|
|
|
- }, {
|
|
|
- id: 8,
|
|
|
- text: '周围黑乎乎一片,',
|
|
|
- time: '24210'
|
|
|
- }, {
|
|
|
- id: 9,
|
|
|
- text: '什么也看不见。',
|
|
|
- time: '27300'
|
|
|
}]
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -90,7 +82,7 @@ Page({
|
|
|
item.readTime = data[index + 1] ? data[index + 1].time - item.time : ''
|
|
|
return item
|
|
|
})
|
|
|
- console.log(options,'options');
|
|
|
+ console.log(options, 'options');
|
|
|
this.setData({
|
|
|
article: data,
|
|
|
readingReset: options.reset || false,
|
|
@@ -252,14 +244,14 @@ Page({
|
|
|
tempFilePath: res.tempFilePath,
|
|
|
});
|
|
|
//录音机结束后,驰声引擎执行结束操作,等待评测返回结果
|
|
|
- // wsEngine.stop({
|
|
|
- // success: () => {
|
|
|
- // console.log('====== wsEngine stop success ======');
|
|
|
- // },
|
|
|
- // fail: (res) => {
|
|
|
- // console.log('录音结束报错', res);
|
|
|
- // },
|
|
|
- // });
|
|
|
+ wsEngine.stop({
|
|
|
+ success: () => {
|
|
|
+ console.log('====== wsEngine stop success ======');
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+ console.log('录音结束报错', res);
|
|
|
+ },
|
|
|
+ });
|
|
|
});
|
|
|
//监听已录制完指定帧大小的文件事件。如果设置了 frameSize,则会回调此事件。
|
|
|
recorderManager.onFrameRecorded((res) => {
|
|
@@ -290,38 +282,6 @@ Page({
|
|
|
scrollTop: 0
|
|
|
})
|
|
|
},
|
|
|
- // 测试的
|
|
|
- pkResult() {
|
|
|
- wx.redirectTo({
|
|
|
- url: `/pages/pkResult/index`,
|
|
|
- })
|
|
|
- },
|
|
|
- // 字体换行
|
|
|
- startRecording() {
|
|
|
- if (this.data.currentRow == null) {
|
|
|
- this.setData({
|
|
|
- currentRow: 0
|
|
|
- })
|
|
|
- }
|
|
|
- let row = this.data.article[this.data.currentRow]
|
|
|
- if (!row.readTime) {
|
|
|
- return
|
|
|
- }
|
|
|
- this.setTimeoutObj = setTimeout(() => {
|
|
|
- this.setData({
|
|
|
- currentRow: ++this.data.currentRow
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- scrollTop: this.rowH * this.data.currentRow
|
|
|
- })
|
|
|
- this.startRecording()
|
|
|
- },
|
|
|
- row.readTime);
|
|
|
- },
|
|
|
- // 视频播放结束
|
|
|
- videoEnd() {
|
|
|
- this.finishRecord()
|
|
|
- },
|
|
|
// 获取测评结果
|
|
|
getRecordScore(res) {
|
|
|
console.log('获取评测结果');
|
|
@@ -340,12 +300,12 @@ Page({
|
|
|
tempFilePath: this.data.tempFilePath,
|
|
|
title: this.data.videoInfo.userRead.title,
|
|
|
id: this.data.videoInfo.userRead.exampleId,
|
|
|
+ originVideo: this.data.videoInfo.userRead.originVideo
|
|
|
}
|
|
|
this.setReadDetail(detail)
|
|
|
- console.log(this.data.readingType, 'readingType');
|
|
|
- if (this.data.readingType == 'public') {
|
|
|
+ if (this.data.readingType == 'public' || this.data.readingType == 'readMatch') {
|
|
|
wx.redirectTo({
|
|
|
- url: '/pages/score/index'
|
|
|
+ url: `/pages/score/index?readingType=${this.data.readingType}`
|
|
|
})
|
|
|
} else {
|
|
|
this.uploadAudio(detail)
|
|
@@ -393,6 +353,41 @@ Page({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 测试的
|
|
|
+ pkResult() {
|
|
|
+ wx.redirectTo({
|
|
|
+ url: `/pages/score/index?readingType=${this.data.readingType}`
|
|
|
+ })
|
|
|
+ /* wx.redirectTo({
|
|
|
+ url: `/pages/pkResult/index`,
|
|
|
+ }) */
|
|
|
+ },
|
|
|
+ // 字体换行
|
|
|
+ startRecording() {
|
|
|
+ if (this.data.currentRow == null) {
|
|
|
+ this.setData({
|
|
|
+ currentRow: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let row = this.data.article[this.data.currentRow]
|
|
|
+ if (!row.readTime) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.setTimeoutObj = setTimeout(() => {
|
|
|
+ this.setData({
|
|
|
+ currentRow: ++this.data.currentRow
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ scrollTop: this.rowH * this.data.currentRow
|
|
|
+ })
|
|
|
+ this.startRecording()
|
|
|
+ },
|
|
|
+ row.readTime);
|
|
|
+ },
|
|
|
+ // 视频播放结束
|
|
|
+ videoEnd() {
|
|
|
+ this.finishRecord()
|
|
|
+ },
|
|
|
videoPlay() {
|
|
|
if (this.data.readingReset) {
|
|
|
this.resultAudioContext = wx.createInnerAudioContext();
|