JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_复原杨航的代码

This commit is contained in:
田岩
2026-01-16 08:46:22 +08:00
parent fe7ce16354
commit 45cb22c3fe
4 changed files with 94 additions and 79 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ ENV = 'development'
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
#VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'http://192.168.247.200'
@@ -15,7 +15,7 @@ ENV = 'development'
# VITE_APP_BASE_API_Url = 'http://192.168.108.129'
# dev
VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
#VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# sit
+3 -75
View File
@@ -22,7 +22,7 @@
</view>
</view>
<view class="ai-info" v-show="talkingList.length === 0">
<view class="ai-info">
<!-- <image src="@/static/images/dialog/pet-3.png" alt="" class="image-pet-bg"></image> -->
<image src="@/static/images/dialog/pet-bg-base.png" alt="" class="image-pet-bg"></image>
<image :src="luimgAddr" alt="" class="image-pet" mode="widthFix"></image>
@@ -32,17 +32,7 @@
<view class="info-btn">试试他的能力</view>
</view>
</view>
<view class="talking-list talking-list-qns" v-show="talkingList.length === 0">
<scroll-view class="talking-scroll-list" :scroll-y="true" :scroll-top="scrollTop" :show-scrollbar="false"
:scroll-with-animation="false">
<view class="question-item-box" v-show="talkingList.length === 0" v-for="item in questionList">
<view class="question-item" @click="sendText(item.hotContent)">
{{ item.hotContent }}
</view>
</view>
</scroll-view>
</view>
<!-- <view class="questions-view">
<view class="questions-view">
<scroll-view :scroll-x="true" :show-scrollbar="false">
<view class="question-row">
<view class="question-item" v-for="item in Math.ceil(questionList.length / 2)"
@@ -57,28 +47,13 @@
</view>
</view>
</scroll-view>
<<<<<<< HEAD
</view> -->
<view class="talking-list" v-show="talkingList.length > 0">
=======
</view>
<view class="talking-list">
>>>>>>> dev-0120
<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>
<<<<<<< HEAD
<view class="question-item-box mt-16" v-for="item in talkQnsList">
<view class="question-item" @click="sendText(item.hotContent)">
{{ item.hotContent }}
</view>
</view>
=======
>>>>>>> dev-0120
</scroll-view>
</view>
<view class="router-list">
@@ -254,7 +229,6 @@
const showModelComfirm = ref(false);
const reconcatNum = ref(1);
const askTime = ref(0)
const talkQnsList = ref([])
const initsocketTask = () => {
isHistory.value = false;
socketStore.creatSocket('/traask/asksocket/open?summary=');
@@ -394,7 +368,6 @@
let _data = body.data;
talkingList.value[talkingList.value.length - 1].talkingFiles = _data.knowledgeList || [];
talkingList.value[talkingList.value.length - 1].talkingCrsList = _data.crsList || [];
talkQnsList.value = _data.qnsList || []//questionList.value.splice(0, 3);
}
return;
}
@@ -433,9 +406,6 @@
}, 3000);
};
const sendMessage = (data) => {
if (data.commond === 'ASK') {
talkQnsList.value = []
}
unref(SocketObj).send(data);
};
watch(
@@ -734,10 +704,7 @@
});
} else {
talkingList.value.pop();
<<<<<<< HEAD
=======
talkingList.value = talkingList.value.filter(t => !t.isLoading)
>>>>>>> dev-0120
uni.showToast({
title: '未识别到文字',
icon: 'none',
@@ -1201,53 +1168,14 @@
}
.talking-list {
height: calc(100% - 328rpx);
height: calc(100% - 772rpx);
min-height: 300rpx;
padding: 12rpx 24rpx;
box-sizing: border-box;
min-height: 300rpx;
<<<<<<< HEAD
&.talking-list-qns {
height: calc(100% - 600rpx);
}
=======
>>>>>>> dev-0120
.talking-scroll-list {
height: 100%;
.question-item-box {
float: left;
width: 100%;
&.mt-16 {
margin-top: 16rpx;
.question-item {
margin-bottom: 0rpx;
}
}
.question-item {
// white-space: nowrap;
float: left;
width: auto;
min-height: 66rpx;
line-height: 56rpx;
background-color: #fff;
border: 2rpx solid #e0dede;
padding: 5rpx 16rpx;
border-radius: 11rpx;
margin-bottom: 16rpx;
// display: inline-block;
font-size: 26rpx;
&:last-child {
margin-right: 0;
}
}
}
}
}
}
@@ -0,0 +1,84 @@
<template>
<view class="talk-list-max">
<view class="talk-list-top-3"></view>
<view class="talk-list-top-2"></view>
<view class="talk-list-top-1"></view>
<view class="talk-list">
<view class="fl1"></view>
<view class="talk-list-line">
{{ talkList }}
</view>
</view>
</view>
</template>
<script setup >
const textText = '你核心的诉求现在非常明确了:文字必须放在单个不拆分的盒子里(这样才能滑动查看上方内容),同时要实现两个效果 —— 一是文字整体越往上颜色越淡,二是底部新增文字时,内容能缓慢向上挤(有平滑动画),且不能用 JS 拆分文字行。我现在提供的方案完全满足你的要求:无 JS 拆分、单个文字盒子、支持滑动查看上方内容、文字越往上越淡、新增文字缓慢上挤动画,所有效果都通过 CSS 核心实现,JS 仅做 “追加文字” 的极简操作(无任何拆分逻辑)。'
import { ref } from 'vue';
const talkList = ref('');
// 初始化文本索引,记录当前添加到哪个位置
let currentIndex = 0;
// 每次添加的字符数(1=逐个加,2=逐两个加,可自行调整)
const step = 2;
// 定时器逐字/逐两字添加文本
const addTextTimer = setInterval(() => {
// 截取从当前索引开始的step个字符
const addStr = textText.slice(currentIndex, currentIndex + step);
// 拼接到talkList
talkList.value += addStr;
// 更新索引
currentIndex += step;
// 当索引超过文本长度时,清除定时器(添加完成)
if (currentIndex >= textText.length) {
clearInterval(addTextTimer);
console.log('文本添加完成');
}
}, 70); // 70ms间隔,和你原来的节奏一致
</script>
<style scoped lang="scss">
$talk-text-line-height: 48rpx;
$talk-text-font-size: 32rpx;
.talk-list-max {
left: 30rpx;
top: calc(150rpx + var(--status-bar-height) + 200rpx + 100rpx);
position: absolute;
width: calc(100% - 60rpx);
height: $talk-text-line-height * 6;
overflow: hidden;
background: linear-gradient(to bottom, rgba(0, 0, 0, .9), rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .1) 60%, rgba(0, 0, 0, 0) 100%);
/* 核心修正1:补全-webkit-前缀(小程序必须加) */
// background: linear-gradient(to top, #ffffff 100%, rgba(255,255,255,0.2) 0%);
background-color: red;
-webkit-background-clip: text; /* webkit内核必加 */
background-clip: text;
color: transparent; /* 文字透明,透出渐变背景 */
/* 核心修正2:兜底(若渐变失效,显示基础文字色) */
// color: rgba(255,255,255,0.8);
white-space: pre-wrap;
.talk-list {
// background-color: red;
display: flex;
flex-direction: column;
position: absolute;
left: 0;
bottom: 0;
.talk-list-line {
font-size: $talk-text-font-size;
transition: min-height 0.3s ease-out; /* 高度变化动画:时长0.3s,缓动效果 */
overflow: hidden; /* 隐藏超出max-height的内容 */
min-height: 48rpx;
line-height: $talk-text-line-height;
}
// transition: all 0.5s ease-out;
}
}
</style>
+5 -2
View File
@@ -9,7 +9,7 @@
</view>
<view class="fl1-div-1"></view>
<view class="role-info">
<image-preview :src="dataInfo.ossAddr" class="role-avatar" @click="test()"></image-preview>
<image-preview :src="dataInfo.ossAddr" class="role-avatar"></image-preview>
<view class="role-name">{{ dataInfo.chaName }}</view>
<view class="title-time" v-if="isRecording">{{ formattedTime }}</view>
<view class="title-tip" v-if="!isRecording">正在接通中</view>
@@ -19,7 +19,6 @@
{{ dataInfo.sceneDesc }}
</view>
<view class="close-btn" @click="closeTalking"></view>
<view
v-if="isVideo && !isIOS"
style="
@@ -37,6 +36,7 @@
style="width: 240rpx; height: 360rpx; position: absolute; left: 0; top: 0"
></canvas>
</view>
<talkList class="talk-list"></talkList>
</view>
<talk-microphone ref="talkMicrophoneRef" @noPermission="microphoneNoPermission"></talk-microphone>
<talk-speaker ref="talkSpeakerRef" @playOver="playOver"></talk-speaker>
@@ -53,7 +53,9 @@
import talkCamera from './components/talk-camera';
import useWebSocket from './js/useWebSocket';
import useCamera from './js/useCamera';
import talkList from './components/talk-list';
const talkMicrophoneRef = ref(null);
const talkSpeakerRef = ref(null);
const talkCameraRef = ref(null);
@@ -322,6 +324,7 @@
</script>
<style scoped lang="scss">
.isVideo {
// background-color: red;
.role-info {