Browse Source

添加图片预览功能,优化财务管理菜单显示逻辑

zhuli 2 weeks ago
parent
commit
332aaee2e7

+ 36 - 2
src/layouts/components/Header/components/InfoDialog.vue

@@ -9,6 +9,7 @@
             list-type="picture-card"
             :limit="1"
             :on-exceed="onExceed"
+            :on-preview="handlePictureCardPreview"
           >
             <el-icon><Plus /></el-icon>
           </el-upload>
@@ -30,14 +31,22 @@
       </span>
     </template>
   </el-dialog>
+
+  <!-- 图片预览 -->
+  <el-image-viewer
+    v-if="imageViewerVisible"
+    :url-list="imageViewerUrlList"
+    :initial-index="imageViewerInitialIndex"
+    @close="imageViewerVisible = false"
+  />
 </template>
 
 <script setup lang="ts">
 import { ref, reactive, onMounted } from "vue";
 import { ElMessage, type FormInstance, type UploadUserFile, UploadRequestOptions } from "element-plus";
 import { Plus } from "@element-plus/icons-vue";
-import { getMerchantByPhone, updateMerchantUserInfo } from "@/api/modules/homeEntry.ts";
-import { uploadImg } from "@/api/modules/newLoginApi.ts";
+import { getMerchantByPhone, updateMerchantUserInfo } from "@/api/modules/homeEntry";
+import { uploadImg } from "@/api/modules/newLoginApi";
 import { localGet } from "@/utils/index";
 import defaultAvatar from "@/assets/images/avatar.gif";
 import { head } from "lodash";
@@ -57,6 +66,11 @@ const form = reactive({
   intro: ""
 });
 
