From 50ff88e7dfa45f8145d4707db20af7d3e2ae61ca Mon Sep 17 00:00:00 2001
From: lifizer <913626195@qq.com>
Date: Sun, 6 Apr 2025 00:05:03 +0800
Subject: [PATCH] =?UTF-8?q?Feat(=E4=BA=91=E7=81=B5AI):=E5=AF=B9=E8=AF=9D?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
aiChat/components/bottomSend.vue | 61 ++++--
aiChat/components/historyList.vue | 61 +++++-
aiChat/mixins/chatMixins.js | 4 +
aiChat/views/history.vue | 349 ++++++++++++++++++++++++++++++
aiChat/views/index.vue | 9 +-
api/chat/index.js | 8 +
api/voiceToText/index.js | 8 +-
assets/css/aiChat.less | 52 +++--
pages.json | 8 +
9 files changed, 505 insertions(+), 55 deletions(-)
create mode 100644 aiChat/views/history.vue
diff --git a/aiChat/components/bottomSend.vue b/aiChat/components/bottomSend.vue
index 672274e..4a624c8 100644
--- a/aiChat/components/bottomSend.vue
+++ b/aiChat/components/bottomSend.vue
@@ -5,15 +5,6 @@
}"
class="fix-page-bottom"
>
-
-
-
-
-
-
-
-
-
历史
@@ -60,15 +51,44 @@
-
- 按住说话
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -199,10 +219,9 @@ export default {
_this.taskId = ''
_this.clearIntervalFn()
uni.uploadFile({
- url: `${VUE_APP_API_URL + settings.sysPrefix}/common/file/local/upload`,
+ url: `${VUE_APP_API_URL}/api/upload`,
filePath: tempFilePath,
header: {
- 'client-id': 'app',
Authorization: 'Bearer ' + (_this.token || '')
},
name: 'file',
@@ -220,8 +239,10 @@ export default {
},
renderTransTask(uploadRes) {
const _this = this
+ const file = JSON.parse(uploadRes.data).link || ''
+ if (!file) return
makeFileTransTask({
- file: `${VUE_APP_API_URL + settings.sysPrefix}` + JSON.parse(uploadRes.data).data.fileUrl
+ file
}).then(taskRes => {
_this.taskId = taskRes.data
_this.getTransResultReq()
diff --git a/aiChat/components/historyList.vue b/aiChat/components/historyList.vue
index 728a3b9..ea9d3d2 100644
--- a/aiChat/components/historyList.vue
+++ b/aiChat/components/historyList.vue
@@ -16,9 +16,11 @@
30天内
@@ -26,6 +28,31 @@
v-for="(item, index) in list"
:key="index"
class="item"
+ @click="historyItemClick(item)"
+ >
+
+ {{ item.title }}
+
+
+
+
+
+
+ 超过30天
+
+
+
+
{{ item.title }}
@@ -39,7 +66,8 @@
+
diff --git a/aiChat/views/index.vue b/aiChat/views/index.vue
index 6f7a2fc..6b8246b 100644
--- a/aiChat/views/index.vue
+++ b/aiChat/views/index.vue
@@ -209,7 +209,7 @@
@history="historyViewHandle"
/>
@@ -233,9 +233,7 @@ export default {
data() {
return {
settingInfo: {},
- topicList: [],
- historyList: [],
- moreList: []
+ topicList: []
}
},
methods: {
@@ -264,9 +262,6 @@ export default {
this.loading = false
this.getConfigLoading = false
this.chatMessageList = []
- },
- historyViewHandle() {
- this.$refs.history.showView()
}
}
}
diff --git a/api/chat/index.js b/api/chat/index.js
index 0f5bca0..14f241b 100644
--- a/api/chat/index.js
+++ b/api/chat/index.js
@@ -15,3 +15,11 @@ export function deleteChatItemByConversationId(id) {
export function getChatList(params) {
return request.get('/v1/chat', params, { login: true })
}
+
+export function historyChatMessage(params) {
+ return request.get('/v1/chat/message', params, { login: true })
+}
+
+export function deleteChatListByType(type) {
+ return request.delete('/v1/chat/type/' + type, {}, { login: true })
+}
diff --git a/api/voiceToText/index.js b/api/voiceToText/index.js
index 9c2a91b..0941ab0 100644
--- a/api/voiceToText/index.js
+++ b/api/voiceToText/index.js
@@ -1,11 +1,9 @@
-import {
- postAction
-} from '@/api/http.js'
+import request from '@/utils/request'
export function makeFileTransTask(data) {
- return postAction('/app/voiceToText/makeFileTransTask', data)
+ return request.post('/app/voiceToText/makeFileTransTask', data, { login: true })
}
export function getFileTransResult(data) {
- return postAction('/app/voiceToText/getFileTransResult', data)
+ return request.post('/app/voiceToText/getFileTransResult', data, { login: true })
}
diff --git a/assets/css/aiChat.less b/assets/css/aiChat.less
index 6452833..53e23c5 100644
--- a/assets/css/aiChat.less
+++ b/assets/css/aiChat.less
@@ -199,23 +199,36 @@ page {
height: 88rpx;
}
}
- .sound-input-wrap {
+ }
+ .sound-input-wrap {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex: 1;
+ height: 100rpx;
+ padding: 0 24rpx;
+ border-radius: 50rpx;
+ color: #fff;
+ font-size: 30rpx;
+ background: #fff;
+ box-shadow: 0rpx 6rpx 20rpx rgba(19,27,65,0.16);
+ .toggle-btn {
+ .input-icon {
+ display: block;
+ width: 48rpx;
+ height: 48rpx;
+ }
+ }
+ .sound-wrap {
+ flex: 1;
display: flex;
align-items: center;
justify-content: center;
- flex: 1;
- height: 100rpx;
- margin: 0 0 0 24rpx;
- border-radius: 40rpx;
- color: #fff;
- font-size: 30rpx;
- background: linear-gradient(360deg, #FA9108 0%, #FFA734 100%);
- box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.16);
.icon {
display: block;
- width: 40rpx;
- height: 40rpx;
- margin: 0 12rpx 0 0;
+ width: 60rpx;
+ height: 60rpx;
+ margin: 0 24rpx;
}
}
}
@@ -688,20 +701,14 @@ page {
}
.music-wrap {
- position: absolute;
- left: 0;
- right: 0;
- top: -148rpx;
- z-index: 5;
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
- padding: 24rpx;
- background-color: #fff;
+ transform: scale(0.5) translateX(50%);
.item {
- width: 8px;
- margin: 0 24rpx;
+ width: 6px;
+ margin: 0 8rpx;
border-radius: 6px;
background-color: #3D4CF1;
}
@@ -734,6 +741,9 @@ page {
animation: radius-animation .7s infinite linear;
}
}
+.music-wrap2 {
+ transform: scale(0.5) translateX(-50%);
+}
@keyframes radius-animation {
100% {
height: 20rpx;
diff --git a/pages.json b/pages.json
index ad16eee..c06e830 100644
--- a/pages.json
+++ b/pages.json
@@ -852,6 +852,14 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
+ },
+ {
+ "path": "views/history",
+ "style": {
+ "navigationBarTitleText": "云灵AI智能助手",
+ "navigationStyle": "custom",
+ "navigationBarTextStyle": "white"
+ }
}
]
},