diff --git a/.env.development b/.env.development index 1306b8df..3db678a9 100644 --- a/.env.development +++ b/.env.development @@ -16,5 +16,8 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # h5专用地址 # 王洋洋 -#VITE_APP_BASE_H5_API_Url = 'http://25.64.16.140:9604' -VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001' \ No newline at end of file +# VITE_APP_BASE_H5_API_Url = 'http://25.64.16.140:9604' +# 任东 +# VITE_APP_BASE_H5_API_Url = 'http://25.64.16.130:9602' +# 线上 +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' \ No newline at end of file diff --git a/src/api/dialog.js b/src/api/dialog.js index 38de539e..a4e2bdf7 100644 --- a/src/api/dialog.js +++ b/src/api/dialog.js @@ -9,4 +9,14 @@ export const queryHotQuestionApi = (data) => { method: 'post', data }); +}; +// 获取问答历史 + +// 问答反馈 +export const insertTraAskFeedback = (data) => { + return request({ + url: '/traask/traAskFeedback/insertTraAskFeedback', + method: 'post', + data + }); }; \ No newline at end of file diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index ccee59f5..435ba539 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -1,24 +1,20 @@ + \ No newline at end of file diff --git a/src/pages/course/index.vue b/src/pages/course/index.vue index 5392536b..eabe7308 100644 --- a/src/pages/course/index.vue +++ b/src/pages/course/index.vue @@ -279,7 +279,7 @@ import { onShow } from "@dcloudio/uni-app" } // 跳转 课程详情 const toCourseDetail = (item) => { - common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum) + common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum + '&crsId=' + item.crsId) // common.navigateTo('/pages/course/study?crsNum=' + item.crsNum) } onMounted(()=>{ diff --git a/src/pages/courseDetail/index.vue b/src/pages/courseDetail/index.vue index 76a2a5a3..d2a18064 100644 --- a/src/pages/courseDetail/index.vue +++ b/src/pages/courseDetail/index.vue @@ -15,8 +15,7 @@ - + 知识点 {{ form.pgrphNum || 0 }} @@ -35,19 +34,18 @@ - - + + - @@ -71,13 +69,13 @@ @@ -121,6 +119,7 @@ const tabsDiv = ref(null); const form = ref({}); const crsNum = ref(''); + const crsId = ref('') const tabAct = ref(0); const scrollTop = ref(0); const tabSwitch = (item) => { @@ -137,12 +136,13 @@ const { body } = await getCourseDetailApi({ - crsNum: crsNum.value + crsNum: crsNum.value, + crsId: crsId.value }); form.value = body; }; const toStudyPrgh = (info) => { - common.navigateTo('/pages/course/study?crsNum=' + crsNum.value + '&crsId=' + form.value.crsId + '&pgrphId=' + + common.navigateTo('/pages/course/study?crsNum=' + crsNum.value + '&crsId=' + crsId.value + '&pgrphId=' + info.pgrphId + '&imgId=' + form.imgId) } @@ -166,12 +166,15 @@ // 去考试 const goto_examination = async () => { common.loading() - + startExamByCrs({ // crsId : form.value.crsId - crsId : 'CRS0250181220722025070408313900000018729' + crsId: 'CRS0250181220722025070408313900000018729' }).then(res => { - setPageCache('examination', {...res.body, examId:detailData.examId}) + setPageCache('examination', { + ...res.body, + examId: detailData.examId + }) common.navigateTo('/pages/examination/index') }).finally(() => { common.hideLoading() @@ -185,9 +188,10 @@ tabAct.value = 2 }) }) - + onLoad((params) => { crsNum.value = params.crsNum; + crsId.value = params.crsId; }); onShow(() => { getData(); diff --git a/src/pages/index/components/answer.vue b/src/pages/index/components/answer.vue index 38811e0b..74c5005e 100644 --- a/src/pages/index/components/answer.vue +++ b/src/pages/index/components/answer.vue @@ -31,18 +31,18 @@ - + - + - + @@ -102,6 +102,9 @@ const zanAnswer = () => { emit('handleEvents', 'great') } + const feedbackAnswer = ()=>{ + emit('handleEvents', 'feedback') + } \ No newline at end of file diff --git a/src/pages/index/components/history.vue b/src/pages/index/components/history.vue new file mode 100644 index 00000000..0b74fa43 --- /dev/null +++ b/src/pages/index/components/history.vue @@ -0,0 +1,82 @@ + + + + + \ No newline at end of file diff --git a/src/pages/index/components/preview.vue b/src/pages/index/components/preview.vue new file mode 100644 index 00000000..4d0a182c --- /dev/null +++ b/src/pages/index/components/preview.vue @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file diff --git a/src/pages/index/components/table.vue b/src/pages/index/components/table.vue new file mode 100644 index 00000000..7699431e --- /dev/null +++ b/src/pages/index/components/table.vue @@ -0,0 +1,172 @@ + + + + + \ No newline at end of file diff --git a/src/pages/index/components/talking-item.vue b/src/pages/index/components/talking-item.vue index 00b6596b..5fcfcfc6 100644 --- a/src/pages/index/components/talking-item.vue +++ b/src/pages/index/components/talking-item.vue @@ -45,10 +45,10 @@ watch(() => props.talkingInfo, () => {},{deep: true,immediate: true}) const { talkingType } = toRefs(props) const handleEvents = (type) => { - emit('handleEvents', type, props.talkingInfo) + emit('handleEvents',{ type, data: props.talkingInfo, id:""}) } const changePlay = (id) => { - emit('handleEvents', 'changePlay', props.talkingInfo, id) + emit('handleEvents', {type: 'changePlay', data: props.talkingInfo, id}) } diff --git a/src/pages/index/dialog.vue b/src/pages/index/dialog.vue index 5d8789eb..ce74ffb2 100644 --- a/src/pages/index/dialog.vue +++ b/src/pages/index/dialog.vue @@ -11,7 +11,7 @@ AI问答 - + @@ -84,6 +84,10 @@ + + + + @@ -101,6 +105,7 @@ import common from '@/common/common'; import TouchBtn from '@/pages/course/components/touchBtn.vue' import TalkingItem from './components/talking-item.vue'; + import PreviewVue from './components/preview.vue'; import { useSocketStore } from "@/store/socket.js" @@ -128,8 +133,12 @@ commonUploadVoiceFile } from "@/api/common.js" import { - queryHotQuestionApi + queryHotQuestionApi, + insertTraAskFeedback } from "@/api/dialog.js" + import Feedback from './components/feedback.vue' + import History from './components/history.vue' + const { statusBarHeight } = uni.getWindowInfo() @@ -141,6 +150,7 @@ SocketObj } = storeToRefs(socketStore) + const feedbackRef = ref() const userInfo = ref(getUserInfo()) const questionList = ref([ // '对公小程序开户流程?', @@ -275,7 +285,7 @@ return } if (commond === 'ASK-STOP') { - // console.log('停止回答标记!') + console.log('停止回答标记!') stopAnswerCallBack.value && stopAnswerCallBack.value(askData.value) setTimeout(() => { stopAnswerCallBack.value = null @@ -354,10 +364,18 @@ } const stopAnswerCallBack = ref(null) - const talkItemEvents = (type, data, id = '') => { + const talkItemEvents = ({type, data, id}) => { switch (type) { case 'reAnswer': console.log('重新提问回答') + // 停止获取 + sendMessage({ + "commond": 'ASK-STOP', + "body": { + reqBatch: reqBatch.value, + seqNo: seqNo.value, + } + }) sendMessage({ "commond": 'ASK', "body": data.askData @@ -369,14 +387,6 @@ // "body": $data // }) // } - // // 停止获取 - // sendMessage({ - // "commond": 'ASK-STOP', - // "body": { - // reqBatch: reqBatch.value, - // seqNo: seqNo.value, - // } - // }) break; case 'stop': console.log('停止获取数据') @@ -394,10 +404,17 @@ console.log('播放/暂停') activeVoiceTalkingItemId.value = id break; + case 'feedback': + feedbackRef.value.open(data) + break; default: break; } } + const historyRef = ref(null) + const showHistory = () => { + historyRef.value.open() + } const routerTo = (type) => { switch (type) { case 'AI学': @@ -546,8 +563,10 @@ return } }) + const previewRef = ref() onMounted(() => { loadData() + // previewRef.value.open() }) const refreshData = () => { @@ -558,12 +577,14 @@ const setHeight = (res) => { keyboardHeight.value = res.height +'px' } + //#ifdef APP-PLUS onHide(() => { uni.offKeyboardHeightChange(setHeight) }) onShow(() => { uni.onKeyboardHeightChange(setHeight) }) + // #endif onUnload(() => { watchFlag.value = 1 socketStore?.closeSocket() diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 3fba1e87..06a7d957 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -130,7 +130,7 @@ - + @@ -164,7 +164,7 @@ - + @@ -197,7 +197,7 @@ - + @@ -389,8 +389,8 @@ common.navigateTo('/pages/search/search') } // 进入课程详情页 - const goto_course_detail = (crsNum) => { - common.navigateTo('/pages/courseDetail/index?crsNum=' + crsNum) + const goto_course_detail = (item) => { + common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum + '&crsId=' + item.crsId) } const scrolltolower = () => { common.navigateTo('/pages/index/dialog', { diff --git a/src/static/images/dialog/history-icon.png b/src/static/images/dialog/history-icon.png new file mode 100644 index 00000000..6b0d333f Binary files /dev/null and b/src/static/images/dialog/history-icon.png differ