feat: 客户checkin
This commit is contained in:
@@ -26,11 +26,16 @@
|
||||
<div class="glass-form">
|
||||
<div class="form-field">
|
||||
<label class="field-label">Customer Name</label>
|
||||
<input v-model="customeData.name" type="text" placeholder="Name" class="form-input" />
|
||||
<input v-model="customerData.name" type="text" placeholder="Name" class="form-input" />
|
||||
</div>
|
||||
<div class="form-field email">
|
||||
<label class="field-label">Customer Email</label>
|
||||
<input v-model="customeData.email" type="email" placeholder="Email" class="form-input" />
|
||||
<input
|
||||
v-model="customerData.email"
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
class="form-input"
|
||||
/>
|
||||
</div>
|
||||
<button class="confirm-btn" @click="handleConfirm">Confirm</button>
|
||||
</div>
|
||||
@@ -42,10 +47,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
import { useGenerateStore } from '@/stores'
|
||||
import { showToast } from 'vant'
|
||||
const userInfoStore = useUserInfoStore()
|
||||
import { customerCheckin } from '@/api/workshop'
|
||||
|
||||
const router = useRouter()
|
||||
const generateStore = useGenerateStore()
|
||||
|
||||
type PageMode = 'form' | 'entry'
|
||||
const pageMode = ref<PageMode>('entry')
|
||||
@@ -58,21 +65,26 @@ const handleChangeMode = (mode: PageMode) => {
|
||||
pageMode.value = mode
|
||||
}
|
||||
|
||||
const customeData = ref({
|
||||
const customerData = ref({
|
||||
name: '',
|
||||
email: ''
|
||||
})
|
||||
|
||||
const handleConfirm = async () => {
|
||||
if (customeData.value.name === '' || customeData.value.email === '') {
|
||||
showToast('please input name and email')
|
||||
if (customerData.value.name === '' || customerData.value.email === '') {
|
||||
showToast({
|
||||
message: 'please input name and email',
|
||||
position: 'top'
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log('customerData.value', customerData.value)
|
||||
|
||||
// await 查找顾客ID
|
||||
// userInfoStore.setCustomerId('')
|
||||
|
||||
router.push('/stylist/index')
|
||||
customerCheckin(customerData.value).then((res) => {
|
||||
console.log('res', res)
|
||||
generateStore.setCustomerInfo(res)
|
||||
router.push('/stylist/index')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
||||
Reference in New Issue
Block a user