From f48f50124f78bbca140b5a02829654eb8aeff063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Tue, 19 Aug 2025 10:53:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=EF=BC=9B=E4=B8=BB=E9=94=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20crsNum=20=3D>=20crsId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 7 +- src/api/dialog.js | 10 + src/pages/course/components/touchBtn.vue | 718 +++++++++++--------- src/pages/course/index.vue | 2 +- src/pages/courseDetail/index.vue | 38 +- src/pages/index/components/answer.vue | 11 +- src/pages/index/components/feedback.vue | 222 ++++++ src/pages/index/components/history.vue | 82 +++ src/pages/index/components/preview.vue | 93 +++ src/pages/index/components/table.vue | 172 +++++ src/pages/index/components/talking-item.vue | 4 +- src/pages/index/dialog.vue | 45 +- src/pages/index/index.vue | 10 +- src/static/images/dialog/history-icon.png | Bin 0 -> 754 bytes 14 files changed, 1037 insertions(+), 377 deletions(-) create mode 100644 src/pages/index/components/feedback.vue create mode 100644 src/pages/index/components/history.vue create mode 100644 src/pages/index/components/preview.vue create mode 100644 src/pages/index/components/table.vue create mode 100644 src/static/images/dialog/history-icon.png 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 0000000000000000000000000000000000000000..6b0d333fd058d3f10c37e15333fbad18e9f4d0f7 GIT binary patch literal 754 zcmVPx%tVu*cR9HvNmpP1$Q5462Ll7Yf38vAEEr{qW2{NNW6qdx+D8$f^XexsV0Be9@4ttq=0?q*kfEUetngI*}_5xdg z!G$1i1JG08z5PBiY&Z!RU9kHG90qm)UvnUh09wN_Uj}9+PRis2a0PhYAgc+$QeY#X zlZ)$aD9){K?yKHL1evjl?-VrOzHuS`Ra(ilYmWqu!so8JMJ=g6HP zigyW^ZT5ngk;Y2_RP&q3v0n(vUfZa4P5_xH?pa`^`KTQ2F>VUb1#B}TW!~`zHjkWw zxRIR1L14T7i~!?-$EJ4GTzy_Am_B5kGgUb>C)6qGj;TOz1ULn(H?PgWF~?>Df!$`e z2l(Oe*#sOlyVF3Y05sv0t%i(RZ8G3d`$FKV1zQxfbIk#u?s#G?s$tbCfK|YGbCw1U zIReRK1t6hnNnjV9ep>-)Kx?%CG+Z{=4-=aVnPU9102)@$EZ9i_s4Zp!65kkS7X3K^ z`MxnR-V=Z}9tGSEH`%;@1aJ$O3%nD+7aJDcHpjgT>Kb*A*8b218oS=5`(%mcOn(3t zB+CD3vtO;{Sv3Ge{gEAS%XR7rNj+G?GP&bImj^bSKp>~5x54n{c#WE~&8F|!R zw8>sZGOFS_o}$a|zj=`86e@p`38K4!;#sPxk;?O(O1p3r4JPW9C9 kZ8k7GU&qn^uY8{W0;MX#Z4-uW(*OVf07*qoM6N<$g6IuO%m4rY literal 0 HcmV?d00001 From 05085e8e3e537d6cc35d677431086afd747b4eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Tue, 19 Aug 2025 13:47:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=AF=B7=E6=B1=82=20baseurl?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 ++++- src/api/request.js | 14 ++++++++------ src/pages/course/components/talkingItem.vue | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.env.development b/.env.development index 3db678a9..14247ed1 100644 --- a/.env.development +++ b/.env.development @@ -20,4 +20,7 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # 任东 # 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 +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' + +# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.18.122.65:7001' +VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' diff --git a/src/api/request.js b/src/api/request.js index 5fd6a9cb..e8373f95 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -5,16 +5,16 @@ import common from '@/common/common.js' const ENV = import.meta.env -export const get_base_url = url => { +export const get_base_url = (url = '') => { if (ENV.MODE === 'development') { // 开发环境 // H5必须用非https,手机端必须用https // #ifdef H5 - return ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url - const baseUrl = ENV.VITE_APP_BASE_API_Url - if (baseUrl.startsWith('https')) { - return baseUrl.replace('https', 'http') + if (url) { + let _str = (url.split('/')[0] || url.split('/')[1])?.toUpperCase() + return ENV[`VITE_APP_BASE_H5_API_Url_${_str}`] || ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url + } else { + return ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url } - return baseUrl // #endif // #ifdef APP-PLUS return ENV.VITE_APP_BASE_API_Url @@ -80,6 +80,8 @@ export default function request({ headers_base['summary'] = token // 让每个请求携带令牌 } let that = this + + return new Promise((resolve, reject) => { uni.request({ url: `${baseUrl || base_url}${url}`, diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index a4759eb1..737e9149 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -32,6 +32,9 @@ + + 举例:{{ dataInfo.knoExampie }} +