flat: 暂存

This commit is contained in:
史典卓
2025-04-10 10:59:25 +08:00
parent b98e1d5405
commit 0d2b8ae65f
103 changed files with 461 additions and 189 deletions

View File

@@ -63,6 +63,8 @@
<ai-paging ref="paging"></ai-paging>
</view>
</view>
<!-- 自定义tabbar -->
<!-- <tabbar-custom :currentpage="2"></tabbar-custom> -->
</view>
</template>
@@ -103,10 +105,19 @@ onShow(() => {
onHide(() => {
paging.value?.handleTouchCancel();
if (isDrawerOpen.value) {
isDrawerOpen.value = false;
uni.showTabBar();
}
});
const toggleDrawer = () => {
isDrawerOpen.value = !isDrawerOpen.value;
if (isDrawerOpen.value) {
uni.hideTabBar();
} else {
uni.showTabBar();
}
};
const addNewDialogue = () => {
@@ -131,13 +142,13 @@ function updateSetting() {
</script>
<style lang="stylus" scoped>
header-height = 88rpx
/* 页面容器 */
.container {
position: fixed;
z-index: 1000;
z-index: 100;
width: 100vw;
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
height: 100vh;
overflow: hidden;
}
@@ -203,8 +214,8 @@ function updateSetting() {
font-weight: 500;
align-items: center
position: relative
margin-bottom: constant(safe-area-inset-bottom); /*兼容 IOS<11.2*/
margin-bottom: env(safe-area-inset-bottom); /*兼容 IOS>11.2*/
margin-bottom: calc( 32rpx + var(--window-bottom)); /*兼容 IOS<11.2*/
margin-bottom: calc( 32rpx +var(--window-bottom)); /*兼容 IOS>11.2*/
color: #000000
.drawer-user-img
width: 57.2rpx;
@@ -218,8 +229,8 @@ function updateSetting() {
right: 28rpx
transform: translate(0,-50%)
.drawer-title
height: calc(88rpx + env(safe-area-inset-top));
line-height: calc(88rpx + env(safe-area-inset-top));
height: header-height;
line-height: header-height;
padding: 0 52rpx;
color: #333333;
font-size: 32rpx
@@ -260,22 +271,21 @@ function updateSetting() {
/* 主要内容区域 */
.main-content
width: 100%;
height: 100vh;
// background: #f8f8f8;
height: calc(100% - var(--window-bottom));
transition: margin-left 0.3s ease-in-out;
position: relative
background: #FFFFFF
.head
display: block;
box-sizing: border-box;
height: calc(88rpx + env(safe-area-inset-top));
height: header-height;
user-select: none;
.main-header
position: fixed;
left: var(--window-left);
right: var(--window-right);
height: calc(88rpx + env(safe-area-inset-top));
padding-top: calc(14rpx + env(safe-area-inset-top));
height:header-height;
padding-top: calc(14rpx);
border: 2rpx solid #F4F4F4;
background: #FFFFFF
z-index: 998;
@@ -293,7 +303,7 @@ function updateSetting() {
height: 37rpx;
.chatmain-warpper
height: calc(100% - 88rpx - env(safe-area-inset-top));
height: 'calc(100% - %s)' % header-height
position: relative;
display: block;
box-sizing: border-box;

View File

@@ -43,7 +43,10 @@
<view class="message" :class="{ messageNull: !msg.displayText }" v-else>
<!-- {{ msg.displayText }} -->
<view class="message-markdown">
<md-render :content="msg.displayText"></md-render>
<md-render
:content="msg.displayText"
:typing="isTyping && messages.length - 1 === index"
></md-render>
<view class="message-controll" v-show="showControll(index)">
<view class="controll-left">
<image
@@ -99,7 +102,7 @@
<view class="chat-item self" v-if="isRecording">
<view class="message">{{ recognizedText }} {{ lastFinalText }}</view>
</view>
<view v-if="isTyping" :class="{ self: true }">
<view v-if="isTyping" class="self">
<text class="message msg-loading">
<span class="ai-loading"></span>
</text>
@@ -107,7 +110,7 @@
</view>
</FadeView>
</scroll-view>
<view class="vio_container" :class="status" v-if="status !== 'idle'">
<view class="vio_container" @click="handleTouchEnd" :class="status" v-if="status !== 'idle'">
<view class="record-tip">{{ statusText }}</view>
<WaveDisplay
:background="audiowaveStyle"
@@ -134,6 +137,9 @@
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
@touchcancel="handleTouchCancel"
:catchtouchstart="true"
:catchtouchmove="true"
:catchtouchend="true"
v-show="isVoice"
type="default"
>
@@ -250,7 +256,7 @@ const {
lastFinalText,
} = useAudioRecorder(config.vioceBaseURl);
const { speak, pause, resume, isSpeaking, isPaused } = useSpeechReader();
const { speak, pause, resume, isSpeaking, isPaused, cancelAudio } = useSpeechReader();
// state
const queries = ref([]);
@@ -327,8 +333,6 @@ const sendMessage = (text) => {
const callback = () => {
const normalArr = toRaw(filesList.value); // 转换为普通数组
filesList.value = [];
const newMsg = { text: values, self: true, displayText: values, files: normalArr };
useChatGroupDBStore().addMessage(newMsg);
useChatGroupDBStore()
.getStearm(values, normalArr, scrollToBottom, {
onComplete: () => console.log('Display complete'),
@@ -505,6 +509,7 @@ const handleTouchStart = async (e) => {
if (!isAudioPermission.value) {
return tipsPermisson();
}
cancelAudio();
console.log('handleTouchStart');
startY.value = e.touches[0].clientY;
status.value = 'recording';
@@ -574,11 +579,8 @@ function copyMarkdown(value) {
function userGoodFeedback(msg) {
$api.msg('该功能正在开发中,敬请期待后续更新!');
// const params = {
// dataId: msg.dataId,
// sessionId: msg.parentGroupId,
// userGoodFeedback: 'no',
// };
console.log(msg.dataId);
// useChatGroupDBStore().badFeedback(msg.dataId, msg.parentGroupId);
}
function readMarkdown(value, index) {
@@ -638,7 +640,6 @@ defineExpose({ scrollToBottom, closeGuess, colseFile, changeQueries, handleTouch
</script>
<style lang="stylus" scoped>
/* 过渡样式 */
.collapse-enter-active,
.collapse-leave-active {
@@ -706,7 +707,7 @@ image-margin-top = 40rpx
.chat-container
display: flex;
flex-direction: column;
height: calc(100% - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
height: 100%;
position: relative
z-index: 1
background: #FFFFFF
@@ -795,7 +796,7 @@ image-margin-top = 40rpx
align-items: center
border-top: 2rpx solid #EAEAEA
padding: 24rpx 0
margin-top: -10rpx
margin-top: 10rpx
.controll-left
.controll-right
.controll-icon
@@ -863,12 +864,12 @@ image-margin-top = 40rpx
text-align: center
font-size: 28rpx
font-weight: 500
user-select:none;
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
.input_vio:active
background: #e8e8e8
.vio_container

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>