|
|
@@ -3,11 +3,7 @@
|
|
|
<div v-if="currentStep === 0" class="home-entry">
|
|
|
<h3 class="title"><el-image :src="homeIcon" class="homeIcon" />免费入驻店铺</h3>
|
|
|
<div class="steps-container">
|
|
|
- <el-steps
|
|
|
- align-center
|
|
|
- :active="storeApplicationStatus == 0 || storeApplicationStatus == 2 ? 2 : 0"
|
|
|
- :finish-status="storeApplicationStatus == 0 || storeApplicationStatus == 2 ? 'success' : undefined"
|
|
|
- >
|
|
|
+ <el-steps align-center :active="stepActive" :finish-status="stepFinishStatus">
|
|
|
<el-step v-for="(item, index) in entryList" :key="index">
|
|
|
<template #title>
|
|
|
<div class="step-title-wrapper">
|
|
|
@@ -33,7 +29,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, defineProps, defineEmits } from "vue";
|
|
|
+import { ref, defineProps, defineEmits, computed } from "vue";
|
|
|
+import { localGet } from "@/utils/index";
|
|
|
import homeIcon from "../../../assets/images/home-icon.png";
|
|
|
|
|
|
const entryList = ref([
|
|
|
@@ -71,6 +68,35 @@ const props = defineProps({
|
|
|
|
|
|
const emit = defineEmits(["update:currentStep"]);
|
|
|
|
|
|
+// 检查用户是否已完成个人实名认证
|
|
|
+const hasCompletedRealName = computed(() => {
|
|
|
+ const geekerUser = localGet("geeker-user");
|
|
|
+ return geekerUser?.userInfo?.idCard ? true : false;
|
|
|
+});
|
|
|
+
|
|
|
+// 计算步骤的 active 值
|
|
|
+const stepActive = computed(() => {
|
|
|
+ // 如果审核状态为等待审核(0)或审核拒绝(2),显示第三步
|
|
|
+ if (props.storeApplicationStatus == 0 || props.storeApplicationStatus == 2) {
|
|
|
+ return 2;
|
|
|
+ }
|
|
|
+ // 如果已完成个人实名认证,显示第二步
|
|
|
+ if (hasCompletedRealName.value) {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ // 否则显示第一步
|
|
|
+ return 0;
|
|
|
+});
|
|
|
+
|
|
|
+// 计算 finish-status
|
|
|
+const stepFinishStatus = computed(() => {
|
|
|
+ // 如果审核状态为等待审核(0)或审核拒绝(2),或者已完成个人实名认证,显示成功状态
|
|
|
+ if (props.storeApplicationStatus == 0 || props.storeApplicationStatus == 2 || hasCompletedRealName.value) {
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ return undefined;
|
|
|
+});
|
|
|
+
|
|
|
// 处理入驻按钮
|
|
|
// 点击后跳转到 go-flow 组件(步骤1:填写信息)
|
|
|
const handleRegister = () => {
|