This commit is contained in:
杨航
2025-08-28 09:52:40 +08:00
parent 26294f85a1
commit 6e56f0cce1
4 changed files with 123 additions and 70 deletions
+12
View File
@@ -158,6 +158,18 @@ export const textChartApi = (data) => {
});
};
// 预览 对话
export const textChartPreviewApi = (data) => {
return request({
url: base_url + '/traStdyInfoPreview/previewCrsInfo',
method: 'post',
toastErrors: true,
data
});
};
// 设置学习顾问音色/traStdyTeacher/setStudyTeacher
export const setStudyTeacherApi = (data) => {
return request({
+26 -4
View File
@@ -25,7 +25,7 @@
></uv-tabs>
</view>
<view class="list-view">
<view class="filter-btn" @click="showFilterList = !showFilterList">筛选
<view class="filter-btn" @click="()=>{showFilterList = !showFilterList; activeTagPop = activeTag}">筛选
<uv-icon class="filter-icon" name="list"/>
</view>
<view :class="['filter-list',showFilterList?'show':'']">
@@ -34,14 +34,15 @@
<!-- .filter(t=>(t.children||[]).length>0) -->
<view class="filter-type-title">{{item.label}}</view>
<scroll-view :scroll-x="true" class="filter-type-list">
<view :class="['filter-type-item', activeTag.includes(itemT.value)?'is-active':'']" v-for="itemT in (item.children||[])" @click="chooseTag(itemT)">
<view :class="['filter-type-item', activeTagPop.includes(itemT.value)?'is-active':'']" v-for="itemT in (item.children||[])" @click="chooseTagPop(itemT)">
{{itemT.label}}
</view>
</scroll-view>
</view>
</scroll-view>
<view class="btns-box">
<view class="btn-sub" @click="showFilterList = false">确定</view>
<view class="btn-sub cencle-btn" @click="showFilterList = false">取消</view>
<view class="btn-sub" @click="() => {showFilterList = false;activeTag = activeTagPop}">筛选</view>
</view>
</view>
<uv-scroll-list class="tags-view" :indicator="false">
@@ -170,6 +171,21 @@ import { onShow } from "@dcloudio/uni-app"
} = uni.getWindowInfo()
const pageTopPadding = computed(() => statusBarHeight + 'px')
const activeTagPop = ref([])
const chooseTagPop = (item) => {
if(!item.value){
activeTagPop.value = ['']
return
}
activeTagPop.value = activeTagPop.value.filter((t=>!!t))
if(activeTagPop.value.includes(item.value)){
activeTagPop.value = activeTagPop.value.filter((t=>t !== item.value))
}else{
activeTagPop.value.push(item.value)
}
}
// 点击标签
const chooseTag = (item)=>{
if(!item.value){
@@ -472,10 +488,16 @@ import { onShow } from "@dcloudio/uni-app"
text-align: center;
background-color: #06f;
height: 60rpx;
line-height: 60rpx;
line-height: 58rpx;
border: 1rpx solid #06f;
padding: 0 40rpx;
color: #fff;
border-radius: 8rpx;
&.cencle-btn{
background-color: #fff;
color: #06f;
margin-right: 40rpx;
}
}
}
}
+84 -65
View File
@@ -150,7 +150,8 @@
afreshStudyCourseApi,
queryQuestionEvalateApi,
textChartApi,
setStudyTeacherApi
setStudyTeacherApi,
textChartPreviewApi
} from "@/api/study.js"
import common from '@/common/common';
import TalkingItem from '@/pages/course/components/talkingItem.vue'
@@ -189,6 +190,9 @@
const inputRef = ref('')
const flagVal = ref('1')
const isUploadingVoice = ref(false)
const isPreview = ref(false)
const ajaxApi = computed(()=> isPreview.value ? textChartPreviewApi: textChartApi)
const {
statusBarHeight
@@ -209,25 +213,14 @@
voicePath: '',
voiceObj: null
}))
if (body.stdyProgressFlag === 'N') {
step.value = 1
} else {
choiceTeacher.value = body.choiceTeacher
if (startPgrphId.value) {
sendMessage({
"commond": 'STDY',
"body": {
crsId: crsId.value,
teacherNo: choiceTeacher.value
}
})
return
}
common.show('提示', '系统检测到您已存在学习记录,要继续学习吗?', true, '重新学习', '继续学习').then((res) => {
if (res) {
// 继续学习 获取学习历史接口
// 滚动到最下面
scrollToBottomNow()
if(isPreview.value){
resStartStudyNow()
}else{
if (body.stdyProgressFlag === 'N') {
step.value = 1
} else {
choiceTeacher.value = body.choiceTeacher
if (startPgrphId.value) {
sendMessage({
"commond": 'STDY',
"body": {
@@ -235,28 +228,27 @@
teacherNo: choiceTeacher.value
}
})
step.value = 2
} else {
// 重新学习
afreshStudyCourseApi({
crsId: crsId.value,
}).then(res => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
}).catch(t => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
})
return
}
}).finally(() => {})
common.show('提示', '系统检测到您已存在学习记录,要继续学习吗?', true, '重新学习', '继续学习').then((res) => {
if (res) {
// 继续学习 获取学习历史接口
// 滚动到最下面
scrollToBottomNow()
sendMessage({
"commond": 'STDY',
"body": {
crsId: crsId.value,
teacherNo: choiceTeacher.value
}
})
step.value = 2
} else {
// 重新学习
resStartStudyNow()
}
}).finally(() => {})
}
}
} catch {
@@ -264,7 +256,27 @@
watchFlag.value += 1
}
};
// 重新学习
const resStartStudyNow = () => {
afreshStudyCourseApi({
crsId: crsId.value,
}).then(res => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
}).catch(t => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
})
}
const showChangeSeekModelNow = () => {
// changePlayItemId()
showSeekModel.value = true
@@ -383,7 +395,7 @@
if (flag === 1 && !!startPgrphId.value) {
_data.pgrphId = startPgrphId.value
}
textChartApi({
unref(ajaxApi)({
processType: 'PRGH-STDY',
requestBody: JSON.stringify(_data)
}).then(res => {
@@ -392,18 +404,25 @@
return
}
if (Number(_body.bodyTyp) === 7) {
common.show('恭喜你已学完全部知识点', '有什么心得跟我们分享吗?', true, '取消', '去评论').then((res) => {
if (res) {
// 去评论
common.redirectTo(
`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`
)
} else {
// 取消
common.redirectTo(
`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
}).finally(() => {})
if(isPreview.value){
common.show('提示', '您已学完全部知识点', false, '取消', '确定').then((res) => {
common.redirectTo(
`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&isPreview=true`)
}).finally(() => {})
}else{
common.show('恭喜你已学完全部知识点', '有什么心得跟我们分享吗?', true, '取消', '去评论').then((res) => {
if (res) {
// 去评论
common.redirectTo(
`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`
)
} else {
// 取消
common.redirectTo(
`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
}).finally(() => {})
}
return
}
lastTalkingInfo.value = {
@@ -433,7 +452,7 @@
// 获取问题
const getQuestionInfoUnStudy = (pgrphId) => {
console.log(pgrphId)
textChartApi({
unref(ajaxApi)({
processType: 'QNS-ANSER',
requestBody: JSON.stringify({
crsId: crsId.value,
@@ -504,7 +523,7 @@
scrollToBottomNow()
getQuestionInfoUnStudy(info.pgrphId)
} else if (type === 'overGraph') {
textChartApi({
unref(ajaxApi)({
processType: 'PRGH-OVER',
requestBody: JSON.stringify({
pgrphId: info?.pgrphId,
@@ -540,7 +559,7 @@
id: _id
})
// 重新回答
textChartApi({
unref(ajaxApi)({
processType: 'NEW-ANSER', //NEW-KNOW
requestBody: info.qnsId
}).then(res => {
@@ -548,7 +567,6 @@
if (!_body.chatBody) {
return
}
console.log(info, 222222)
lastTalkingInfo.value = {
crsId: info.crsId,
qstLogId: _body.chatBody,
@@ -577,7 +595,7 @@
id: _id
})
console.log(unref(logId))
textChartApi({
unref(ajaxApi)({
processType: 'NEW-KNOW',
requestBody: JSON.stringify({
logId: unref(logId),
@@ -680,6 +698,7 @@
const imageId = ref('')
onLoad((params) => {
watchFlag.value = 1
isPreview.value = params.isPreview === 'preview'
crsId.value = params.crsId || '';
crsNum.value = params.crsNum || '';
imageId.value = params.imgId || ''
@@ -841,7 +860,7 @@
ansterContent: val, // 回答文本内容 必输项:false 类型:String
asrStartTm: unref(lastTalkingInfo).asrStartTm
}
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-TEXT',
requestBody: JSON.stringify(_data)
})
@@ -874,7 +893,7 @@
}
// 撤回
const withdrawNow = (data) => {
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-WITHDRAW',
requestBody: JSON.stringify({
recordId: data.recordId
@@ -908,7 +927,7 @@
type: 0
})
scrollToBottomNow(0)
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-CHOICE',
requestBody: JSON.stringify(_data)
}).then(res => {
@@ -938,7 +957,7 @@
}
// 完成
const finishQuestionNow = (data) => {
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-OVER',
requestBody: JSON.stringify({
qnsId: data.qnsId,
@@ -983,7 +1002,7 @@
// 查询问题回答评分
const getQuestionEvalateRequest = (id, data, num) => {
if (loadingExecLogId.value) {
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-RESULT',
requestBody: JSON.stringify({
execLogId: loadingExecLogId.value