Merge branch 'develop' of http://25.13.9.101:9000/K17_AITS/tra-app into develop
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ ENV = 'development'
|
||||
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7003'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
# DEV
|
||||
#VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
getToken
|
||||
} from '@/common/common.js'
|
||||
import IVideo from './i-video.vue'
|
||||
import {
|
||||
getPhoneEnvBool
|
||||
} from '@/common/common.js';
|
||||
export default {
|
||||
name: "video-preview",
|
||||
components: {
|
||||
@@ -78,7 +81,8 @@
|
||||
videoContext: null,
|
||||
base_url: get_base_url(),
|
||||
scale: 1,
|
||||
currentIndex: 0
|
||||
currentIndex: 0,
|
||||
IsAndEnv: getPhoneEnvBool('AND')
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -109,6 +113,13 @@
|
||||
},
|
||||
token() {
|
||||
return getToken()
|
||||
},
|
||||
videoSrc(){
|
||||
if(this.IsAndEnv){
|
||||
return this.fileUrlShow
|
||||
}else{
|
||||
return 'https://cms-emer-res.cctvnews.cctv.com/video/1005/p/39450b1263cf4be8b258bdf38995d2fb-023f0694178843bca3845de46aca7bbf-4.mp4'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -159,6 +170,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
this.videoContext = uni.createVideoContext(`video` + this.fileId)
|
||||
},
|
||||
initSrc(newval, oldval) {
|
||||
|
||||
+99
-69
@@ -3,31 +3,17 @@
|
||||
<!-- <MarkdownPreview/> -->
|
||||
<view class="top-bg"></view>
|
||||
<view class="bot-bg"></view>
|
||||
<scroll-view
|
||||
class="index-dialog-body"
|
||||
:scroll-y="true"
|
||||
upper-threshold="0"
|
||||
refresher-enabled="true"
|
||||
refresher-default-style="none"
|
||||
@refresherrefresh="scrolltolower"
|
||||
>
|
||||
<scroll-view class="index-dialog-body" :scroll-y="true" upper-threshold="0" refresher-enabled="true"
|
||||
refresher-default-style="none" @refresherrefresh="scrolltolower">
|
||||
<view class="body-title">
|
||||
<!-- <uv-icon class="arrow-icon" name="arrow-left" @click="common.navigateBack()"/> -->
|
||||
AI问答
|
||||
<view class="top-desc">内容由AI生成</view>
|
||||
<view class="seek-setting">
|
||||
<image
|
||||
src="@/static/images/dialog/new-dialog.png"
|
||||
alt=""
|
||||
class="image-icon-new"
|
||||
@click="createNewDialog"
|
||||
></image>
|
||||
<image
|
||||
src="@/static/images/dialog/history.png"
|
||||
alt=""
|
||||
class="image-icon"
|
||||
@click="showMenuList = !showMenuList"
|
||||
></image>
|
||||
<image src="@/static/images/dialog/new-dialog.png" alt="" class="image-icon-new" @click="createNewDialog">
|
||||
</image>
|
||||
<image src="@/static/images/dialog/history.png" alt="" class="image-icon"
|
||||
@click="showMenuList = !showMenuList"></image>
|
||||
<view :class="['more-list', showMenuList ? 'show' : '']">
|
||||
<view class="more-item" @click.stop="showHistory">历史</view>
|
||||
<view class="more-item" @click.stop="toMessage">消息</view>
|
||||
@@ -79,22 +65,11 @@
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
<view class="talking-list" v-show="talkingList.length > 0">
|
||||
<scroll-view
|
||||
class="talking-scroll-list"
|
||||
:scroll-y="true"
|
||||
:scroll-top="scrollTop"
|
||||
:show-scrollbar="false"
|
||||
:scroll-with-animation="false"
|
||||
>
|
||||
<TalkingItem
|
||||
v-for="(item, index) in talkingList"
|
||||
:talkingType="item.type"
|
||||
:talkingInfo="item"
|
||||
:isLast="index + 1 === talkingList.length"
|
||||
:isAnswering="!answerIsOver"
|
||||
:activeVoiceId="activeVoiceTalkingItemId"
|
||||
@handleEvents="talkItemEvents"
|
||||
></TalkingItem>
|
||||
<scroll-view class="talking-scroll-list" :scroll-y="true" :scroll-top="scrollTop" :show-scrollbar="false"
|
||||
:scroll-with-animation="false">
|
||||
<TalkingItem v-for="(item, index) in talkingList" :talkingType="item.type" :talkingInfo="item"
|
||||
:isLast="index + 1 === talkingList.length" :isAnswering="!answerIsOver"
|
||||
:activeVoiceId="activeVoiceTalkingItemId" @handleEvents="talkItemEvents"></TalkingItem>
|
||||
|
||||
<view class="question-item-box mt-16" v-for="item in talkQnsList">
|
||||
<view class="question-item" @click="sendText(item)">
|
||||
@@ -147,7 +122,7 @@
|
||||
/> -->
|
||||
<touch-btn @submitVoice="submitVoice" @sendLoading="sendLoading" @submitAnswer="submitAnswer"
|
||||
@startRecord="startRecordCallback" :loadingText="sendLoadingText" :isLoading="!answerIsOver"
|
||||
:adjustPosition="true" :isDisabled="isHistory" :disabledText="''"/>
|
||||
:adjustPosition="true" :isDisabled="isHistory || isSending" :disabledText="''" />
|
||||
|
||||
<History ref="historyRef" @showDetail="showHistoryDetail"></History>
|
||||
<PreviewVue ref="previewRef" />
|
||||
@@ -164,19 +139,50 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, unref, onMounted, watch, nextTick, computed, onActivated } from 'vue';
|
||||
import {
|
||||
ref,
|
||||
unref,
|
||||
onMounted,
|
||||
watch,
|
||||
nextTick,
|
||||
computed,
|
||||
onActivated
|
||||
} from 'vue';
|
||||
import common from '@/common/common';
|
||||
import { setupKeyboardHeightListener } from '@/common/common';
|
||||
import {
|
||||
setupKeyboardHeightListener
|
||||
} 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';
|
||||
import { useStorageStore } from '@/store/storage.js';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { onLoad, onShow, onUnload, onHide, onBackPress, onLaunch } from '@dcloudio/uni-app';
|
||||
import { get_base_url, goto_login_fun } from '@/api/request';
|
||||
import { getUserInfo, getPhoneEnvBool } from '@/common/common';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import {
|
||||
useSocketStore
|
||||
} from '@/store/socket.js';
|
||||
import {
|
||||
useStorageStore
|
||||
} from '@/store/storage.js';
|
||||
import {
|
||||
storeToRefs
|
||||
} from 'pinia';
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onUnload,
|
||||
onHide,
|
||||
onBackPress,
|
||||
onLaunch
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
get_base_url,
|
||||
goto_login_fun
|
||||
} from '@/api/request';
|
||||
import {
|
||||
getUserInfo,
|
||||
getPhoneEnvBool
|
||||
} from '@/common/common';
|
||||
import {
|
||||
commonUploadVoiceFile
|
||||
} from '@/api/common.js';
|
||||
import {
|
||||
queryHotQuestionApi,
|
||||
insertTraAskFeedback,
|
||||
@@ -189,14 +195,22 @@
|
||||
import badge from '@/components/points-and-badge/badge';
|
||||
import points from '@/components/points-and-badge/points';
|
||||
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
|
||||
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
|
||||
const {
|
||||
pointAndBadgesRun,
|
||||
badgeRef,
|
||||
pointsRef
|
||||
} = usePointsAndBadge();
|
||||
|
||||
const { statusBarHeight } = uni.getWindowInfo();
|
||||
const {
|
||||
statusBarHeight
|
||||
} = uni.getWindowInfo();
|
||||
|
||||
const pageTopPadding = computed(() => statusBarHeight + 'px');
|
||||
|
||||
const socketStore = useSocketStore();
|
||||
const { SocketObj } = storeToRefs(socketStore);
|
||||
const {
|
||||
SocketObj
|
||||
} = storeToRefs(socketStore);
|
||||
|
||||
const feedbackRef = ref();
|
||||
const watermarkRef = ref();
|
||||
@@ -283,7 +297,11 @@
|
||||
});
|
||||
});
|
||||
unref(SocketObj).on('message', (res) => {
|
||||
const { rtnCode, body, commond } = JSON.parse(res.data);
|
||||
const {
|
||||
rtnCode,
|
||||
body,
|
||||
commond
|
||||
} = JSON.parse(res.data);
|
||||
let _id = new Date().getTime() + 'id';
|
||||
if (rtnCode === '0000') {
|
||||
if (commond === 'ASK-OPEN') {
|
||||
@@ -322,7 +340,7 @@
|
||||
seqNo.value = body.seqNo;
|
||||
touchBtnCallBack.value && touchBtnCallBack.value();
|
||||
touchBtnCallBack.value = null;
|
||||
console.log('body!',body);
|
||||
console.log('body!', body);
|
||||
talkingList.value.push({
|
||||
type: 'question',
|
||||
talkingText: body.intrctContent,
|
||||
@@ -331,7 +349,8 @@
|
||||
...body,
|
||||
...askData.value
|
||||
});
|
||||
console.log('talkingList!',talkingList.value);
|
||||
isSending.value = false
|
||||
console.log('talkingList!', talkingList.value);
|
||||
talkingList.value.push({
|
||||
type: 'answer',
|
||||
isLoading: true,
|
||||
@@ -448,7 +467,12 @@
|
||||
|
||||
const isDownloading = ref(false);
|
||||
const stopAnswerCallBack = ref(null);
|
||||
const talkItemEvents = ({ type, data, id, info = {} }) => {
|
||||
const talkItemEvents = ({
|
||||
type,
|
||||
data,
|
||||
id,
|
||||
info = {}
|
||||
}) => {
|
||||
switch (type) {
|
||||
case 'reAnswer':
|
||||
console.log('重新提问回答');
|
||||
@@ -561,8 +585,7 @@
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log('开始下载:', fileUrl);
|
||||
const dtask = plus.downloader.createDownload(
|
||||
fileUrl,
|
||||
{
|
||||
fileUrl, {
|
||||
filename: localFilePath
|
||||
},
|
||||
(d, status) => {
|
||||
@@ -694,6 +717,8 @@
|
||||
};
|
||||
// 新发送语音前loading动画
|
||||
const sendLoading = () => {
|
||||
isSending.value = true
|
||||
talkQnsList.value = [];
|
||||
talkingList.value.push({
|
||||
type: 'question',
|
||||
talkingText: '',
|
||||
@@ -701,21 +726,25 @@
|
||||
});
|
||||
scrollToBottomNow();
|
||||
}
|
||||
|
||||
const isSending = ref(false)
|
||||
// 新发送语音
|
||||
const submitVoice = ({ossKey, text}) => {
|
||||
console.log('新发送语音',ossKey,text);
|
||||
// if (talkingList.value.length > 0 && talkingList.value[talkingList.value.length - 1].isLoading) {
|
||||
// return
|
||||
// }
|
||||
if(!ossKey) {
|
||||
const submitVoice = ({
|
||||
ossKey,
|
||||
text
|
||||
}) => {
|
||||
console.log('新发送语音', ossKey, text);
|
||||
// if (talkingList.value.length > 0 && talkingList.value[talkingList.value.length - 1].isLoading) {
|
||||
// return
|
||||
// }
|
||||
if (!ossKey) {
|
||||
talkingList.value.pop();
|
||||
isSending.value = false
|
||||
uni.showToast({
|
||||
title: '系统异常,请联系管理员',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
}else if(text) {
|
||||
} else if (text) {
|
||||
askData.value = {
|
||||
reqBatch: reqBatch.value,
|
||||
intrctWay: '02', //01-文本;02-语音;03-图片
|
||||
@@ -728,6 +757,7 @@
|
||||
});
|
||||
} else {
|
||||
talkingList.value.pop();
|
||||
isSending.value = false
|
||||
uni.showToast({
|
||||
title: '未识别到文字',
|
||||
icon: 'none',
|
||||
@@ -738,7 +768,7 @@
|
||||
// 发送语音
|
||||
const uploadRecordNow = (voicePath, voiceTime) => {
|
||||
//#ifdef APP-PLUS
|
||||
|
||||
|
||||
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
|
||||
.then((_res) => {
|
||||
if (!!(_res.body.transContent || '').trim()) {
|
||||
@@ -774,7 +804,7 @@
|
||||
});
|
||||
// #endif
|
||||
};
|
||||
|
||||
|
||||
// 新录音组件文本提交
|
||||
const submitAnswer = (val, cb = null) => {
|
||||
if (!answerIsOver.value) {
|
||||
@@ -796,7 +826,7 @@
|
||||
height: 0
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 发送文本
|
||||
const submitAnswerNow = (val, cb = null) => {
|
||||
if (!answerIsOver.value) {
|
||||
@@ -944,9 +974,9 @@
|
||||
|
||||
const deleteFolder = () => {
|
||||
//#ifdef APP-PLUS
|
||||
plus.io.resolveLocalFileSystemURL('_doc/pdf_view', function (entry) {
|
||||
plus.io.resolveLocalFileSystemURL('_doc/pdf_view', function(entry) {
|
||||
console.log('entry', entry);
|
||||
entry.removeRecursively(function (res) {
|
||||
entry.removeRecursively(function(res) {
|
||||
console.log('删除成功');
|
||||
});
|
||||
});
|
||||
@@ -1299,4 +1329,4 @@
|
||||
// height: 100%;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user