课程学习接口联调

This commit is contained in:
yanghang
2025-07-09 21:08:42 +08:00
parent efa81fd6f5
commit f47973d6ec
2 changed files with 84 additions and 23 deletions
+24 -6
View File
@@ -27,7 +27,7 @@
<ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]"></ImagePreview>
<VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :imgId="dataInfo.vidoAddrs[0]"></VideoPreview>
</view>
<view v-if="type === 5 && !dataInfo.isLoading">
<view v-if="type === 5 && !dataInfo.isLoading" style="padding-top: 16rpx;">
<ChartFour v-if="dataInfo.evalDimens.length === 4" :dataList="dataInfo.evalDimens" :score="dataInfo.intrctGrade"/>
<ChartThree v-if="dataInfo.evalDimens.length === 3" :dataList="dataInfo.evalDimens" :score="dataInfo.intrctGrade"/>
</view>
@@ -59,7 +59,7 @@
</view>
<view
class="next-learn-btn"
v-if="showNextBtn && [5].indexOf(type) >= 0 && isLast"
v-if="showNextBtn && [5].indexOf(type) >= 0 && isLast && dataInfo.passStat === 'PS'"
@click.stop="goOnGetQues"
>
继续学
@@ -70,13 +70,23 @@
v-if="showNextBtn && [5].indexOf(type) >= 0 && isLast"
@click.stop="goOnRestart"
>
重新
重新
<image class="icon icon-iamge" src="@/static/images/course/restart.png" ></image>
</view>
<!-- <view class="replay-study-btn" v-if="showNextBtn && [5].indexOf(type) >= 0 && isLast"><image class="icon icon-iamge" src="@/static/images/course/restudy.png" ></image></view> -->
<view class="replay-study-btn"
v-if="showNextBtn && [5].indexOf(type) >= 0 && isLast"
@click.stop="goOnRestartPrgh"
>
<image class="icon icon-iamge" src="@/static/images/course/restudy.png" ></image>
</view>
<view class="next-btn" @click.stop="goOnGetQues" v-if="showNextBtn && [3, 6].indexOf(type) >= 0 && isLast">继续
<image class="icon icon-iamge" src="@/static/images/course/goon.png" ></image></view>
</view>
<view class="talking-cont" v-if=" [5].indexOf(type) >= 0 && !dataInfo.isLoading">
<view class="talking-text">
{{ changeBr(dataInfo.suggestContent || '--') }}
</view>
</view>
</view>
</view>
<view class="ai-answer" v-if="[7].indexOf(type) >= 0">
@@ -274,6 +284,10 @@ const audioCacheObj = computed(() => storageStore.audioObj)
return _str.replace(/\/n/g,"\n")
})
const changeBr = (str = '') => {
return str.replace(/\/n/g,"\n")
}
onUnload(()=>{
pauseVoice()
})
@@ -403,6 +417,9 @@ const audioCacheObj = computed(() => storageStore.audioObj)
const goOnRestart = () => {
emit('nextQuestion', unref(dataInfo), 'reStart')
}
const goOnRestartPrgh = () => {
emit('nextQuestion', unref(dataInfo), 'reStartPrgh')
}
// 撤回
const withdraw = (data) => {
emit('withdraw',data)
@@ -452,7 +469,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
border-radius: 15rpx;
background-color: #fff;
overflow: hidden;
padding-bottom: 40rpx;
padding-bottom: 30rpx;
&.talking-info-less{
float: left;
min-width: 400rpx;
@@ -470,7 +487,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
}
}
.talking-cont{
margin-top: 16rpx;
margin: 16rpx 0;
overflow: hidden;
min-height: 48rpx;
.talking-text{
@@ -633,6 +650,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
padding: 20rpx;
border-radius: 15rpx;
background-color: #06f;
padding-bottom: 30rpx;
color: #fff;
.talking-gif{
width: 200rpx;
+60 -17
View File
@@ -45,6 +45,9 @@
<uv-icon class="arrow-icon" name="arrow-left" @click="common.navigateBack()"/>
课程学习
</view>
<view class="study-num">
<view class="color-blue">{{ showOrder }}</view> / {{ pgrphNum }}
</view>
<scroll-view
class="talking-list"
:scroll-y="true"
@@ -53,9 +56,6 @@
:scroll-with-animation="true"
>
<!-- <view class="talking-list-cont" id="scroll-box" ref="scrollBoxRef"> -->
<view class="study-num">
<view class="color-blue">{{ showOrder }}</view> / {{ pgrphNum }}
</view>
<TalkingItem
class="talking-item"
v-for="item,index in talkingList"
@@ -401,10 +401,17 @@ const nextQuestionSuccess = (info, type='next') => {
scrollToBottomNow(0)
getQuestionInfoUnStudy(info.pgrphId)
})
}else if( type === 'reStart'){
}else if(type === 'reStart'){
talkingList.value.push({
crsId: info.crsId,
pgrphId: info.pgrphId,
talkingContent: '重新学',
type: 0,
id: _id
})
// 重新回答
textChartApi({
processType: 'NEW-ANSER',
processType: 'NEW-ANSER',//NEW-KNOW
requestBody: info.qstLogId
}).then(res=>{
let _body = res.body|| {}
@@ -426,6 +433,40 @@ const nextQuestionSuccess = (info, type='next') => {
qstLogId.value = _body.chatBody.qstLogId
scrollToBottomNow()
})
}else if (type === 'reStartPrgh'){
talkingList.value.push({
crsId: info.crsId,
pgrphId: info.pgrphId,
talkingContent: '重新学',
type: 0,
id: _id
})
textChartApi({
processType: 'NEW-KNOW',
requestBody: JSON.stringify({
logId: info.logId,
pgrphId: info.pgrphId
})
}).then(res=>{
let _body = res.body|| {}
if(!_body.chatBody) {
return
}
lastTalkingInfo.value = {
crsId: info.crsId,
qstLogId: _body.chatBody,
pgrphId: info.pgrphId,
chatContent: _body.chatContent,
userInfo: {...choiceTeacherInfo.value},
..._body.chatBody,
type: Number(_body.bodyTyp) || 0,
id: _id,
isQuestion: true
}
talkingList.value.push(lastTalkingInfo.value)
qstLogId.value = _body.chatBody.qstLogId
scrollToBottomNow()
})
}
}
const scrollBoxRef = ref()
@@ -782,28 +823,30 @@ const chooseRateNow = (item) => {
color: #000;
}
}
.study-num{
height: 36rpx;
line-height: 36rpx;
text-align: center;
padding-top: 30rpx;
box-sizing: content-box;
background: url(@/static/images/course/study-bg.png) no-repeat;
border-radius: 30rpx 30rpx 0 0;
.color-blue{
color: #06f;
display: inline;
}
}
.talking-list{
flex:1;
overflow-y: auto;
padding: 30rpx;
padding: 10rpx 30rpx;
background: url(@/static/images/course/study-bg.png) no-repeat;
background-size: cover;
border-radius: 30rpx 30rpx 0 0;
box-sizing: border-box;
width: 100%;
.talking-list-cont{
padding: 0;
}
.study-num{
height: 36rpx;
line-height: 36rpx;
text-align: center;
margin-bottom: 15rpx;
.color-blue{
color: #06f;
display: inline;
}
}
.talking-item{
margin-bottom: 46rpx;
}