Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/lanecarford_front
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped
This commit is contained in:
@@ -268,7 +268,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<my-list v-model:loading="loading" v-model:finish="finish" @load="onLoad">
|
||||
<my-list
|
||||
v-model:loading="loading"
|
||||
v-model:finish="finish"
|
||||
@load="onLoad"
|
||||
:empty="list.length === 0"
|
||||
>
|
||||
<div
|
||||
class="item"
|
||||
v-for="(v, i) in list"
|
||||
|
||||
@@ -121,7 +121,9 @@
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="loading" v-if="loading"><generate-loading /></div>
|
||||
<div class="loading" v-if="loading">
|
||||
<generate-loading title="Generating Results..." />
|
||||
</div>
|
||||
<div class="customize" v-else>
|
||||
<div class="title">Customize your Look!</div>
|
||||
<p class="tip">Refine your Look</p>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
cancelButtonText: 'Cancel'
|
||||
}).catch(() => 0)
|
||||
if (res === 0) return
|
||||
console.log(obj,i)
|
||||
console.log(obj, i)
|
||||
deleteCustomerPhoto(obj.visitRecordId)
|
||||
.then(() => {
|
||||
list.splice(i, 1)
|
||||
@@ -68,7 +68,12 @@
|
||||
<div class="library">
|
||||
<div class="title">Library</div>
|
||||
<div class="list">
|
||||
<my-list v-model:loading="loading" v-model:finish="finish" @load="onLoad">
|
||||
<my-list
|
||||
v-model:loading="loading"
|
||||
v-model:finish="finish"
|
||||
:empty="list.length === 0"
|
||||
@load="onLoad"
|
||||
>
|
||||
<div class="item" v-for="(v, i) in list" :key="v.visitRecordId">
|
||||
<div class="image">
|
||||
<img v-lazy="v.defaultImageUrl" />
|
||||
@@ -115,18 +120,18 @@
|
||||
}
|
||||
|
||||
> .title {
|
||||
font-family: satoshiRegular;
|
||||
font-size: 9rem;
|
||||
font-family: satoshiBold;
|
||||
font-size: 8.9rem;
|
||||
text-align: left;
|
||||
line-height: 124%;
|
||||
margin: 5rem;
|
||||
margin: 5rem 9.1rem;
|
||||
}
|
||||
> .list {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
margin: 0 3rem;
|
||||
margin: 0 4.5rem;
|
||||
> .my-list {
|
||||
padding: 0 3.8rem;
|
||||
padding: 0 4.5rem;
|
||||
--my-list-footer-margin: 2rem 0;
|
||||
> .item {
|
||||
position: relative;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, inject } from 'vue'
|
||||
import router from '@/router'
|
||||
import { showConfirmDialog } from 'vant'
|
||||
import { showConfirmDialog, showToast } from 'vant'
|
||||
import { useUserInfoStore, useOverallStore } from '@/stores'
|
||||
import { LogOut } from '@/api/login'
|
||||
import { getCustomerList, type CustomerListParams,customerCheckin } from '@/api/workshop'
|
||||
import { getCustomerList, type CustomerListParams, customerCheckin } from '@/api/workshop'
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
import { encryptPassword } from '@/utils/tools'
|
||||
import { updateUserInfo } from '@/api/login'
|
||||
|
||||
const props = defineProps<{
|
||||
isCustomer?: boolean
|
||||
@@ -17,11 +19,14 @@ const emit = defineEmits(['selected-customer'])
|
||||
const show = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const form = reactive({
|
||||
name: { msg: '', value: userInfoStore.state.userInfo.username },
|
||||
email: { msg: '', value: userInfoStore.state.userInfo.email },
|
||||
password: { show: false, msg: '', value: userInfoStore.state.userInfo.password }
|
||||
name: { msg: '', value: '' },
|
||||
email: { msg: '', value: '' },
|
||||
password: { show: true, msg: '', value: '' }
|
||||
})
|
||||
const open = () => {
|
||||
form.name.value = userInfoStore.state.userInfo.username
|
||||
form.email.value = userInfoStore.state.userInfo.email
|
||||
form.password.value = ''
|
||||
isEdit.value = false
|
||||
show.value = true
|
||||
}
|
||||
@@ -41,14 +46,38 @@ const switchCustomer = () => {
|
||||
handleShowPopup(true)
|
||||
}
|
||||
const edit = () => {
|
||||
form.password.value = ''
|
||||
isEdit.value = true
|
||||
}
|
||||
const confirm = () => {
|
||||
if (!isEdit.value) return
|
||||
const password = form.password.value
|
||||
const params = {
|
||||
username: form.name.value,
|
||||
email: form.email.value,
|
||||
password
|
||||
}
|
||||
if (password) {
|
||||
if (password.length < 6) {
|
||||
return showToast('Password must be at least 6 characters')
|
||||
} else {
|
||||
params.password = encryptPassword(password)
|
||||
}
|
||||
} else {
|
||||
params.password = userInfoStore.state.userInfo.password
|
||||
}
|
||||
|
||||
overallStore.setLoading(true)
|
||||
setTimeout(() => {
|
||||
updateUserInfo(params).then((res) => {
|
||||
overallStore.setLoading(false)
|
||||
showToast('Update success')
|
||||
userInfoStore.setUserInfo({
|
||||
...userInfoStore.state.userInfo,
|
||||
...params
|
||||
})
|
||||
form.password.value = ''
|
||||
isEdit.value = false
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
const logout = () => {
|
||||
showConfirmDialog({
|
||||
@@ -137,6 +166,7 @@ const onScroll = (e: Event) => {
|
||||
// 打开customer选择时关闭profile弹窗 如果不是点击confirem关闭则重新打开profile弹窗
|
||||
const handleShowPopup = (flag: boolean) => {
|
||||
showSwitchCustomerPopup.value = flag
|
||||
if (props.isCustomer) return
|
||||
show.value = !flag
|
||||
if (flag) {
|
||||
loadCustomers(true)
|
||||
@@ -152,7 +182,7 @@ const handleSelectCustomer = () => {
|
||||
if (selectedCustomer) {
|
||||
emit('selected-customer', selectedCustomer)
|
||||
}
|
||||
if(!props.isCustomer){
|
||||
if (!props.isCustomer) {
|
||||
// show.value = true
|
||||
customerCheckin({ nickname: selectedCustomer.name }).then((res) => {
|
||||
useUserInfoStore().resetGenerateParams()
|
||||
@@ -168,15 +198,15 @@ const handleFetchCustomerList = () => {
|
||||
}
|
||||
MyEvent.add('update-customer-list', handleFetchCustomerList)
|
||||
|
||||
const openSwitchCustomerPopup = (flag = true) => {
|
||||
showSwitchCustomerPopup.value = flag
|
||||
}
|
||||
// const openSwitchCustomerPopup = (flag = true) => {
|
||||
// showSwitchCustomerPopup.value = flag
|
||||
// }
|
||||
|
||||
onMounted(() => {
|
||||
handleFetchCustomerList()
|
||||
})
|
||||
|
||||
defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
defineExpose({ open, close, handleShowPopup })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -186,7 +216,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
<span class="title">Profile</span>
|
||||
<van-icon name="cross" class="close" @click="close" />
|
||||
</div>
|
||||
<div class="box">
|
||||
<form class="box" @submit.prevent.stop="confirm">
|
||||
<div class="form-item">
|
||||
<div class="label">Your Name</div>
|
||||
<label class="input">
|
||||
@@ -196,6 +226,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
placeholder="Enter your name"
|
||||
v-model="form.name.value"
|
||||
:readonly="!isEdit"
|
||||
required
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('name')">
|
||||
<SvgIcon name="confirmation" size="37" />
|
||||
@@ -226,7 +257,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
</label>
|
||||
<p class="error" v-show="form.email.msg">{{ form.email.msg }}</p>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<div class="form-item" v-if="isEdit">
|
||||
<div class="label">Password</div>
|
||||
<label class="input">
|
||||
<div class="icon" @click="form.password.show = !form.password.show">
|
||||
@@ -249,7 +280,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
</div>
|
||||
|
||||
<template v-if="isEdit">
|
||||
<button class="confirm" @click="confirm">Confirm</button>
|
||||
<button type="submit" class="confirm">Confirm</button>
|
||||
<p class="tip">Powered by AiDLab for Lane Crawford</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -257,7 +288,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
<button class="edit" @click="edit">Edit Profile</button>
|
||||
<button class="logout" @click="logout">Log out</button>
|
||||
</template>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
@@ -289,12 +320,13 @@ defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
<img v-show="item.checked" class="checked-icon" src="@/assets/images/checked.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-footer">
|
||||
<div v-if="pager.loading">Loading...</div>
|
||||
<div v-else-if="pager.noMore">No more</div>
|
||||
<div class="list-footer">
|
||||
<div v-if="pager.loading">Loading...</div>
|
||||
<div v-else-if="pager.noMore">No more</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="confirm-btn" @click="handleSelectCustomer">Confirm</div>
|
||||
<div class="van-safe-area-bottom"></div>
|
||||
</van-popup>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user