diff --git a/.env.development b/.env.development index 861fc2db..e476c013 100644 --- a/.env.development +++ b/.env.development @@ -16,8 +16,19 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # h5专用地址 # 王洋洋 +<<<<<<< HEAD #VITE_APP_BASE_H5_API_Url = 'http://25.64.16.140:9604' VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001' #岳世凯 #VITE_APP_BASE_H5_API_Url = 'http://25.64.16.141:9701' +======= +# 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' + +# 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' +>>>>>>> 05085e8e3e537d6cc35d677431086afd747b4eee 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/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 }} + 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 d849c82b..5d160686 100644 --- a/src/pages/courseDetail/index.vue +++ b/src/pages/courseDetail/index.vue @@ -31,13 +31,8 @@ - - + + @@ -74,12 +69,12 @@ @@ -125,7 +120,7 @@ form.value = body; }; const toStudyPrgh = (info) => { - common.navigateTo('/pages/course/study?crsNum=' + form.value.value + '&crsId=' + crsId.value + '&pgrphId=' + info.pgrphId + '&imgId=' + form.imgId); + common.navigateTo('/pages/course/study?crsNum=' + form.value.crsNum + '&crsId=' + crsId.value + '&pgrphId=' + info.pgrphId + '&imgId=' + form.imgId); }; const bgOpacity = computed(() => { @@ -137,9 +132,6 @@ const childScrollStatus = ref(false); const scroll_fun = (e) => { scrollTop.value = e.detail.scrollTop; - // getElementPosition().then(res => { - // childScrollStatus.value = statusBarHeight === res.top - // }) }; const swiper_change = (res) => { @@ -149,7 +141,7 @@ const goto_examination = async () => { common.loading(); startExamByCrs({ - // crsId : form.value.crsId + // crsId : crsId.value crsId: 'CRS0250181220722025070408313900000018729' }) .then((res) => { @@ -181,10 +173,10 @@ uni.$on('refresh_comment_data', () => { console.log('发评论了刷新'); commentRef.value?.getData('submit'); + tabAct.value = 2; }); }); - onLoad((params) => { crsId.value = params.crsId; }); 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/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