修改bug1

This commit is contained in:
田岩
2025-07-11 16:02:47 +08:00
9 changed files with 85 additions and 10861 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
package-lock package-lock
package-lock.json
node_modules node_modules
.DS_Store .DS_Store
dist dist
-10829
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -59,8 +59,9 @@ const navigateBack = (delta = 1, fun = () => {}) => {
} }
//关闭当前页面,跳转到应用内的某个页面。 //关闭当前页面,跳转到应用内的某个页面。
const redirectTo = url => uni.redirectTo({ const redirectTo = (url, obj = {}) => uni.redirectTo({
url: url url: url,
...obj
}); });
// 时间转换时间戳 // 时间转换时间戳
+41 -5
View File
@@ -1,5 +1,12 @@
<template> <template>
<image :src="imgUrlShow" fit="cover" :mode="mode"></image> <view v-bind="$attrs">
<image :src="imgUrlShow" fit="cover" :mode="mode" @click="showDetail" style="width: 100%;height: 100%;"></image>
<uv-overlay :show="showModel" opacity=".6" @click="showModel = false">
<view class="overlay-box">
<image class="detail-img" :src="imgUrlShow" fit="cover" :mode="mode"></image>
</view>
</uv-overlay>
</view>
</template> </template>
<script> <script>
@@ -35,12 +42,17 @@
type: String, type: String,
default: 'widthFix' default: 'widthFix'
}, },
previewDetail: {
default: '',
type:[String, Boolean]
}
}, },
data() { data() {
return { return {
imgUrlShow: '', imgUrlShow: '',
watching: false, watching: false,
base_url: get_base_url() base_url: get_base_url(),
showModel: false
}; };
}, },
computed:{ computed:{
@@ -52,6 +64,10 @@
watch: { watch: {
imgId: { imgId: {
handler(newval, oldval) { handler(newval, oldval) {
if(newval.indexOf('http') === 0){
this.imgUrlShow = newval
return
}
if (newval && this.watching) { if (newval && this.watching) {
this.getPreviewUrlBlob(newval); this.getPreviewUrlBlob(newval);
} }
@@ -70,6 +86,11 @@
} }
}, },
methods: { methods: {
showDetail(){
if(!!this.previewDetail){
this.showModel = true
}
},
getPreviewUrlBlob(id) { getPreviewUrlBlob(id) {
if (!id) { if (!id) {
this.imgUrlShow = '' this.imgUrlShow = ''
@@ -107,7 +128,11 @@
}, },
mounted() { mounted() {
if (this.imgId) { if (this.imgId) {
this.getPreviewUrlBlob(this.imgId); if(this.imgId.indexOf('http') === 0){
this.imgUrlShow = this.imgId
}else{
this.getPreviewUrlBlob(this.imgId);
}
} }
this.watching = true this.watching = true
if(this.src) { if(this.src) {
@@ -117,6 +142,17 @@
} }
</script> </script>
<style> <style lang="scss" scoped>
.overlay-box{
position: relative;
height: 100%;
.detail-img{
position: absolute;
left: 50%;
top: 50%;
max-width: 100%;
max-height: 100%;
transform: translate(-50%, -50%);
}
}
</style> </style>
@@ -30,6 +30,10 @@
watch: { watch: {
fileId: { fileId: {
handler(newval, oldval) { handler(newval, oldval) {
if(newval.indexOf('http:') === 0){
this.fileUrlShow = newval
return
}
if (newval && this.watching) { if (newval && this.watching) {
this.getPreviewUrlBlob(newval); this.getPreviewUrlBlob(newval);
} }
@@ -57,7 +61,11 @@
}, },
mounted() { mounted() {
if (this.fileId) { if (this.fileId) {
this.getPreviewUrlBlob(this.fileId); if(this.fileId.indexOf('http:') === 0){
this.fileUrlShow = this.fileId
}else{
this.getPreviewUrlBlob(this.fileId);
}
} }
this.watching = true this.watching = true
}, },
+3 -1
View File
@@ -24,7 +24,7 @@
{{ showContent }} {{ showContent }}
</text> </text>
<view v-if="type === 3"> <view v-if="type === 3">
<ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]"></ImagePreview> <ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]" :previewDetail="true"></ImagePreview>
<VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :imgId="dataInfo.vidoAddrs[0]"></VideoPreview> <VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :imgId="dataInfo.vidoAddrs[0]"></VideoPreview>
</view> </view>
<view v-if="type === 5 && !dataInfo.isLoading" style="padding-top: 16rpx;"> <view v-if="type === 5 && !dataInfo.isLoading" style="padding-top: 16rpx;">
@@ -317,9 +317,11 @@ const audioCacheObj = computed(() => storageStore.audioObj)
// 重播 // 重播
const restartPlay = () => { const restartPlay = () => {
if(itemVoice.value){ if(itemVoice.value){
emit('changePlay', '')
emit('changePlay', unref(dataInfo)?.id) emit('changePlay', unref(dataInfo)?.id)
setTimeout(()=>{ setTimeout(()=>{
talkVoiceObj.value.src = itemVoice.value talkVoiceObj.value.src = itemVoice.value
talkVoiceObj.value.seek(0)
talkVoiceObj.value.play() talkVoiceObj.value.play()
},100) },100)
}else{ }else{
+3 -1
View File
@@ -9,7 +9,7 @@
>按住说话 >按住说话
</view> </view>
<view class="touch-btn" v-if="keyboardIsShow"> <view class="touch-btn" v-if="keyboardIsShow">
<uv-input class="input-box" ref="inputRef" v-model.trim="answerValue" maxlength="1000" <uv-input class="input-box" ref="inputRef" v-model.trim="answerValue" maxlength="500"
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入答案"> placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入答案">
</uv-input> </uv-input>
</view> </view>
@@ -60,6 +60,7 @@ const recordObjCom = uni.getRecorderManager()
const initRecord = () => { const initRecord = () => {
unref(recordObjCom)?.onStop((res, duration)=>{ unref(recordObjCom)?.onStop((res, duration)=>{
audioPath.value = res.tempFilePath audioPath.value = res.tempFilePath
console.log(duration)
}) })
} }
const startRecord = () => { const startRecord = () => {
@@ -112,6 +113,7 @@ const showOverlayTalking = (obj) => {
} }
} }
const hideOverlayTalking = (obj) => { const hideOverlayTalking = (obj) => {
if(!showTalkingModel.value) return
showTalkingModel.value = false showTalkingModel.value = false
//#ifdef APP-PLUS //#ifdef APP-PLUS
stopRecord() stopRecord()
+24 -20
View File
@@ -21,7 +21,8 @@
<view class="right-name">{{item.teacherName}}</view> <view class="right-name">{{item.teacherName}}</view>
<view class="right-desc">描述{{item.voiceDesc || '--'}}</view> <view class="right-desc">描述{{item.voiceDesc || '--'}}</view>
<view class="audio-box"> <view class="audio-box">
<view :class="['talking-gif', activeVoiceTeachNo === item.teacherNo ? 'is-play':'']"></view> <view :class="['talking-gif', activeVoiceTeachNo === item.teacherNo && !loadingTeacherVoice ? 'is-play':'']"></view>
<CommonLoading color="#06f" v-show="activeVoiceTeachNo === item.teacherNo && loadingTeacherVoice" style="float: left;"/>
<view class="play-btn" @click="playTeacherVoice(item)"> <view class="play-btn" @click="playTeacherVoice(item)">
<image class="icon" v-if="activeVoiceTeachNo !== item.teacherNo" src="@/static/images/course/play-blue.png" style="width: 100%;height: 100%;"></image> <image class="icon" v-if="activeVoiceTeachNo !== item.teacherNo" src="@/static/images/course/play-blue.png" style="width: 100%;height: 100%;"></image>
<image class="icon" v-else src="@/static/images/course/stop-blue.png" style="width: 100%;height: 100%;"></image> <image class="icon" v-else src="@/static/images/course/stop-blue.png" style="width: 100%;height: 100%;"></image>
@@ -243,6 +244,7 @@ teacherVoiceObj.onEnded(()=>{
activeVoiceTeachNo.value = '' activeVoiceTeachNo.value = ''
teacherVoiceObj.src = '' teacherVoiceObj.src = ''
}) })
const loadingTeacherVoice = ref(false)
const playTeacherVoice = (item) =>{ const playTeacherVoice = (item) =>{
teacherVoiceObj.stop() teacherVoiceObj.stop()
teacherVoiceObj.src = '' teacherVoiceObj.src = ''
@@ -253,12 +255,15 @@ const playTeacherVoice = (item) =>{
teacherVoiceObj.src = item.voicePath teacherVoiceObj.src = item.voicePath
teacherVoiceObj.play() teacherVoiceObj.play()
}else{ }else{
loadingTeacherVoice.value = true
storageStore.getStorageById('audio', item.teacherNo, (url)=>{ storageStore.getStorageById('audio', item.teacherNo, (url)=>{
if(url){ if(url){
teacherVoiceObj.src = _cache teacherVoiceObj.src = url
teacherVoiceObj.play() teacherVoiceObj.play()
loadingTeacherVoice.value = false
}else{ }else{
downloadVoiceFile('/trastudy/traStdyInfo/trialListening?teachNo='+item.teacherNo).then(res=>{ downloadVoiceFile('/trastudy/traStdyInfo/trialListening?teachNo='+item.teacherNo).then(res=>{
loadingTeacherVoice.value = false
item.voicePath = res.tempFilePath item.voicePath = res.tempFilePath
teacherVoiceObj.src = item.voicePath teacherVoiceObj.src = item.voicePath
teacherVoiceObj.play() teacherVoiceObj.play()
@@ -534,12 +539,13 @@ onLoad((params) => {
crsId.value = params.crsId||''; crsId.value = params.crsId||'';
crsNum.value = params.crsNum||''; crsNum.value = params.crsNum||'';
startPgrphId.value = params.pgrphId||''; startPgrphId.value = params.pgrphId||'';
getData('1');
}); });
const showTalkingModel = ref(false) const showTalkingModel = ref(false)
// 录音 // 录音
onMounted(()=>{ // onMounted(()=>{
getData('1'); // getData('1');
}) // })
// onShow(()=>{ // onShow(()=>{
// getData('2'); // getData('2');
// }) // })
@@ -675,17 +681,6 @@ const withdrawNow = (data) => {
const loadingQstLogId = ref('') const loadingQstLogId = ref('')
// 完成 // 完成
const finishQuestionNow = (data) => { const finishQuestionNow = (data) => {
let _id1 = new Date().getTime() + 'id'
talkingList.value.push({
id: _id1,
talkingContent: '完成',
userInfo: {...choiceTeacherInfo.value},
type: 0
})
// waitMakeEvaluateApi({
// qstLogId: data.qstLogId
// })
textChartApi({ textChartApi({
processType: 'ANSER-OVER', processType: 'ANSER-OVER',
requestBody: JSON.stringify({ requestBody: JSON.stringify({
@@ -694,6 +689,18 @@ const finishQuestionNow = (data) => {
}) })
.then(res=> { .then(res=> {
// common.msg('完成成功,开始获取评分维度数据!') // common.msg('完成成功,开始获取评分维度数据!')
let _state = res.body.chatBody.processStat
if(_state = 'ER'){
common.msg('提交答案失败!')
return
}
let _id1 = new Date().getTime() + 'id'
talkingList.value.push({
id: _id1,
talkingContent: '完成',
userInfo: {...choiceTeacherInfo.value},
type: 0
})
loadingQstLogId.value = res.body.chatBody.qstLogId loadingQstLogId.value = res.body.chatBody.qstLogId
qstLogId.value = loadingQstLogId.value qstLogId.value = loadingQstLogId.value
let _id = new Date().getTime() + 'id' let _id = new Date().getTime() + 'id'
@@ -711,10 +718,6 @@ const finishQuestionNow = (data) => {
// 查询问题回答评分 // 查询问题回答评分
const getQuestionEvalateRequest = (id, data) => { const getQuestionEvalateRequest = (id, data) => {
if(loadingQstLogId.value){ if(loadingQstLogId.value){
// queryQuestionEvalateApi({
// qstLogId:loadingQstLogId.value
// })
textChartApi({ textChartApi({
processType: 'ANSER-RESULT', processType: 'ANSER-RESULT',
requestBody: JSON.stringify({ requestBody: JSON.stringify({
@@ -957,6 +960,7 @@ const chooseRateNow = (item) => {
.talking-gif{ .talking-gif{
width: 140rpx; width: 140rpx;
height: 40rpx; height: 40rpx;
margin-right: 20rpx;
// background-color: #ccc; // background-color: #ccc;
background: url(@/static/images/course/voice-gray.png) no-repeat; background: url(@/static/images/course/voice-gray.png) no-repeat;
background-size: 100%; background-size: 100%;
+1 -1
View File
@@ -84,7 +84,7 @@
<image class="icon" src="@/static/images/index/navigation_course.png"></image> <image class="icon" src="@/static/images/index/navigation_course.png"></image>
<view class="title">课程中心</view> <view class="title">课程中心</view>
</view> </view>
<view class="item" @click="common.navigateTo('/pages/index/dialog')"> <view class="item" @click="common.navigateTo('/pages/index/dialog',{ animationType: 'slide-in-bottom'})">
<image class="icon" src="@/static/images/index/navigation_question_answering.png"></image> <image class="icon" src="@/static/images/index/navigation_question_answering.png"></image>
<view class="title">AI问答</view> <view class="title">AI问答</view>
</view> </view>