去掉流程类型,改为在路由中表示流程
This commit is contained in:
@@ -5,15 +5,6 @@ export const useOverallStore = defineStore({
|
||||
state: () => {
|
||||
return {
|
||||
loading:false,
|
||||
/**
|
||||
* 流程类型
|
||||
* main: 主流程
|
||||
* reinventing: 魔改
|
||||
* stylist: 查看设计师
|
||||
* clientId: 切换客户
|
||||
*
|
||||
*/
|
||||
flowType:'',
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@@ -24,8 +15,5 @@ export const useOverallStore = defineStore({
|
||||
setLoading(data:boolean){
|
||||
this.loading = data
|
||||
},
|
||||
setFlowType(data:string){
|
||||
this.flowType = data
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,7 +3,6 @@ import { onMounted, onUnmounted, reactive, toRefs, computed, onActivated } from
|
||||
import HeaderTitle from '@/components/HeaderTitle.vue'
|
||||
import FooterNavigation from '@/components/FooterNavigation.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useOverallStore } from '@/stores'
|
||||
const router = useRouter()
|
||||
import { showConfirmDialog } from 'vant'
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
@@ -14,7 +13,6 @@ const emit = defineEmits([
|
||||
'view-type'
|
||||
])
|
||||
|
||||
const overallStore = useOverallStore()
|
||||
// const data = reactive({
|
||||
// })
|
||||
|
||||
@@ -28,14 +26,18 @@ const clickSwitchVIPID = ()=>{
|
||||
.then(() => {
|
||||
MyEvent.emit('clear-generate-state')
|
||||
MyEvent.emit('clearAllCache')
|
||||
router.push('/stylist/customer')
|
||||
router.push({ name: 'customer', query: { demo: 1 } })
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
const openFlow = (path:string,flowType:string)=>{
|
||||
if(flowType == 'clientId')return clickSwitchVIPID
|
||||
overallStore.setFlowType(flowType)
|
||||
if(flowType == 'clientId')return clickSwitchVIPID()
|
||||
router.push(path)
|
||||
if(flowType == 'main'){
|
||||
router.push({ name: path })
|
||||
}else{
|
||||
router.push({ name: path, query: { demo: 1 } })
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
@@ -58,13 +60,13 @@ defineExpose({})
|
||||
Explore
|
||||
</div>
|
||||
<div class="navList">
|
||||
<div class="item" @click="openFlow('/stylist/index','main')">
|
||||
<div class="item" @click="openFlow('index','main')">
|
||||
<img src="@/assets/images/nav1.png" alt="">
|
||||
</div>
|
||||
<div class="item" @click="openFlow('/workshop/recommended','reinventing')">
|
||||
<div class="item" @click="openFlow('recommended','reinventing')">
|
||||
<img src="@/assets/images/nav2.png" alt="">
|
||||
</div>
|
||||
<div class="item" @click="openFlow('/stylist/index','stylist')">
|
||||
<div class="item" @click="openFlow('index','stylist')">
|
||||
<img src="@/assets/images/nav3.png" alt="">
|
||||
</div>
|
||||
<div class="item" @click="openFlow('','clientId')">
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Continue按钮 -->
|
||||
<div class="continue-button" @click="handleContinue" v-if="overallStore.flowType == 'main'">Continue</div>
|
||||
<div class="continue-button" @click="handleContinue" v-if="!$route.query?.demo">Continue</div>
|
||||
<van-dialog
|
||||
class="video-dialog"
|
||||
:show-confirm-button="false"
|
||||
@@ -61,7 +61,6 @@ import male from '@/assets/images/male.png'
|
||||
import female from '@/assets/images/female.png'
|
||||
import HeaderTitle from '@/components/HeaderTitle.vue'
|
||||
import FooterNavigation from '@/components/FooterNavigation.vue'
|
||||
import { useOverallStore } from '@/stores'
|
||||
|
||||
const router = useRouter()
|
||||
const userInfoStore = useUserInfoStore()
|
||||
@@ -102,7 +101,6 @@ const swiperRef = ref<any>(null)
|
||||
const showVideo = ref<boolean>(false)
|
||||
const videoRef = ref<any>(null)
|
||||
|
||||
const overallStore = useOverallStore()
|
||||
|
||||
const handleChangeCurrent = (index: number) => {
|
||||
currentChoosed.value = stylists.value[index].id
|
||||
|
||||
Reference in New Issue
Block a user