|
...
|
...
|
@@ -52,7 +52,7 @@ |
|
|
|
<view class="myQuestion-2-i-3-c-1-r">{{info.answer_time}}</view>
|
|
|
|
</view>
|
|
|
|
<view style="margin-top: 28rpx;" v-if="isVoiceReply">
|
|
|
|
<VoicePlayback />
|
|
|
|
<VoicePlayback ref="voicePlaybackRef"/>
|
|
|
|
</view>
|
|
|
|
<view class="myQuestion-2-i-3-c-2" v-else>
|
|
|
|
{{info.answer}}
|
|
...
|
...
|
@@ -74,7 +74,7 @@ |
|
|
|
<textarea class="onLineDetails-1-2-c" placeholder="请输入" v-model="answer"></textarea>
|
|
|
|
</view>
|
|
|
|
<view v-else>
|
|
|
|
<RecordingDevice />
|
|
|
|
<RecordingDevice v-model="speech" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
...
|
...
|
@@ -103,7 +103,11 @@ |
|
|
|
answerType: MESSAGETYPE.TEXTANSWER,
|
|
|
|
value: 5,
|
|
|
|
answer: '',
|
|
|
|
info: {}
|
|
|
|
info: {},
|
|
|
|
speech: {
|
|
|
|
duration: 0,
|
|
|
|
url: ''
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
...
|
...
|
@@ -113,7 +117,7 @@ |
|
|
|
},
|
|
|
|
// 是否查看
|
|
|
|
isWatch() {
|
|
|
|
return this.info.answer_type === ANSWERTYPE.ANSWERED
|
|
|
|
return this.info.answer_type !== ANSWERTYPE.TOBEANSWERED
|
|
|
|
},
|
|
|
|
// 是否语音回复
|
|
|
|
isVoiceReply() {
|
|
...
|
...
|
@@ -145,6 +149,15 @@ |
|
|
|
uni.hideLoading();
|
|
|
|
if (res.code == 1) {
|
|
|
|
this.info = res.data;
|
|
|
|
if(this.info.answer_type === MESSAGETYPE.VOICEANSWERS) {
|
|
|
|
let result = this.info.answer
|
|
|
|
if(result) {
|
|
|
|
result = JSON.parse(result)
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.voicePlaybackRef.init(result)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
if (res.msg) {
|
|
|
|
uni.showToast({
|
|
...
|
...
|
@@ -174,15 +187,23 @@ |
|
|
|
title: '提交中',
|
|
|
|
mask: true
|
|
|
|
})
|
|
|
|
const { answerType, answer, id } = this;
|
|
|
|
let { answerType, answer, id } = this;
|
|
|
|
if(answerType === MESSAGETYPE.TEXTANSWER && !answer) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '请输入解答内容',
|
|
|
|
icon: 'none'
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
} else if(answerType === MESSAGETYPE.VOICEANSWERS && !this.speech.url) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '请录制音频',
|
|
|
|
icon: 'none'
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(answerType === MESSAGETYPE.VOICEANSWERS) {
|
|
|
|
answer = JSON.stringify(this.speech)
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$service.P_post('/lecturer/answer', {
|
|
|
|
answer_type: answerType,
|
|
|
|
answer,
|
...
|
...
|
|