+// 图片预览相关
+const imageViewerVisible = ref(false);
+const imageViewerUrlList = ref<string[]>([]);
+const imageViewerInitialIndex = ref(0);
+
 const getUserInfo = async () => {
   const res: any = await getMerchantByPhone({ phone: userInfo.phone });
   if (res.code == 200) {
@@ -140,4 +154,24 @@ defineExpose({ openDialog });
 const onExceed = () => {
   ElMessage.warning("仅允许上传一张头像");
 };
+
+// 图片预览处理函数
+const handlePictureCardPreview = (file: UploadUserFile) => {
+  // 如果文件正在上传中,允许预览(使用本地预览)
+  if (file.status === "uploading" && file.url) {
+    imageViewerUrlList.value = [file.url];
+    imageViewerInitialIndex.value = 0;
+    imageViewerVisible.value = true;
+    return;
+  }
+  // 获取头像图片的 URL
+  const avatarUrl = file.url || (file.response as any)?.fileUrl || "";
+  if (!avatarUrl) {
+    ElMessage.warning("图片尚未上传完成,无法预览");
+    return;
+  }
+  imageViewerUrlList.value = [avatarUrl];
+  imageViewerInitialIndex.value = 0;
+  imageViewerVisible.value = true;
+};
 </script>

+ 1 - 0
src/views/financialManagement/cashApply.vue

@@ -129,6 +129,7 @@ const handleConfirmSubmit = async () => {
     withdrawalMoney: withdrawAmount.value * 100
   });
   if (res.code == 200) {
+    router.go(-1);
     ElMessage.success("提现申请已发起成功,请耐心等待");
     cashDialogVisible.value = false;
     fetchAccountBalance();

+ 40 - 40
src/views/financialManagement/index.vue

@@ -47,7 +47,7 @@
     </div>
 
     <!-- 重置按钮 -->
-    <el-card class="reset-card" shadow="hover">
+    <!-- <el-card class="reset-card" shadow="hover">
       <div class="reset-content">
         <div class="reset-info">
           <h3 class="reset-title">重置到刚注册状态</h3>
@@ -59,7 +59,7 @@
           重置到刚注册状态
         </el-button>
       </div>
-    </el-card>
+    </el-card> -->
   </div>
 </template>
 
@@ -193,46 +193,46 @@ const handleAction = async (key: string) => {
 };
 
 // 重置到刚注册状态
-const resetLoading = ref(false);
-const handleResetToInitialStatus = async () => {
-  try {
-    // 二次确认
-    await ElMessageBox.confirm(
-      "此操作将删除所有入住申请数据、订单、优惠券、验券、消息等相关数据,恢复到刚注册时的初始状态。此操作不可恢复,是否继续?",
-      "确认重置",
-      {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        dangerouslyUseHTMLString: false
-      }
-    );
+// const resetLoading = ref(false);
+// const handleResetToInitialStatus = async () => {
+//   try {
+//     // 二次确认
+//     await ElMessageBox.confirm(
+//       "此操作将删除所有入住申请数据、订单、优惠券、验券、消息等相关数据,恢复到刚注册时的初始状态。此操作不可恢复,是否继续?",
+//       "确认重置",
+//       {
+//         confirmButtonText: "确定",
+//         cancelButtonText: "取消",
+//         type: "warning",
+//         dangerouslyUseHTMLString: false
+//       }
+//     );
 
-    resetLoading.value = true;
-    const res: any = await resetToInitialStatus();
+//     resetLoading.value = true;
+//     const res: any = await resetToInitialStatus();
 
-    if (res.code === 200 && res.success) {
-      ElMessage.success(res.msg || "重置成功,已退回到刚注册状态");
-      // 刷新页面数据或跳转到注册成功页面
-      setTimeout(() => {
-        // 可以跳转到注册成功页面或刷新当前页面
-        // router.push({ path: '/register-success' });
-        window.location.reload();
-      }, 1500);
-    } else {
-      ElMessage.error(res.msg || "重置失败,请稍后重试");
-    }
-  } catch (error: any) {
-    // 用户取消操作
-    if (error === "cancel") {
-      return;
-    }
-    console.error("重置失败:", error);
-    ElMessage.error(error?.response?.data?.msg || error?.message || "重置失败,请稍后重试");
-  } finally {
-    resetLoading.value = false;
-  }
-};
+//     if (res.code === 200 && res.success) {
+//       ElMessage.success(res.msg || "重置成功,已退回到刚注册状态");
+//       // 刷新页面数据或跳转到注册成功页面
+//       setTimeout(() => {
+//         // 可以跳转到注册成功页面或刷新当前页面
+//         // router.push({ path: '/register-success' });
+//         window.location.reload();
+//       }, 1500);
+//     } else {
+//       ElMessage.error(res.msg || "重置失败,请稍后重试");
+//     }
+//   } catch (error: any) {
+//     // 用户取消操作
+//     if (error === "cancel") {
+//       return;
+//     }
+//     console.error("重置失败:", error);
+//     ElMessage.error(error?.response?.data?.msg || error?.message || "重置失败,请稍后重试");
+//   } finally {
+//     resetLoading.value = false;
+//   }
+// };
 </script>
 
 <style scoped lang="scss">

+ 7 - 7
src/views/financialManagement/realName.vue

@@ -132,7 +132,7 @@
             class="form-wrapper"
             v-if="currentStep == 1"
           >
-            <el-form-item label="验证原密码" prop="password">
+            <el-form-item label="验证原密码">
               <el-input
                 v-model="oldPasswordForm.password"
                 type="password"
@@ -155,7 +155,7 @@
             class="form-wrapper"
             v-if="currentStep == 2"
           >
-            <el-form-item label="设置提现密码" prop="password">
+            <el-form-item label="设置提现密码">
               <el-input
                 v-model="oldTwoPasswordForm.password"
                 type="password"
@@ -166,7 +166,7 @@
                 class="password-input"
               />
             </el-form-item>
-            <el-form-item label="请确认密码" prop="confirmPassword">
+            <el-form-item label="请确认密码">
               <el-input
                 v-model="oldTwoPasswordForm.confirmPassword"
                 type="password"
@@ -253,7 +253,7 @@
           </div>
         </el-form-item>
 
-        <el-form-item label="输入新密码" prop="newPassword">
+        <el-form-item label="输入新密码">
           <el-input
             v-model="forgotPasswordForm.newPassword"
             type="password"
@@ -262,7 +262,7 @@
             clearable
           />
         </el-form-item>
-        <el-form-item label="确认密码" prop="confireNewPassword">
+        <el-form-item label="确认密码">
           <el-input
             v-model="forgotPasswordForm.confireNewPassword"
             type="password"
@@ -274,8 +274,8 @@
       </el-form>
       <template #footer>
         <span class="dialog-footer">
-          <el-button @click="handleCancelZFB">取消</el-button>
-          <el-button type="primary" :loading="loading" @click="handleForgetConfirmZFB">确认111</el-button>
+          <el-button @click="forgotPasswordVisible = false">取消</el-button>
+          <el-button type="primary" :loading="loading" @click="handleForgetConfirmZFB">确认</el-button>
         </span>
       </template>
     </el-dialog>

+ 3 - 2
src/views/financialManagement/reconciled.vue

@@ -27,12 +27,13 @@
         <el-row class="couponRow">
           <el-col :span="12"> 实际收益: +{{ ((reconciled.money || 0) / 100).toFixed(2) }} </el-col>
           <el-col :span="12">
-            {{ `技术服务费(${reconciled.commission / 100 || 3}%)` }}:
+            <!-- {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}: 后续后端会变成可控的-->
+            {{ `技术服务费(3%):` }}
             {{ reconciled.commission != null ? (reconciled.commission / 100).toFixed(2) : "--" }}
           </el-col>
         </el-row>
         <el-row class="couponRow">
-          <el-col :span="12"> 售价: {{ reconciled.price != null ? reconciled.price : "--" }} </el-col>
+          <el-col :span="12"> 售价: {{ reconciled.orderPrice != null ? reconciled.orderPrice : "--" }} </el-col>
         </el-row>
         <h3 class="orderInfo">订单信息</h3>
         <div>

+ 10 - 5
src/views/financialManagement/todayIncomeList.vue

@@ -27,12 +27,14 @@
         <el-row class="couponRow">
           <el-col :span="12"> 实际收益: {{ ((unposted.money || 0) / 100).toFixed(2) }} </el-col>
           <el-col :span="12">
-            {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}:
+            {{ `技术服务费(${commissionRate || 3}%)` }}:
             {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
           </el-col>
         </el-row>
         <el-row class="couponRow">
-          <el-col :span="12"> 售价: {{ unposted.price != null ? unposted.price : "--" }} </el-col>
+          <el-col :span="12">
+            售价: {{ ((Number(unposted.money) + Number(unposted.commission)) / 100).toFixed(2) || "0.00" }}
+          </el-col>
         </el-row>
         <h3 class="orderInfo">订单信息</h3>
         <div>
@@ -86,7 +88,10 @@ const columns = reactive<ColumnProps<any>[]>([
   },
   {
     prop: "price",
-    label: "售价"
+    label: "售价",
+    render: scope => {
+      return ((Number(scope.row.money) + Number(scope.row.commission)) / 100).toFixed(2) || "0.00";
+    }
   },
   {
     prop: "commission",
@@ -117,8 +122,9 @@ onActivated(() => {
 
 // dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
 // 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
+const commissionRate = ref("");
 const dataCallback = (data: any) => {
-  console.log(data);
+  commissionRate.value = data.commissionRate;
   return {
     list: data.incomeDetailsRecordVoList,
     total: data.data?.total || data.total || 0
@@ -128,7 +134,6 @@ const dataCallback = (data: any) => {
 // 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
 // 默认不做操作就直接在 ProTable 组件上绑定	:requestApi="getUserList"
 const getTableList = (params: any) => {
-  console.log(params);
   // 获取当前日期,格式为 YYYY-MM-DD
   const today = new Date();
   const year = today.getFullYear();

+ 2 - 1
src/views/financialManagement/unposted.vue

@@ -30,7 +30,8 @@
             实际收益: {{ unposted.incomeMoney || ((unposted?.money || 0) / 100).toFixed(2) || "0.00" }}
           </el-col>
           <el-col :span="12">
-            {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}:
+            <!-- {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}: 后续后端会变成可控的-->
+            {{ `技术服务费(3%):` }}
             {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
           </el-col>
         </el-row>

+ 24 - 13
src/views/home/components/go-examine.vue

@@ -52,7 +52,7 @@ import homeIcon from "../../../assets/images/home-icon.png";
 import homeWallet from "../../../assets/images/home-wallet.png";
 import homeOrder from "../../../assets/images/home-order.png";
 import homeIncome from "../../../assets/images/home-income.png";
-import { verifyOrder, verifyCoupon, getTodayOrderCount, getTodayIncome, getMerchantByPhone } from "@/api/modules/homeEntry";
+import { verifyOrder, verifyCoupon, getTodayOrderCount, getTodayIncome, getAccountBalance } from "@/api/modules/homeEntry";
 import { localGet, localSet } from "@/utils/index";
 const userInfo = localGet("geeker-user").userInfo;
 // 数据(可根据实际接口替换)
@@ -68,22 +68,33 @@ onMounted(() => {
   getInCome();
   getMyMoney();
 });
+
+//可提现金额
 const getMyMoney = async () => {
-  const res: any = await getMerchantByPhone({ phone: userInfo.phone });
+  let param = {
+    storeId: userInfo.storeId
+  };
+  const res: any = await getAccountBalance(param as any);
   if (res.code == 200) {
-    walletAmount.value = res.data.moneyStr;
-    // 更新缓存里的moneyStr
-    try {
-      const geekerUser = localGet("geeker-user");
-      if (geekerUser && geekerUser.userInfo) {
-        geekerUser.userInfo.moneyStr = res.data.moneyStr;
-        localSet("geeker-user", geekerUser);
-      }
-    } catch (error) {
-      console.error("更新缓存失败:", error);
-    }
+    walletAmount.value = res.data.cashOutMoney; //cashOutMoney  可提现金额减未审核通过的金额
   }
 };
+// const getMyMoney = async () => {
+//   const res: any = await getMerchantByPhone({ phone: userInfo.phone });
+//   if (res.code == 200) {
+//     // walletAmount.value = res.data.moneyStr;
+//     // 更新缓存里的moneyStr
+//     try {
+//       const geekerUser = localGet("geeker-user");
+//       if (geekerUser && geekerUser.userInfo) {
+//         geekerUser.userInfo.moneyStr = res.data.moneyStr;
+//         localSet("geeker-user", geekerUser);
+//       }
+//     } catch (error) {
+//       console.error("更新缓存失败:", error);
+//     }
+//   }
+// };
 const getOrder = async () => {
   const res: any = await getTodayOrderCount({ storeId: localGet("geeker-user").storeId });
   if (res.code == 200) {

+ 204 - 7
src/views/home/components/go-flow.vue

@@ -137,6 +137,7 @@
                   :limit="1"
                   :on-exceed="handleExceed"
                   :on-success="handleUploadSuccess"
+                  :on-preview="handlePictureCardPreview"
                 >
                   <el-icon><Plus /></el-icon>
                   <template #tip>
@@ -153,6 +154,7 @@
                   :limit="20"
                   :on-exceed="handleExceed"
                   :on-success="handleUploadSuccess"
+                  :on-preview="handlePictureCardPreview"
                 >
                   <el-icon><Plus /></el-icon>
                   <template #tip>
@@ -169,6 +171,7 @@
                   :limit="1"
                   :on-exceed="handleExceed"
                   :on-success="handleUploadSuccess"
+                  :on-preview="handlePictureCardPreview"
                 >
                   <el-icon><Plus /></el-icon>
                   <template #tip>
@@ -196,6 +199,14 @@
       </div>
     </div>
   </div>
+
+  <!-- 图片预览 -->
+  <el-image-viewer
+    v-if="imageViewerVisible"
+    :url-list="imageViewerUrlList"
+    :initial-index="imageViewerInitialIndex"
+    @close="imageViewerVisible = false"
+  />
 </template>
 <script setup lang="ts">
 import { ref, reactive, watch, onMounted } from "vue";
@@ -213,13 +224,16 @@ import { Plus } from "@element-plus/icons-vue";
 import { verifyIdInfo, applyStore, getMerchantByPhone } from "@/api/modules/homeEntry";
 import { getBusinessSection, getBusinessSectionTypes, getInputPrompt, getDistrict, uploadImg } from "@/api/modules/newLoginApi";
 import { localGet, localSet } from "@/utils/index";
+import { useAuthStore } from "@/stores/modules/auth";
+
+const authStore = useAuthStore();
 const userInfo = localGet("geeker-user")?.userInfo || {};
 const latShow = ref(false);
-onMounted(() => {
-  getBusinessSectionList();
-  getBusinessTypes(null);
-  callGetUserInfo();
-});
+
+// 图片预览相关
+const imageViewerVisible = ref(false);
+const imageViewerUrlList = ref<string[]>([]);
+const imageViewerInitialIndex = ref(0);
 const entryList = ref([
   {
     title: "个人实名"
@@ -237,6 +251,7 @@ const entryList = ref([
 
 const step2Rules: FormRules = {
   storeName: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
+  storeCapacity: [{ required: true, message: "请输入容纳人数", trigger: "blur" }],
   storeArea: [{ required: true, message: "请选择门店面积", trigger: "change" }],
   storeBlurb: [{ required: true, message: "请输入门店简介", trigger: "change" }],
   storeIntro: [{ required: true, message: "请输入门店简介", trigger: "blur" }],
@@ -286,6 +301,117 @@ watch(
     if (typeof val === "number") storeApplicationStatus.value = val;
   }
 );
+
+// 隐藏财务管理菜单的函数
+const hideFinancialManagementMenu = () => {
+  const hideMenus = (menuList: any[]) => {
+    menuList.forEach(menu => {
+      // 根据菜单名称判断是否需要隐藏财务管理
+      if (menu.name && menu.name === "financialManagement") {
+        menu.meta.isHide = true;
+      }
+      // 递归处理子菜单
+      if (menu.children && menu.children.length > 0) {
+        hideMenus(menu.children);
+      }
+    });
+  };
+  if (authStore.authMenuList && authStore.authMenuList.length > 0) {
+    hideMenus(authStore.authMenuList);
+  }
+};
+
+// 显示财务管理菜单的函数
+const showFinancialManagementMenu = () => {
+  const showMenus = (menuList: any[]) => {
+    menuList.forEach(menu => {
+      // 根据菜单名称判断是否需要显示财务管理
+      if (menu.name && menu.name === "financialManagement") {
+        menu.meta.isHide = false;
+      }
+      // 递归处理子菜单
+      if (menu.children && menu.children.length > 0) {
+        showMenus(menu.children);
+      }
+    });
+  };
+  if (authStore.authMenuList && authStore.authMenuList.length > 0) {
+    showMenus(authStore.authMenuList);
+  }
+};
+
+// 更新缓存中的 storeId
+const updateStoreIdInCache = async () => {
+  try {
+    const geekerUser = localGet("geeker-user");
+    if (!geekerUser || !geekerUser.userInfo || !geekerUser.userInfo.phone) {
+      console.error("用户信息不存在");
+      return;
+    }
+    const phone = geekerUser.userInfo.phone;
+    const res: any = await getMerchantByPhone({ phone });
+    if (res && res.code == 200 && res.data && res.data.storeId) {
+      // 更新缓存中的 storeId
+      geekerUser.userInfo.storeId = res.data.storeId;
+      localSet("geeker-user", geekerUser);
+      // 同时更新 createdId 缓存
+      if (res.data.storeId) {
+        localSet("createdId", res.data.storeId);
+      }
+    }
+  } catch (error) {
+    console.error("更新 storeId 缓存失败:", error);
+  }
+};
+
+// 监听步骤和审核状态,如果是待审核或审核拒绝,则更新 storeId
+watch([() => currentStep.value, () => storeApplicationStatus.value], ([step, status]) => {
+  if (step === 3 && (status === 0 || status === 2)) {
+    updateStoreIdInCache();
+  }
+  // 如果是审核拒绝状态,隐藏财务管理菜单
+  if (status === 2) {
+    hideFinancialManagementMenu();
+  }
+  // 如果是审核通过状态,显示财务管理菜单
+  if (status === 1) {
+    showFinancialManagementMenu();
+  }
+});
+
+// 监听菜单列表变化,根据审核状态显示或隐藏财务管理菜单
+watch(
+  () => authStore.authMenuList.length,
+  newLength => {
+    if (newLength > 0) {
+      // 如果审核状态是拒绝,隐藏财务管理菜单
+      if (storeApplicationStatus.value === 2) {
+        hideFinancialManagementMenu();
+      }
+      // 如果审核状态是通过,显示财务管理菜单
+      if (storeApplicationStatus.value === 1) {
+        showFinancialManagementMenu();
+      }
+    }
+  }
+);
+
+onMounted(() => {
+  getBusinessSectionList();
+  getBusinessTypes(null);
+  callGetUserInfo();
+  // 如果当前已经是待审核或审核拒绝状态,则更新 storeId
+  if (currentStep.value === 3 && (storeApplicationStatus.value === 0 || storeApplicationStatus.value === 2)) {
+    updateStoreIdInCache();
+  }
+  // 根据审核状态显示或隐藏财务管理菜单
+  if (storeApplicationStatus.value === 2) {
+    hideFinancialManagementMenu();
+  } else if (storeApplicationStatus.value === 1) {
+    showFinancialManagementMenu();
+  }
+});
+
 const changeRefuse = () => {
   currentStep.value = 2;
 };
@@ -451,14 +577,44 @@ const getLonAndLat = async (keyword: string) => {
   }
 };
 const selectAddress = async (param: any) => {
+  // 安全检查:确保 address 存在且是字符串类型
+  if (!step2Form.address || typeof step2Form.address !== "string") {
+    ElMessage.warning("地址格式不正确,请重新选择");
+    return;
+  }
+
+  // 检查是否包含逗号(经纬度格式应该是 "经度,纬度")
+  if (!step2Form.address.includes(",")) {
+    ElMessage.warning("地址格式不正确,缺少经纬度信息");
+    return;
+  }
+
+  // 安全地分割地址字符串
   let locationList = step2Form.address.split(",");
+
+  // 检查分割后的数组长度
+  if (locationList.length < 2) {
+    ElMessage.warning("地址格式不正确,无法获取经纬度");
+    return;
+  }
+
+  // 查找对应的地址名称
   addressList.value.forEach((item: any) => {
     if (item.location == step2Form.address) {
       queryAddress.value = item.name;
     }
   });
-  step2Form.storePositionLongitude = locationList[0];
-  step2Form.storePositionLatitude = locationList[1];
+
+  // 设置经纬度,并去除可能的空格
+  step2Form.storePositionLongitude = locationList[0]?.trim() || "";
+  step2Form.storePositionLatitude = locationList[1]?.trim() || "";
+
+  // 验证经纬度是否为有效数字
+  if (!step2Form.storePositionLongitude || !step2Form.storePositionLatitude) {
+    ElMessage.warning("无法获取有效的经纬度信息");
+    return;
+  }
+
   latShow.value = true;
 };
 //文件上传
@@ -488,6 +644,47 @@ const handleUploadSuccess = (response: any, uploadFile: UploadUserFile) => {
     uploadFile.url = response.fileUrl;
   }
 };
+
+// 图片预览处理函数
+const handlePictureCardPreview = (file: UploadUserFile) => {
+  // 如果文件正在上传中,允许预览(使用本地预览)
+  if (file.status === "uploading" && file.url) {
+    imageViewerUrlList.value = [file.url];
+    imageViewerInitialIndex.value = 0;
+    imageViewerVisible.value = true;
+    return;
+  }
+  // 获取当前上传组件的所有图片 URL 列表(只包含已上传成功的图片)
+  let urlList: string[] = [];
+  let currentFileList: UploadUserFile[] = [];
+
+  // 根据文件对象判断是哪个上传组件的文件
+  if (step2Form.businessLicenseAddress.some((f: UploadUserFile) => f.uid === file.uid)) {
+    currentFileList = step2Form.businessLicenseAddress;
+  } else if (step2Form.contractImageList.some((f: UploadUserFile) => f.uid === file.uid)) {
+    currentFileList = step2Form.contractImageList;
+  } else if (step2Form.foodLicenceImgList.some((f: UploadUserFile) => f.uid === file.uid)) {
+    currentFileList = step2Form.foodLicenceImgList;
+  }
+
+  // 获取所有已上传成功的图片 URL
+  urlList = currentFileList
+    .filter((item: UploadUserFile) => item.status === "success" && (item.url || (item.response as any)?.fileUrl))
+    .map((item: UploadUserFile) => item.url || (item.response as any)?.fileUrl);
+
+  // 找到当前点击的图片索引
+  const currentUrl = file.url || (file.response as any)?.fileUrl;
+  const currentIndex = urlList.findIndex((url: string) => url === currentUrl);
+
+  if (currentIndex < 0) {
+    ElMessage.warning("图片尚未上传完成,无法预览");
+    return;
+  }
+
+  imageViewerUrlList.value = urlList;
+  imageViewerInitialIndex.value = currentIndex;
+  imageViewerVisible.value = true;
+};
 // 下一步
 const handleNextStep = async () => {
   if (!step1FormRef.value) return;

+ 71 - 1
src/views/home/index.vue

@@ -16,13 +16,16 @@
 </template>
 
 <script setup lang="ts">
-import { onMounted, ref } from "vue";
+import { onMounted, ref, watch } from "vue";
 import { localGet } from "@/utils/index";
 import goEnter from "./components/go-enter.vue";
 import goFlow from "./components/go-flow.vue";
 import goExamine from "./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);
 
@@ -38,6 +41,52 @@ const handleUpdateCurrentStep = (step: number) => {
   currentStep.value = step;
 };
 let storeApplicationStatus = ref<number | undefined>(undefined);
+
+// 隐藏财务管理菜单的函数
+const hideFinancialManagementMenu = () => {
+  const hideMenus = (menuList: any[]) => {
+    menuList.forEach(menu => {
+      if (menu.name && menu.name === "financialManagement") {
+        menu.meta.isHide = true;
+      }
+      if (menu.children && menu.children.length > 0) {
+        hideMenus(menu.children);
+      }
+    });
+  };
+  if (authStore.authMenuList && authStore.authMenuList.length > 0) {
+    hideMenus(authStore.authMenuList);
+  }
+};
+
+// 显示财务管理菜单的函数
+const showFinancialManagementMenu = () => {
+  const showMenus = (menuList: any[]) => {
+    menuList.forEach(menu => {
+      if (menu.name && menu.name === "financialManagement") {
+        menu.meta.isHide = false;
+      }
+      if (menu.children && menu.children.length > 0) {
+        showMenus(menu.children);
+      }
+    });
+  };
+  if (authStore.authMenuList && authStore.authMenuList.length > 0) {
+    showMenus(authStore.authMenuList);
+  }
+};
+
+// 根据审核状态控制菜单显示/隐藏
+const updateMenuVisibility = (status: number | undefined) => {
+  if (status === 1) {
+    // 审核通过,显示财务管理菜单
+    showFinancialManagementMenu();
+  } else if (status === 2) {
+    // 审核拒绝,隐藏财务管理菜单
+    hideFinancialManagementMenu();
+  }
+};
+
 const getUserInfo = async () => {
   try {
     const geekerUser = localGet("geeker-user");
@@ -75,6 +124,9 @@ const getUserInfo = async () => {
           } else {
             isExaime.value = true;
           }
+
+          // 获取到审核状态后,立即更新菜单显示/隐藏
+          updateMenuVisibility(storeApplicationStatus.value);
         }
       }
     }
@@ -82,6 +134,24 @@ const getUserInfo = async () => {
     console.error(error);
   }
 };
+
+// 监听审核状态变化,更新菜单显示/隐藏
+watch(
+  () => storeApplicationStatus.value,
+  status => {
+    updateMenuVisibility(status);
+  }
+);
+
+// 监听菜单列表变化,根据审核状态显示或隐藏财务管理菜单
+watch(
+  () => authStore.authMenuList.length,
+  newLength => {
+    if (newLength > 0 && storeApplicationStatus.value !== undefined) {
+      updateMenuVisibility(storeApplicationStatus.value);
+    }
+  }
+);
 </script>
 
 <style scoped lang="scss"></style>