diff --git a/src/components/selectStyle/selectItem.vue b/src/components/selectStyle/selectItem.vue index e8dccd0..02fc9e5 100644 --- a/src/components/selectStyle/selectItem.vue +++ b/src/components/selectStyle/selectItem.vue @@ -25,7 +25,7 @@ const setLike = (item,str)=>{ } const setSelectList = (item)=>{ - emit('selectItem', item) + if(item.status == 'SUCCEEDED')emit('selectItem', item) } const deleteStyle = (index)=>{ @@ -57,6 +57,9 @@ const {} = toRefs(data);
+
+ Generation failed. Please click refresh to try again. +
@@ -116,6 +119,13 @@ const {} = toRefs(data); background-color: rgba(0, 0, 0, 0.5); top: 0; left: 0; + &.failed{ + color: #fff; + font-size: 2rem; + display: flex; + align-items: center; + justify-content: center; + } .van-loading { display: flex; justify-content: center; diff --git a/src/stores/modules/generate.ts b/src/stores/modules/generate.ts index 67bd9aa..19bb34b 100644 --- a/src/stores/modules/generate.ts +++ b/src/stores/modules/generate.ts @@ -83,19 +83,21 @@ export const useGenerateStore = defineStore({ actions: { selectStyle(data: any) { this.style.id = data.id - console.log(this) }, //生成后去掉id 设置oldId来修改样式 useStyleGenerate() { if (!this.style.id) return this.style.oldId = this.style.id - this.style.id = '' + // this.style.id = '' }, updateStyle(data) { - console.log(data) if (data.id == this.style.oldId) { this.style.oldId = '' } + if(data.id == this.style.id) { + this.style.id = '' + } + console.log(this.style) }, //模特相关 selectModel(data: any) { diff --git a/src/views/Workshop/selectStyle.vue b/src/views/Workshop/selectStyle.vue index 05315e0..e526019 100644 --- a/src/views/Workshop/selectStyle.vue +++ b/src/views/Workshop/selectStyle.vue @@ -24,7 +24,7 @@ let data = reactive({ let getGenerateTime = null as any const selectItem = (item)=>{ - if((item.id == data.select?.oldId) || !item.id || item.status != 'SUCCEEDED'){ + if(!item.id || item.status != 'SUCCEEDED'){ return } generateStore.selectStyle(item) @@ -37,11 +37,11 @@ const updateStyle = ({item,index})=>{ } const toProduct = ()=>{ - if(!generateStore.style.id && !generateStore.style.oldId){ + if(!generateStore.style.id){ showToast({ message: 'Please select a style.' }); return } - if(generateStore.style.id){ + if(generateStore.style.id != generateStore.style.oldId){ generateStore.setIsGenerate(true) } router.push({ path: 'product' }) @@ -94,7 +94,6 @@ onMounted(()=>{ emit('view-type', 1) // if(!data.styleList[0]?.id)getRequestOutfitList(0) if(getGenerateTime)clearTimeout(getGenerateTime) - console.log(data.styleList) if(!data.styleList[0]?.taskId){ requestOutfit({num:4,index:0}) }else if(data.styleList.filter((item)=>item?.status != 'SUCCEEDED').length > 0){ 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 e1ed77f..78a6be9 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
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+