Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/lanecarford_front

This commit is contained in:
X1627315083
2025-10-28 15:30:56 +08:00
6 changed files with 44 additions and 33 deletions

View File

@@ -25,6 +25,7 @@
})
.then(() => {
MyEvent.emit('clear-generate-state')
MyEvent.emit('clearAllCache')
nav.path && router.push(nav.path)
})
.catch(() => {})

View File

@@ -1,17 +1,18 @@
<template>
<div class="routeCache" :view-type="viewType">
<router-view v-slot="{ Component, route }" @view-type="changeViewType">
<keep-alive :include="cachedViews">
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view>
</div>
<div class="routeCache" :view-type="viewType">
<router-view v-slot="{ Component, route }" @view-type="changeViewType">
<keep-alive :include="cachedViews">
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view>
</div>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { ref, watch, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router'
import MyEvent from '@/utils/myEvent'
const route = useRoute()
@@ -54,18 +55,21 @@ const clearCache = (routeName?: string) => {
}
}
onMounted(() => {
MyEvent.add('clearAllCache', clearCache)
})
//根据viewType设置布局风格样式
const viewType = ref(0)
const changeViewType = (v: number) => {
viewType.value = v
viewType.value = v
}
const router = useRouter()
watch(
() => router.currentRoute.value,
() => (viewType.value = 0)
() => router.currentRoute.value,
() => (viewType.value = 0)
)
// 暴露方法供外部使用
defineExpose({
clearCache,
@@ -73,15 +77,15 @@ defineExpose({
})
</script>
<style lang="less" scoped>
.routeCache {
width: 100%;
height: 100%;
position: relative;
font-family: 'satoshiRegular';
&[view-type='1'] {
display: flex;
flex-direction: column;
overflow: hidden;
}
}
</style>
.routeCache {
width: 100%;
height: 100%;
position: relative;
font-family: 'satoshiRegular';
&[view-type='1'] {
display: flex;
flex-direction: column;
overflow: hidden;
}
}
</style>

View File

@@ -114,11 +114,18 @@ export const useGenerateStore = defineStore({
this.customizeInfo.isRegenerated = ''
this.customizeInfo.isFavorite = false
},
clearCustomerInfo(){
this.customerInfo = {
customerId: '',
visitRecordId: ''
}
},
//设置默认数据
clearGenerateData() {
this.clearProductData()
this.updatePhotoInfo({})
this.clearCustomizeInfo()
this.clearCustomerInfo()
},
setCustomerInfo(data: any) {
this.customerInfo = data

View File

@@ -2,7 +2,6 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import { removeLocal, setLocal } from '@/utils/local'
import MyEvent from '@/utils/myEvent'
export const useUserInfoStore = defineStore('userInfo', () => {
const state = ref({
userInfo: {},
@@ -48,7 +47,6 @@ export const useUserInfoStore = defineStore('userInfo', () => {
state.value.userInfo = {}
removeLocal('token')
resetGenerateParams()
MyEvent.emit('clear-generate-state')
resolve('')
})
}

View File

@@ -34,14 +34,14 @@
<AudioVisualizer ref="audioVisualizerRef" />
</div>
<div v-show="showAudioRecorder" class="audio-recorder-wrapper">
<!-- <div v-show="showAudioRecorder" class="audio-recorder-wrapper">
<AudioRecorder
ref="audioRecorderRef"
@recording-started="onRecordingStarted"
@recording-stopped="onRecordingStopped"
@recording-deleted="onRecordingDeleted"
/>
</div>
</div> -->
</div>
<div class="icon-wrapper" v-show="!isRecording" @click="handleClickAudio">
@@ -63,7 +63,7 @@
<script setup lang="ts">
import { ref, onUnmounted, nextTick } from 'vue'
import AudioVisualizer from './AudioVisualizer.vue'
import AudioRecorder from './AudioRecorder.vue'
// import AudioRecorder from './AudioRecorder.vue'
import { showToast } from 'vant'
import { getAudioFileInfo, uploadAudioFile, prepareAudioForTTS } from '@/utils/audioUtils'
@@ -73,7 +73,7 @@ const inputValue = ref<string>('')
const isRecording = ref<boolean>(false)
const showAudioRecorder = ref<boolean>(false)
const audioVisualizerRef = ref<InstanceType<typeof AudioVisualizer> | null>(null)
const audioRecorderRef = ref<InstanceType<typeof AudioRecorder> | null>(null)
// const audioRecorderRef = ref<InstanceType<typeof AudioRecorder> | null>(null)
const textareaRef = ref<HTMLTextAreaElement | null>(null)
const shortcutList: string[] = [
'Suggest shoe styles',

View File

@@ -45,9 +45,9 @@
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useGenerateStore } from '@/stores'
import { useGenerateStore,useUserInfoStore } from '@/stores'
import { showToast } from 'vant'
import { customerCheckin } from '@/api/workshop'
@@ -81,7 +81,8 @@ const handleConfirm = async () => {
console.log('customerData.value', customerData.value)
customerCheckin(customerData.value).then((res) => {
console.log('res', res)
useUserInfoStore().resetGenerateParams()
// console.log('res', res)
generateStore.setCustomerInfo(res)
router.push('/stylist/index')
})