From 65617baa96b1341239bc0ca69370f94c5afcde78 Mon Sep 17 00:00:00 2001 From: zhangyahui Date: Tue, 23 Dec 2025 14:41:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=87=E6=8D=A2customer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Workshop/home.vue | 4 ++-- src/views/Workshop/profile.vue | 14 +++++++++++++- src/views/login/customer.vue | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/views/Workshop/home.vue b/src/views/Workshop/home.vue index 783c6c2..29dc2b2 100644 --- a/src/views/Workshop/home.vue +++ b/src/views/Workshop/home.vue @@ -8,7 +8,7 @@ import { FlowType } from '@/types/enum' //const props = defineProps({ //}) const emit = defineEmits([ - 'view-type' + 'viewType' ]) // const data = reactive({ @@ -23,7 +23,7 @@ const historicalReview = ()=>{ } onMounted(()=>{ - emit('view-type', 1) + emit('viewType', 1) }) onUnmounted(()=>{ }) diff --git a/src/views/Workshop/profile.vue b/src/views/Workshop/profile.vue index c221087..ae7eafa 100644 --- a/src/views/Workshop/profile.vue +++ b/src/views/Workshop/profile.vue @@ -4,9 +4,13 @@ import router from '@/router' import { showConfirmDialog } from 'vant' import { useUserInfoStore, useOverallStore } from '@/stores' import { LogOut } from '@/api/login' -import { getCustomerList, type CustomerListParams } from '@/api/workshop' +import { getCustomerList, type CustomerListParams,customerCheckin } from '@/api/workshop' import MyEvent from '@/utils/myEvent' +const props = defineProps<{ + isCustomer?: boolean +}>() + const userInfoStore = useUserInfoStore() const overallStore = useOverallStore() const emit = defineEmits(['view-type', 'selected-customer']) @@ -148,6 +152,14 @@ const handleSelectCustomer = () => { if (selectedCustomer) { emit('selected-customer', selectedCustomer) } + if(!props.isCustomer){ + // show.value = true + customerCheckin({ nickname: selectedCustomer.name }).then((res) => { + useUserInfoStore().resetGenerateParams() + MyEvent.emit('clear-generate-state') + useUserInfoStore().setCustomerInfo(res) + }) + } showSwitchCustomerPopup.value = false } diff --git a/src/views/login/customer.vue b/src/views/login/customer.vue index 0e49d5d..4df7116 100644 --- a/src/views/login/customer.vue +++ b/src/views/login/customer.vue @@ -58,7 +58,7 @@ - +