From d53a94a949d2a1495cd8f3a3db92c0e8e49fb8d0 Mon Sep 17 00:00:00 2001 From: zhangyahui Date: Mon, 17 Nov 2025 17:38:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20dressfor=E9=A1=B5=E9=9D=A2=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E8=81=8A=E5=A4=A9=E8=B5=B7=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asistant/components/AudioVisualizer.vue | 7 +- src/views/asistant/components/InputArea.vue | 2 +- src/views/asistant/index.vue | 15 +- src/views/stylist/customer.vue | 9 +- src/views/stylist/dressfor.vue | 207 ++++++++++++++++-- 5 files changed, 214 insertions(+), 26 deletions(-) diff --git a/src/views/asistant/components/AudioVisualizer.vue b/src/views/asistant/components/AudioVisualizer.vue index 101596e..96205ff 100644 --- a/src/views/asistant/components/AudioVisualizer.vue +++ b/src/views/asistant/components/AudioVisualizer.vue @@ -6,8 +6,8 @@ v-for="(line, index) in lines" :key="index" :class="['line', `line-${line.type}`]" - > > + > + @@ -44,7 +44,8 @@ const calculateLines = (): Line[] => { // 这样当滚动到50%时,内容看起来和开始一样 const availableWidth = containerWidth const lineWithGap = lineWidthPx + gapPx - const linesNeeded = Math.ceil(availableWidth / lineWithGap) + // 使用四舍五入让一个周期的宽度尽量接近容器宽度,减少滚动结束时的“回跳”感 + const linesNeeded = Math.max(1, Math.round(availableWidth / lineWithGap)) const generatedLines: Line[] = [] diff --git a/src/views/asistant/components/InputArea.vue b/src/views/asistant/components/InputArea.vue index 78b75a4..2cc5612 100644 --- a/src/views/asistant/components/InputArea.vue +++ b/src/views/asistant/components/InputArea.vue @@ -86,7 +86,7 @@ const shortcutList: string[] = [ const handleSend = (): void => { if (inputValue.value.trim()) { - console.log('input发送消息:', inputValue.value) + // console.log('input发送消息:', inputValue.value) emit('send-message', inputValue.value) inputValue.value = '' // 重置textarea高度 diff --git a/src/views/asistant/index.vue b/src/views/asistant/index.vue index 5ac71e4..97bdfcc 100644 --- a/src/views/asistant/index.vue +++ b/src/views/asistant/index.vue @@ -30,13 +30,14 @@ import NoticeList from './components/NoticeList.vue' import InputArea from './components/InputArea.vue' import GenerateLoading from './components/GenerateLoading.vue' import { ref, onMounted, onUnmounted, onActivated } from 'vue' -import { useRouter } from 'vue-router' +import { useRouter, useRoute } from 'vue-router' import { useUserInfoStore, useGenerateStore } from '@/stores' import { streamChatAddress } from '@/api/workshop' import { generateUUID } from '@/utils/tools' import { showToast } from 'vant' const router = useRouter() +const route = useRoute() const generateStore = useGenerateStore() const userInfoStore = useUserInfoStore() @@ -68,9 +69,21 @@ const isStreaming = ref(false) const currentStreamingMessage = ref(null) const sessionId = ref('') +const sendPrefilledMessage = () => { + const { message, ...restQuery } = route.query + if (typeof message === 'string' && message.trim()) { + handleSendMessage(message) + router.replace({ + path: route.path, + query: restQuery + }) + } +} + onMounted(() => { sessionId.value = Math.floor(Date.now() / 1000).toString() generateStore.setSessionId(sessionId.value) + sendPrefilledMessage() }) onActivated(() => { diff --git a/src/views/stylist/customer.vue b/src/views/stylist/customer.vue index 3211f95..c094bfe 100644 --- a/src/views/stylist/customer.vue +++ b/src/views/stylist/customer.vue @@ -25,15 +25,15 @@
- - + +
@@ -78,7 +78,6 @@ const handleConfirm = async () => { }) return } - console.log('customerData.value', customerData.value) customerCheckin(customerData.value).then((res) => { useUserInfoStore().resetGenerateParams() diff --git a/src/views/stylist/dressfor.vue b/src/views/stylist/dressfor.vue index 71161a2..a174e67 100644 --- a/src/views/stylist/dressfor.vue +++ b/src/views/stylist/dressfor.vue @@ -7,25 +7,164 @@
-->
What are you dressing for?
-
Start
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+