diff --git a/.env.development b/.env.development index c4d7d7c5..0ddad43c 100644 --- a/.env.development +++ b/.env.development @@ -29,7 +29,7 @@ VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' # VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601' VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' -VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' +# VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' # 王洋洋 diff --git a/src/api/study.js b/src/api/study.js index ef123a57..40e66559 100644 --- a/src/api/study.js +++ b/src/api/study.js @@ -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({ diff --git a/src/pages/course/index.vue b/src/pages/course/index.vue index d0c93ccc..8e534140 100644 --- a/src/pages/course/index.vue +++ b/src/pages/course/index.vue @@ -25,7 +25,7 @@ > - 筛选 + 筛选 @@ -34,14 +34,15 @@ {{item.label}} - + {{itemT.label}} - 确定 + 取消 + 筛选 @@ -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; + } } } } diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index c98dd00e..99b65f8c 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -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