| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <div id="home">
- <!--已入驻-->
- <go-examine v-if="isExaime" />
- <!-- 第一步 未入驻 -->
- <go-enter
- :current-step="currentStep"
- :store-application-status="storeApplicationStatus"
- @update:current-step="handleUpdateCurrentStep"
- />
- <!-- 第二步
- @update:get-user-info="getUserInfo"-->
- <go-flow
- :current-step="currentStep"
- @update:current-step="handleUpdateCurrentStep"
- :store-application-status="storeApplicationStatus"
- />
- </div>
- </template>
- <script setup lang="ts">
- import { onMounted, ref, watch } from "vue";
- import { localGet, localSet } from "@/utils/index";
- import goEnter from "../home/components/go-enter.vue";
- import goFlow from "./go-flow.vue";
- import goExamine from "../home/components/go-examine.vue";
- import { getMerchantByPhone, getDetail } from "@/api/modules/homeEntry";
- import { is } from "@/utils/is";
- import { useAuthStore } from "@/stores/modules/auth";
- const authStore = useAuthStore();
- const isEntry = ref<boolean>(false);
- const isExaime = ref<boolean>(false);
- onMounted(() => {
- // getUserInfo();
- });
- // 当前步骤:0-首页,1-第一步,2-第二步
- const currentStep = ref(0);
- const storeId = ref<Number | undefined>(undefined);
- // 处理更新currentStep事件
- const handleUpdateCurrentStep = (step: number) => {
- currentStep.value = step;
- };
- let storeApplicationStatus = ref<number | undefined>(undefined);
- // const getUserInfo = async () => {
- // try {
- // const geekerUser = localGet("geeker-user");
- // if (!geekerUser || !geekerUser.userInfo || !geekerUser.userInfo.phone) {
- // console.error("用户信息不存在");
- // return;
- // }
- // let param = {
- // phone: geekerUser.userInfo.phone
- // };
- // const res: any = await getMerchantByPhone(param);
- // storeId.value = res.data.storeId;
- // if (res && res.code == 200 && res.data) {
- // // 更新缓存中的 storeId
- // geekerUser.userInfo.storeId = res.data.storeId;
- // localSet("geeker-user", geekerUser);
- // // 同时更新 createdId 缓存
- // if (res.data.storeId) {
- // localSet("createdId", res.data.storeId);
- // }
- // if (res.data.storeId == null) {
- // isEntry.value = true;
- // }
- // if (res.data.storeId != null) {
- // let param1 = {
- // id: res.data.storeId
- // };
- // const resStore: any = await getDetail(param1);
- // if (resStore && resStore.code == 200 && resStore.data) {
- // // storeApplicationStatus.value = resStore.data.storeApplicationStatus;
- // // // 如果是等待审核(0)或审核拒绝(2),且当前步骤为0,显示 go-enter 组件
- // // // 如果用户已经主动跳转到其他步骤,则不重置步骤
- // // if ((storeApplicationStatus.value == 0 || storeApplicationStatus.value == 2) && currentStep.value === 0) {
- // // currentStep.value = 0;
- // // }
- // if (resStore.data.storeApplicationStatus !== 1 && res.data.storeId != null) {
- // //storeId && storeDetail.storeApplicationStatus === 1
- // isEntry.value = true;
- // } else {
- // isExaime.value = true;
- // }
- // }
- // }
- // }
- // } catch (error) {
- // console.error(error);
- // }
- // };
- </script>
- <style scoped lang="scss"></style>
|