zhuli 3 долоо хоног өмнө
parent
commit
b0920e3315

+ 4 - 4
src/layouts/components/Header/components/PasswordDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 修改密码对话框 -->
-  <el-dialog v-model="dialogVisible" title="修改密码" width="500px" draggable :close-on-click-modal="false">
+  <el-dialog v-model="dialogVisible" title="修改密码1" width="500px" draggable :close-on-click-modal="false">
     <el-form ref="passwordFormRef" :model="passwordForm" :rules="passwordRules" label-width="100px" label-position="left">
       <el-form-item label="输入原密码" prop="oldPassword">
         <el-input v-model="passwordForm.oldPassword" type="password" placeholder="请输入原密码" show-password clearable />
@@ -170,7 +170,7 @@ const handleConfirm = async () => {
       const res: any = await forgetPassword({
         type: 1,
         phone: userPhone.value,
-        verificationCode: "",
+        // verificationCode: "",
         oldPassword: passwordForm.oldPassword,
         newPassword: passwordForm.newPassword,
         confirmNewPassword: passwordForm.newPassword
@@ -210,7 +210,7 @@ const handleForgotPassword = () => {
 // ----------------------忘记密码-------------------------
 // 发送短信验证码
 const sendLoginCode = async () => {
-  let phoneCode: any = await getPhoneCode({ phone: userPhone.value, appType: "2", businessType: "0" });
+  let phoneCode: any = await getPhoneCode({ phone: userPhone.value, appType: "2", businessType: 6 });
   if (phoneCode.code === 200) {
     ElMessage.success("验证码已发送");
     // 开始倒计时
@@ -254,7 +254,7 @@ const handleForgotPasswordConfirm = async () => {
       const res: any = await forgetPassword({
         phone: userPhone.value,
         verificationCode: forgotPasswordForm.verificationCode,
-        type: "0",
+        type: 0,
         newPassword: forgotPasswordForm.newPassword
       });
 

+ 13 - 27
src/views/financialManagement/cashApply.vue

@@ -29,14 +29,14 @@
           />
           <el-button type="primary" class="withdraw-all-btn" @click="handleWithdrawAll"> 全部提现 </el-button>
         </div>
-        <div class="min-amount-tip">最低提现金额为0.01元</div>
+        <div class="min-amount-tip">最低提现金额为0.1元</div>
       </div>
 
       <!-- 提现账户 -->
       <div class="section">
         <div class="section-title">提现账户</div>
         <div class="account-list">
-          <div class="account-item" @click="selectAccount">
+          <div class="account-item">
             <div class="account-left">
               <img :src="zfbIcon" alt="" class="account-icon" />
               <div class="account-info">
@@ -56,7 +56,7 @@
       </div>
       <!-- 底部按钮 -->
       <div class="footer">
-        <el-button type="primary" class="submit-btn" @click="handleSubmit"> 提交申请11 </el-button>
+        <el-button type="primary" class="submit-btn" @click="handleSubmit"> 提交申请 </el-button>
       </div>
     </div>
     <!-- 确认对话框 -->
@@ -92,9 +92,7 @@
       <template #footer>
         <div class="dialog-footer">
           <el-button class="dialog-cancel-btn" @click="handleCancelConfirm"> 取消 </el-button>
-          <el-button type="primary" class="dialog-confirm-btn" @click="handleConfirmSubmit" :loading="submitLoading">
-            确认
-          </el-button>
+          <el-button type="primary" class="dialog-confirm-btn" @click="handleConfirmSubmit"> 确认 </el-button>
         </div>
       </template>
     </el-dialog>
@@ -114,7 +112,7 @@ const router = useRouter();
 const cashDialogVisible = ref(false);
 const withdrawPassword = ref("");
 // 提现金额
-const withdrawAmount = ref<string>("");
+const withdrawAmount = ref();
 // 密码输入处理(只允许数字)
 const handlePasswordInput = (value: string) => {
   withdrawPassword.value = value.replace(/\D/g, "");
@@ -128,11 +126,12 @@ const handleConfirmSubmit = async () => {
   const res: any = await cashOut({
     storeId: userInfo.storeId,
     payPassword: withdrawPassword.value,
-    withdrawalMoney: Number(withdrawAmount.value) * 100
+    withdrawalMoney: withdrawAmount.value * 100
   });
   if (res.code == 200) {
     ElMessage.success("提现申请已发起成功,请耐心等待");
     cashDialogVisible.value = false;
+    fetchAccountBalance();
   } else {
     ElMessage.error(res.message);
   }
@@ -140,9 +139,6 @@ const handleConfirmSubmit = async () => {
 // 可提现金额
 const availableAmount = ref<number>(0);
 
-// 账户列表
-const accountList = ref({});
-
 // 选中的账户ID
 const selectedAccountId = ref<number>(1);
 
@@ -209,12 +205,10 @@ const handleSubmit = () => {
 
 // 获取可提现金额
 const fetchAccountBalance = async () => {
-  console.log();
   let param = {
     storeId: userInfo.storeId
   };
   const res: any = await getAccountBalance(param as any);
-  console.log(res);
   if (res.code == 200 && res.data) {
     availableAmount.value = res.data.cashOutMoney;
     // 根据实际API返回的数据结构更新
@@ -301,7 +295,7 @@ onMounted(() => {
   .withdraw-all-btn {
     padding: 12px 20px;
     white-space: nowrap;
-    background-color: #409eff;
+    background-color: #7f9dff;
     border: none;
     border-radius: 4px;
   }
@@ -328,11 +322,11 @@ onMounted(() => {
   border-radius: 8px;
   transition: all 0.3s;
   &:hover {
-    border-color: #409eff;
+    border-color: #7f9dff;
   }
   &.active {
     background-color: #ecf5ff;
-    border-color: #409eff;
+    border-color: #7f9dff;
   }
   .account-left {
     display: flex;
@@ -368,10 +362,10 @@ onMounted(() => {
     .selected-indicator {
       width: 16px;
       height: 16px;
-      background-color: #409eff;
+      background-color: #7f9dff;
       border: 3px solid #ffffff;
       border-radius: 50%;
-      box-shadow: 0 0 0 2px #409eff;
+      box-shadow: 0 0 0 2px #7f9dff;
     }
   }
 }
@@ -386,22 +380,14 @@ onMounted(() => {
     background-color: #f5f7fa;
     border: 1px solid #dcdfe6;
     border-radius: 4px;
-    &:hover {
-      color: #409eff;
-      background-color: #ecf5ff;
-      border-color: #b3d8ff;
-    }
   }
   .submit-btn {
     padding: 20px;
     font-size: 16px;
     color: #ffffff;
-    background-color: #409eff;
+    background-color: #7f9dff;
     border: none;
     border-radius: 4px;
-    &:hover {
-      background-color: #66b1ff;
-    }
   }
 }
 :deep(.confirm-dialog) {

+ 27 - 25
src/views/financialManagement/index.vue

@@ -31,7 +31,7 @@
         <div class="stat-header">
           <span class="stat-title">{{ stat.title }}</span>
           <el-tooltip :content="stat.tooltip" placement="top" v-if="stat.tooltip">
-            <el-icon class="question-icon">
+            <el-icon class="question-icon" style="color: #7f9dff">
               <QuestionFilled />
             </el-icon>
           </el-tooltip>
@@ -39,6 +39,7 @@
         <div class="stat-amount">
           {{ stat.amount }}
         </div>
+        <!----:disabled="stat.key === 'withdraw' && isWithdrawDisabled(stat.amount)"-->
         <el-button type="primary" class="stat-btn" @click="handleAction(stat.key)">
           {{ stat.buttonText }}
         </el-button>
@@ -95,25 +96,27 @@ const stats = reactive([
     buttonText: "提现",
     tooltip: "收益产生后3天可提现,28天自动付收益产生日期+3个自然日可提现,若未提现,则按收益产生日期+28个自然日自动付"
   },
-  { key: "settled", title: "已到账期金额", amount: "", buttonText: "查看明细", tooltip: "已到达可提现时间的金额总额" },
+  { key: "settled", title: "已到账期金额", amount: "", buttonText: "查看", tooltip: "已到达可提现时间的金额总额" },
   {
     key: "pending",
     title: "未到账期金额",
     amount: "",
-    buttonText: "查看明细",
+    buttonText: "查看",
     tooltip: "未到达可提现时间的账单,您需要等待账单到达结算周期后发起提现"
   }
 ]);
 const handleTodayIncomeList = async () => {
   router.push({ path: "/financialManagement/todayIncomeList" });
 };
-//已到账/未到账金额
+
+console.log(stats[0].amount);
+//已到账/未到账金额   paymentType 未到传0    已到传1
 const fetchGetPaymentCycle0 = async () => {
   let param = {
     storeId: userInfo.storeId,
     startTime: null,
     endTime: null,
-    paymentType: 0,
+    paymentType: 0, //未到
     incomeType: 0,
     pageNum: 1,
     pageSize: 999999
@@ -121,7 +124,7 @@ const fetchGetPaymentCycle0 = async () => {
   const res: any = await getPaymentCycle(param as any);
   if (res.code == 200) {
     nextTick(() => {
-      stats[1].amount = res.data.money;
+      stats[2].amount = res.data.money;
     });
   }
 };
@@ -138,7 +141,7 @@ const fetchGetPaymentCycle1 = async () => {
   const res: any = await getPaymentCycle(param as any);
   if (res.code == 200) {
     nextTick(() => {
-      stats[2].amount = res.data.money;
+      stats[1].amount = res.data.money;
     });
   }
 };
@@ -150,7 +153,7 @@ const fetchAccountBalance = async () => {
   const res: any = await getAccountBalance(param as any);
   if (res.code == 200) {
     nextTick(() => {
-      stats[0].amount = res.data.balance;
+      stats[0].amount = res.data.cashOutMoney; //cashOutMoney  可提现金额减未审核通过的金额
     });
   }
 };
@@ -166,26 +169,19 @@ const fetchGetTodayIncome = async () => {
   }
 };
 
+// 判断提现按钮是否禁用
+// const isWithdrawDisabled = (amount: any): boolean => {
+//   if (!amount && amount !== 0) return true; // 金额为空或undefined
+//   const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
+//   return numAmount === 0 || isNaN(numAmount);
+// };
+
 const handleAction = async (key: string) => {
   if (key == "withdraw") {
-    if (userInfo.idCard == null) {
-      router.push({ path: "/financialManagement/realName" });
+    if (userInfo.alipayAccount != null && userInfo.payPassword != null) {
+      router.push({ path: "/financialManagement/cashApply" });
     } else {
-      let param = {
-        storeUserId: userInfo.id
-      };
-      const res: any = await checkPayPassword(param as any);
-      if (res.code == 200) {
-        ElMessage.error(res.data.message);
-        router.push({ path: "/financialManagement/realName" });
-        return;
-        if (res.data.data == "false") {
-          ElMessage.error(res.data.message);
-          router.push({ path: "/financialManagement/realName" });
-        } else {
-          router.push({ path: "/financialManagement/withdrawaRequest" });
-        }
-      }
+      router.push({ path: "/financialManagement/realName" });
     }
   }
   if (key == "settled") {
@@ -340,6 +336,12 @@ const handleResetToInitialStatus = async () => {
       background: #7f9dff;
       border: none;
       border-radius: 6px;
+      &:disabled {
+        color: #ffffff;
+        cursor: not-allowed;
+        background: #c0c4cc;
+        border-color: #c0c4cc;
+      }
     }
   }
 }

+ 249 - 36
src/views/financialManagement/realName.vue

@@ -189,32 +189,30 @@
     <!--收款账户-->
     <div class="content-section" v-if="activeTab === 'receivingAccount'">
       <div class="content-wrapper">
-        <el-button type="primary" class="auth-button" @click="handleGoZFB" v-if="!userInfo.alipayAccount">
-          添加支付宝账号
-        </el-button>
-        <div class="zfb-wrapper" v-if="userInfo.alipayAccount">
+        <el-button type="primary" class="auth-button" @click="handleGoZFB" v-if="!alipayAccount"> 添加支付宝账号 </el-button>
+        <div class="zfb-wrapper" v-if="alipayAccount">
           <div style="width: 100%">
             <div style="display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 10px">
               <div class="zfb-left">
                 <el-image :src="zfbIcon" class="zfbIcon" />
                 <div>
                   <div>支付宝</div>
-                  <div>{{ userInfo.alipayAccount }}</div>
+                  <div>{{ alipayAccount }}</div>
                 </div>
               </div>
               <div class="operate">
-                <div @click="getEditZfb">编辑</div>
-                <div @click="getDelZfb">删除</div>
+                <div @click="getEditZfb" style="cursor: pointer">编辑</div>
+                <div @click="getDelZfb" style="cursor: pointer">删除</div>
               </div>
             </div>
-            <el-button
+            <!-- <el-button
               type="primary"
               @click="goToCashApply"
               class="submit-button"
               style=" position: relative; left: -10%; width: 20%;margin-top: 90px; margin-left: 50%"
             >
               去提现
-            </el-button>
+            </el-button> -->
           </div>
         </div>
       </div>
@@ -264,7 +262,7 @@
             clearable
           />
         </el-form-item>
-        <el-form-item label="确认密码" prop="newPassword">
+        <el-form-item label="确认密码" prop="confireNewPassword">
           <el-input
             v-model="forgotPasswordForm.confireNewPassword"
             type="password"
@@ -277,7 +275,7 @@
       <template #footer>
         <span class="dialog-footer">
           <el-button @click="handleCancelZFB">取消</el-button>
-          <el-button type="primary" :loading="loading" @click="handleConfirmZFB">确认</el-button>
+          <el-button type="primary" :loading="loading" @click="handleForgetConfirmZFB">确认111</el-button>
         </span>
       </template>
     </el-dialog>
@@ -288,13 +286,30 @@
 import { ref, reactive, computed, onMounted } from "vue";
 import { useRouter } from "vue-router";
 import { ElMessage, type FormInstance, ElMessageBox, type FormRules } from "element-plus";
-import { verifyIdInfo, checkPayPassword, setPayPassword, getMerchantByPhone, addAlipayAccount } from "@/api/modules/homeEntry";
+import {
+  verifyIdInfo,
+  checkPayPassword,
+  setPayPassword,
+  getMerchantByPhone,
+  addAlipayAccount,
+  deleteAlipayAccount,
+  getCheckPayPasswordTwo
+} from "@/api/modules/homeEntry";
 import { localGet, localSet } from "@/utils/index";
 import homeIcon from "../../assets/images/home-icon.png";
 import zfbIcon from "../../assets/financial/zfb-icon.png";
 import { lo } from "element-plus/es/locale";
-import { getPhoneCode } from "@/api/modules/newLoginApi";
-const userInfo = ref(localGet("geeker-user")?.userInfo || {});
+import { getPhoneCode, getCheckSmsCode } from "@/api/modules/newLoginApi";
+// 初始化用户信息,统一处理支付宝账号字段名(兼容 aliPayAccount 和 alipayAccount)
+const initUserInfo = () => {
+  const cachedUserInfo = localGet("geeker-user")?.userInfo || {};
+  // 统一使用 alipayAccount 字段,兼容 aliPayAccount(驼峰命名)
+  if (cachedUserInfo.aliPayAccount && !cachedUserInfo.alipayAccount) {
+    cachedUserInfo.alipayAccount = cachedUserInfo.aliPayAccount;
+  }
+  return cachedUserInfo;
+};
+const userInfo = ref(initUserInfo());
 const router = useRouter();
 const activeTab = ref("realName");
 const dialogVisible = ref(false);
@@ -352,11 +367,27 @@ const handleConfirm = async () => {
           };
           const res1: any = await getMerchantByPhone(param);
           if (res1.code == 200) {
+            // 统一处理支付宝账号字段名
+            const updatedData = res1.data || {};
+            if (updatedData.aliPayAccount && !updatedData.alipayAccount) {
+              updatedData.alipayAccount = updatedData.aliPayAccount;
+            }
             dialogVisible.value = false;
             goAuth.value = false;
             // 重置表单
             authFormRef.value?.resetFields();
-            shimingInfo.value = res1.data;
+            shimingInfo.value = updatedData;
+            userInfo.value = { ...userInfo.value, ...updatedData };
+            // 更新本地存储
+            const geekerUser = localGet("geeker-user");
+            if (geekerUser) {
+              geekerUser.userInfo = { ...geekerUser.userInfo, ...updatedData };
+              if (updatedData.alipayAccount) {
+                geekerUser.userInfo.alipayAccount = updatedData.alipayAccount;
+                geekerUser.userInfo.aliPayAccount = updatedData.alipayAccount;
+              }
+              localSet("geeker-user", geekerUser);
+            }
             // 这里可以更新认证状态或刷新页面数据
           }
         } else {
@@ -507,7 +538,7 @@ const getForgetPassword = async () => {
 };
 // 发送短信验证码
 const sendForgotCode = async () => {
-  let phoneCode: any = await getPhoneCode({ phone: userInfo.value.phone, appType: "2", businessType: "6" });
+  let phoneCode: any = await getPhoneCode({ phone: userInfo.value.phone, appType: "2", businessType: "7" });
   if (phoneCode.code === 200) {
     ElMessage.success("验证码已发送");
     // 开始倒计时
@@ -535,10 +566,25 @@ const oldTwoPasswordForm = reactive({
 });
 
 const nextStept = async () => {
-  if (oldPasswordForm.password === userInfo.value.payPassword) {
-    currentStep.value = 2;
+  const res: any = await getCheckPayPasswordTwo({
+    password: oldPasswordForm.password,
+    storeUserId: userInfo.value.id
+  });
+  if (res.data.data == "false") {
+    ElMessage.error(res.data.message);
   } else {
-    ElMessage.error("原密码错误");
+    ElMessage.success(res.msg);
+    currentStep.value = 2;
+    // 更新本地存储中的提现密码
+    try {
+      const geekerUser = localGet("geeker-user");
+      if (geekerUser && geekerUser.userInfo) {
+        geekerUser.userInfo.payPassword = oldTwoPasswordForm.password;
+        localSet("geeker-user", geekerUser);
+      }
+    } catch (error) {
+      console.error("更新本地存储失败:", error);
+    }
   }
 };
 
@@ -556,7 +602,7 @@ const handlePasswordTwoSubmit = async () => {
         });
         if (res.code == 200) {
           ElMessage.success(res.msg || "提现密码修改成功");
-
+          activeTab.value = "receivingAccount";
           // 更新本地存储中的提现密码
           try {
             const geekerUser = localGet("geeker-user");
@@ -615,11 +661,12 @@ const handleConfirmZFB = async () => {
         const res: any = await addAlipayAccount(params);
         if (res && res.code == 200) {
           ElMessage.success(res.msg || "添加支付宝账号成功");
-          // 更新本地存储中的支付宝账号
+          // 更新本地存储中的支付宝账号(统一使用 alipayAccount 字段)
           try {
             const geekerUser = localGet("geeker-user");
             if (geekerUser && geekerUser.userInfo) {
-              geekerUser.userInfo.aliPayAccount = authForm1.zfbName;
+              geekerUser.userInfo.alipayAccount = authForm1.zfbName;
+              geekerUser.userInfo.aliPayAccount = authForm1.zfbName; // 兼容旧字段名
               localSet("geeker-user", geekerUser);
               // 更新响应式的 userInfo
               userInfo.value.alipayAccount = authForm1.zfbName;
@@ -647,25 +694,109 @@ const handleConfirmZFB = async () => {
 const getEditZfb = async () => {
   zfbTitle.value = "编辑支付宝账号";
   dialogVisibleZFB.value = true;
-  authForm1.zfbName = userInfo.value.alipayAccount || userInfo.value.phone;
+  // 兼容两种字段名:alipayAccount 和 aliPayAccount
+  authForm1.zfbName = userInfo.value.alipayAccount || userInfo.value.aliPayAccount || userInfo.value.phone;
 };
 const getDelZfb = async () => {
   ElMessageBox.confirm("确定要删除该账号,删除后无法进行提现操作", "删除账号", {
     confirmButtonText: "确定",
-    cancelButtonText: "取消"
+    cancelButtonText: "取消",
+    type: "warning"
   })
-    .then(() => {})
-    .catch(() => {});
+    .then(async () => {
+      try {
+        loading.value = true;
+        const res: any = await deleteAlipayAccount();
+        if (res && res.code == 200) {
+          ElMessage.success(res.msg || "删除成功");
+          // 立即更新响应式的 userInfo,清空支付宝账号
+          userInfo.value.alipayAccount = null;
+          userInfo.value.aliPayAccount = null;
+          // 更新本地存储中的支付宝账号
+          try {
+            const geekerUser = localGet("geeker-user");
+            if (geekerUser && geekerUser.userInfo) {
+              geekerUser.userInfo.alipayAccount = null;
+              geekerUser.userInfo.aliPayAccount = null;
+              localSet("geeker-user", geekerUser);
+            }
+          } catch (error) {
+            console.error("更新本地存储失败:", error);
+          }
+          // 重新获取用户信息
+          try {
+            const param = {
+              phone: userInfo.value.phone
+            };
+            const res1: any = await getMerchantByPhone(param);
+            if (res1.code == 200) {
+              // 统一处理支付宝账号字段名
+              const updatedData = res1.data || {};
+              // 如果后端返回的支付宝账号为空或null,确保两个字段都是null
+              if (!updatedData.alipayAccount && !updatedData.aliPayAccount) {
+                updatedData.alipayAccount = null;
+                updatedData.aliPayAccount = null;
+              } else if (updatedData.aliPayAccount && !updatedData.alipayAccount) {
+                updatedData.alipayAccount = updatedData.aliPayAccount;
+              }
+              // 更新响应式数据
+              userInfo.value = { ...userInfo.value, ...updatedData };
+              // 确保支付宝账号字段正确
+              userInfo.value.alipayAccount = updatedData.alipayAccount || null;
+              userInfo.value.aliPayAccount = updatedData.aliPayAccount || null;
+              // 更新本地存储
+              const geekerUser = localGet("geeker-user");
+              if (geekerUser) {
+                geekerUser.userInfo = { ...geekerUser.userInfo, ...updatedData };
+                // 确保两个字段名都保存(如果为null也要保存)
+                geekerUser.userInfo.alipayAccount = updatedData.alipayAccount || null;
+                geekerUser.userInfo.aliPayAccount = updatedData.aliPayAccount || null;
+                localSet("geeker-user", geekerUser);
+              }
+            }
+          } catch (error) {
+            console.error("获取用户信息失败:", error);
+          }
+        } else {
+          ElMessage.error(res.msg || "删除失败,请重试");
+        }
+      } catch (error) {
+        console.error("删除支付宝账号失败:", error);
+        ElMessage.error("删除失败,请重试");
+      } finally {
+        loading.value = false;
+      }
+    })
+    .catch(() => {
+      // 用户取消删除
+    });
 };
 
 // 跳转到提现申请页面
-const goToCashApply = () => {
-  router.push("/financialManagement/cashApply");
-};
+// const goToCashApply = () => {
+//   router.push("/financialManagement/cashApply");
+// };
 
 // 忘记密码表单验证规则
 const forgotPasswordRules: FormRules = {
-  verificationCode: [{ required: true, message: "请输入验证码", trigger: "blur" }]
+  verificationCode: [{ required: true, message: "请输入验证码", trigger: "blur" }],
+  newPassword: [
+    { required: true, message: "请输入新密码", trigger: "blur" },
+    { pattern: /^\d{6}$/, message: "提现密码必须为6位数字", trigger: "blur" }
+  ],
+  confireNewPassword: [
+    { required: true, message: "请确认密码", trigger: "blur" },
+    {
+      validator: (rule, value, callback) => {
+        if (value !== forgotPasswordForm.newPassword) {
+          callback(new Error("两次输入的密码不一致"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "blur"
+    }
+  ]
 };
 
 // 检查提现密码状态
@@ -733,6 +864,10 @@ const maskedPhone = computed(() => {
   }
   return userPhone.value.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
 });
+// 获取支付宝账号(兼容两种字段名)
+const alipayAccount = computed(() => {
+  return userInfo.value.alipayAccount || userInfo.value.aliPayAccount || null;
+});
 
 const handleTabClick = async (tab: any) => {
   // 根据不同的标签页可以跳转到不同的页面或显示不同的内容
@@ -751,6 +886,84 @@ const handleCancel = () => {
   }
 };
 
+const handleForgetConfirmZFB = async () => {
+  if (!forgotPasswordFormRef.value) return;
+
+  // 表单验证
+  await forgotPasswordFormRef.value.validate(async valid => {
+    if (valid) {
+      // 验证新密码和确认密码是否一致
+      if (forgotPasswordForm.newPassword !== forgotPasswordForm.confireNewPassword) {
+        ElMessage.error("两次输入的密码不一致");
+        return;
+      }
+
+      // 验证密码长度
+      if (forgotPasswordForm.newPassword.length !== 6) {
+        ElMessage.error("提现密码必须为6位数字");
+        return;
+      }
+
+      loading.value = true;
+      try {
+        // 第一步:验证短信验证码
+        const checkCodeRes: any = await getCheckSmsCode({
+          phone: userInfo.value.phone,
+          appType: "2",
+          businessType: "7",
+          code: forgotPasswordForm.verificationCode
+        });
+
+        if (checkCodeRes.code !== 200) {
+          ElMessage.error(checkCodeRes.msg || "验证码验证失败");
+          loading.value = false;
+          return;
+        }
+
+        // 第二步:设置提现密码
+        const res: any = await setPayPassword({
+          payPassword: forgotPasswordForm.newPassword,
+          id: userInfo.value.id
+        });
+
+        if (res.code == 200) {
+          ElMessage.success(res.msg || "提现密码设置成功");
+
+          // 更新本地存储中的提现密码
+          try {
+            const geekerUser = localGet("geeker-user");
+            if (geekerUser && geekerUser.userInfo) {
+              geekerUser.userInfo.payPassword = forgotPasswordForm.newPassword;
+              localSet("geeker-user", geekerUser);
+            }
+          } catch (error) {
+            console.error("更新本地存储失败:", error);
+          }
+
+          // 关闭对话框并重置表单
+          forgotPasswordVisible.value = false;
+          forgotPasswordFormRef.value?.resetFields();
+
+          // 重置表单数据
+          forgotPasswordForm.newPassword = "";
+          forgotPasswordForm.confireNewPassword = "";
+          forgotPasswordForm.verificationCode = "";
+
+          // 刷新密码状态
+          await checkPasswordStatus();
+        } else {
+          ElMessage.error(res.msg || "设置提现密码失败");
+        }
+      } catch (error: any) {
+        console.error("设置提现密码失败:", error);
+        ElMessage.error(error?.response?.data?.msg || error?.message || "设置提现密码失败,请稍后重试");
+      } finally {
+        loading.value = false;
+      }
+    }
+  });
+};
+
 const handleCancelZFB = () => {
   dialogVisibleZFB.value = false;
   // 重置表单
@@ -771,7 +984,7 @@ const handleCancelZFB = () => {
 // 头部区域
 .header-section {
   padding: 16px 24px;
-  background: linear-gradient(90deg, #6c8ff8 0%, rgb(255 255 255 / 0%) 100%);
+  background: linear-gradient(90deg, #7f9dff 0%, rgb(255 255 255 / 0%) 100%);
   border-bottom: 1px solid #e4e7ed;
   border-radius: 10px;
   .header-content {
@@ -817,7 +1030,7 @@ const handleCancelZFB = () => {
         border-radius: 39px;
       }
       .status-badge-success {
-        background: #6c8ff8;
+        background: #7f9dff;
       }
     }
   }
@@ -871,7 +1084,7 @@ const handleCancelZFB = () => {
   padding: 22px 35px;
   font-size: 16px;
   font-weight: 500;
-  background-color: #6c8ff8;
+  background-color: #7f9dff;
   border: none;
   border-radius: 6px;
   transition: all 0.3s;
@@ -915,7 +1128,7 @@ const handleCancelZFB = () => {
       .operate {
         display: flex;
         align-items: center;
-        color: #6c8ff8;
+        color: #7f9dff;
         div {
           margin-left: 20px;
         }
@@ -954,7 +1167,7 @@ const handleCancelZFB = () => {
     margin-top: 20px;
     font-size: 16px;
     font-weight: 500;
-    background-color: #6c8ff8;
+    background-color: #7f9dff;
     border: none;
     border-radius: 6px;
   }
@@ -966,7 +1179,7 @@ const handleCancelZFB = () => {
     }
     .forget-password {
       font-size: 14px;
-      color: #6c8ff8;
+      color: #7f9dff;
       text-align: right;
       cursor: pointer;
     }

+ 75 - 38
src/views/financialManagement/reconciled.vue

@@ -1,38 +1,47 @@
 <template>
-  <!-- 头部 -->
-  <div class="header">
-    <el-button class="back-btn" @click="goBack"> 返回 </el-button>
-    <h2 class="title">已到账期金额</h2>
-  </div>
-  <div class="table-box">
-    <ProTable ref="proTable" :columns="columns" :request-api="getTableList" :init-param="initParam" :data-callback="dataCallback">
-      <!-- 表格操作 -->
-      <template #operation="scope">
-        <el-button type="primary" link @click="toDetail(scope.row)"> 查看详情 </el-button>
-      </template>
-    </ProTable>
-    <el-dialog v-model="dialogVisible" title="详情" width="500px">
-      <h3 class="orderInfo">
-        {{ reconciled.couponName }}
-      </h3>
-      <el-row class="couponRow">
-        <el-col :span="12"> 实际收益: +{{ ((reconciled.money || 0) / 100).toFixed(2) }} </el-col>
-        <el-col :span="12">
-          {{ `技术服务费(${reconciled.commissionRate || 3}%)` }}:{{
-            reconciled.commissionStr != null ? reconciled.commissionStr : "--"
-          }}
-        </el-col>
-      </el-row>
-      <el-row class="couponRow">
-        <el-col :span="12"> 售价: {{ reconciled.price != null ? reconciled.price : "--" }} </el-col>
-      </el-row>
-      <h3 class="orderInfo">订单信息</h3>
-      <div>
-        <div class="couponRow">下单时间: {{ reconciled.orderTime != null ? reconciled.orderTime : "--" }}</div>
-        <div class="couponRow">验券时间: {{ reconciled.checkTime != null ? reconciled.checkTime : "--" }}</div>
-        <div class="couponRow">入账时间: {{ reconciled.createdTime != null ? reconciled.createdTime : "--" }}</div>
-      </div>
-    </el-dialog>
+  <div class="reconciled">
+    <!-- 头部 -->
+    <div class="header">
+      <el-button class="back-btn" @click="goBack"> 返回 </el-button>
+      <h2 class="title">已到账期金额</h2>
+    </div>
+    <div class="table-box">
+      <ProTable
+        ref="proTable"
+        :columns="columns"
+        :request-api="getTableList"
+        :init-param="initParam"
+        :data-callback="dataCallback"
+        :pagination="true"
+        :height="tableHeight"
+      >
+        <!-- 表格操作 -->
+        <template #operation="scope">
+          <el-button type="primary" link @click="toDetail(scope.row)"> 查看详情 </el-button>
+        </template>
+      </ProTable>
+      <el-dialog v-model="dialogVisible" title="详情" width="500px">
+        <h3 class="orderInfo">
+          {{ reconciled.couponName }}
+        </h3>
+        <el-row class="couponRow">
+          <el-col :span="12"> 实际收益: +{{ ((reconciled.money || 0) / 100).toFixed(2) }} </el-col>
+          <el-col :span="12">
+            {{ `技术服务费(${reconciled.commission / 100 || 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-row>
+        <h3 class="orderInfo">订单信息</h3>
+        <div>
+          <div class="couponRow">下单时间: {{ reconciled.orderTime != null ? reconciled.orderTime : "--" }}</div>
+          <div class="couponRow">验券时间: {{ reconciled.checkTime != null ? reconciled.checkTime : "--" }}</div>
+          <div class="couponRow">入账时间: {{ reconciled.createdTime != null ? reconciled.createdTime : "--" }}</div>
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -46,6 +55,8 @@ import { useRouter } from "vue-router";
 const router = useRouter();
 const dialogVisible = ref(false);
 const reconciled = ref<any>({});
+// 计算表格高度
+const tableHeight = ref<string>("calc(100vh - 200px)");
 // 返回
 const goBack = () => {
   router.back();
@@ -101,8 +112,8 @@ onActivated(() => {
 // 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
 const dataCallback = (data: any) => {
   return {
-    list: data.data.records,
-    total: data.total
+    list: data.data?.records || data.records || [],
+    total: data.data?.total || data.total || 0
   };
 };
 
@@ -134,13 +145,39 @@ const getTableList = (params: any) => {
 </script>
 
 <style lang="scss" scoped>
+.reconciled {
+  display: flex;
+  flex-direction: column;
+  height: 100%;
+  overflow: hidden;
+}
+.table-box {
+  display: flex;
+  flex: 1;
+  flex-direction: column;
+  overflow: hidden;
+  :deep(.table-main) {
+    display: flex;
+    flex: 1;
+    flex-direction: column;
+    overflow: hidden;
+    .el-table {
+      flex: 1;
+      overflow: hidden;
+    }
+    .el-table__body-wrapper {
+      overflow-y: auto !important;
+    }
+  }
+}
 .header {
   position: relative;
   display: flex;
   align-items: center;
-  padding: 20px;
+  padding: 15px;
   background: #ffffff;
-  border-bottom: 1px solid #e4e7ed;
+  border-radius: 5px;
+  box-shadow: 0 0 12px rgb(0 0 0 / 5%);
   .back-btn {
     padding: 8px 16px;
     font-size: 14px;

+ 32 - 6
src/views/financialManagement/todayIncomeList.vue

@@ -13,6 +13,7 @@
         :init-param="initParam"
         :data-callback="dataCallback"
         :pagination="true"
+        :height="tableHeight"
       >
         <!-- 表格操作 -->
         <template #operation="scope">
@@ -26,8 +27,8 @@
         <el-row class="couponRow">
           <el-col :span="12"> 实际收益: {{ ((unposted.money || 0) / 100).toFixed(2) }} </el-col>
           <el-col :span="12">
-            {{ `技术服务费(${unposted.commissionRate || 3}%)` }}:
-            {{ unposted.commissionStr != null ? unposted.commissionStr : "--" }}
+            {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}:
+            {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
           </el-col>
         </el-row>
         <el-row class="couponRow">
@@ -57,6 +58,8 @@ import { localGet } from "@/utils";
 const router = useRouter();
 const dialogVisible = ref(false);
 const unposted = ref<any>({});
+// 计算表格高度
+const tableHeight = ref<string>("calc(100vh - 200px)");
 const toDetail = (row: any) => {
   dialogVisible.value = true;
   unposted.value = row;
@@ -86,10 +89,10 @@ const columns = reactive<ColumnProps<any>[]>([
     label: "售价"
   },
   {
-    prop: "createdTime",
+    prop: "commission",
     label: "技术服务费",
     render: scope => {
-      return scope.row.commissionRate === null || !scope.row.commissionRate ? "--" : scope.row.commissionRate;
+      return (scope.row.commission / 100).toFixed(2) || "0.00";
     }
   },
   { prop: "operation", label: "操作", fixed: "right", width: 330 }
@@ -147,15 +150,38 @@ const getTableList = (params: any) => {
 
 <style lang="scss" scoped>
 .todayIncomeList {
+  display: flex;
+  flex-direction: column;
   height: 100%;
+  overflow: hidden;
+}
+.table-box {
+  display: flex;
+  flex: 1;
+  flex-direction: column;
+  overflow: hidden;
+  :deep(.table-main) {
+    display: flex;
+    flex: 1;
+    flex-direction: column;
+    overflow: hidden;
+    .el-table {
+      flex: 1;
+      overflow: hidden;
+    }
+    .el-table__body-wrapper {
+      overflow-y: auto !important;
+    }
+  }
 }
 .header {
   position: relative;
   display: flex;
   align-items: center;
-  padding: 20px;
+  padding: 15px;
   background: #ffffff;
-  border-bottom: 1px solid #e4e7ed;
+  border-radius: 5px;
+  box-shadow: 0 0 12px rgb(0 0 0 / 5%);
   .back-btn {
     padding: 8px 16px;
     font-size: 14px;

+ 82 - 41
src/views/financialManagement/unposted.vue

@@ -1,43 +1,51 @@
 <template>
-  <!-- 头部 -->
-  <div class="header">
-    <el-button class="back-btn" @click="goBack"> 返回 </el-button>
-    <h2 class="title">未到账期金额</h2>
-  </div>
-  <div class="table-box">
-    <ProTable
-      ref="proTable"
-      :columns="columns"
-      :request-api="getTableList"
-      :init-param="initParam"
-      :data-callback="dataCallback"
-      :pagination="true"
-    >
-      <!-- 表格操作 -->
-      <template #operation="scope">
-        <el-button type="primary" link @click="toDetail(scope.row)"> 查看详情 </el-button>
-      </template>
-    </ProTable>
-    <el-dialog v-model="dialogVisible" title="详情" width="500px">
-      <h2>{{ unposted.couponName }}</h2>
-      <el-row class="couponRow">
-        <el-col :span="12"> 实际收益:+138.32 </el-col>
-        <el-col :span="12">
-          {{ `技术服务费(${unposted.commissionRate || 3}%)` }}:{{
-            unposted.commissionStr != null ? unposted.commissionStr : "--"
-          }}
-        </el-col>
-      </el-row>
-      <el-row class="couponRow">
-        <el-col :span="12"> 售价:{{ unposted.incomeMoney || ((unposted?.money || 0) / 100).toFixed(2) || "0.00" }} </el-col>
-      </el-row>
-      <h3>订单信息</h3>
-      <div>
-        <div class="couponRow">下单时间:{{ unposted.orderTime != null ? unposted.orderTime : "--" }}</div>
-        <div class="couponRow">验券时间:{{ unposted.checkTime != null ? unposted.checkTime : "--" }}</div>
-        <div class="couponRow">入账时间:{{ unposted.createdTime != null ? unposted.createdTime : "--" }}</div>
-      </div>
-    </el-dialog>
+  <div class="unposted">
+    <!-- 头部 -->
+    <div class="header">
+      <el-button class="back-btn" @click="goBack"> 返回 </el-button>
+      <h2 class="title">未到账期金额</h2>
+    </div>
+    <div class="table-box">
+      <ProTable
+        ref="proTable"
+        :columns="columns"
+        :request-api="getTableList"
+        :init-param="initParam"
+        :data-callback="dataCallback"
+        :pagination="true"
+        :height="tableHeight"
+      >
+        <!-- 表格操作 -->
+        <template #operation="scope">
+          <el-button type="primary" link @click="toDetail(scope.row)"> 查看详情 </el-button>
+        </template>
+      </ProTable>
+      <el-dialog v-model="dialogVisible" title="详情" width="500px">
+        <h2 class="orderInfo">
+          {{ unposted.couponName }}
+        </h2>
+
+        <el-row class="couponRow">
+          <el-col :span="12">
+            实际收益: {{ unposted.incomeMoney || ((unposted?.money || 0) / 100).toFixed(2) || "0.00" }}
+          </el-col>
+          <el-col :span="12">
+            {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}:
+            {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
+          </el-col>
+        </el-row>
+        <el-row class="couponRow">
+          <el-col :span="12"> 售价: {{ unposted.orderPrice || "--" }} </el-col>
+        </el-row>
+
+        <h3 class="orderInfo">订单信息</h3>
+        <div>
+          <div class="couponRow">下单时间:{{ unposted.orderTime != null ? unposted.orderTime : "--" }}</div>
+          <div class="couponRow">验券时间:{{ unposted.checkTime != null ? unposted.checkTime : "--" }}</div>
+          <div class="couponRow">入账时间:{{ unposted.createdTime != null ? unposted.createdTime : "--" }}</div>
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -54,6 +62,8 @@ import { localGet } from "@/utils";
 const router = useRouter();
 const dialogVisible = ref(false);
 const unposted = ref<any>({});
+// 计算表格高度
+const tableHeight = ref<string>("calc(100vh - 200px)");
 const toDetail = (row: any) => {
   dialogVisible.value = true;
   unposted.value = row;
@@ -147,13 +157,44 @@ const getTableList = (params: any) => {
 </script>
 
 <style lang="scss" scoped>
+.unposted {
+  display: flex;
+  flex-direction: column;
+  height: 100%;
+  overflow: hidden;
+}
+.orderInfo {
+  padding-bottom: 20px;
+  font-size: 18px;
+  font-weight: bold;
+}
+.table-box {
+  display: flex;
+  flex: 1;
+  flex-direction: column;
+  overflow: hidden;
+  :deep(.table-main) {
+    display: flex;
+    flex: 1;
+    flex-direction: column;
+    overflow: hidden;
+    .el-table {
+      flex: 1;
+      overflow: hidden;
+    }
+    .el-table__body-wrapper {
+      overflow-y: auto !important;
+    }
+  }
+}
 .header {
   position: relative;
   display: flex;
   align-items: center;
-  padding: 20px;
+  padding: 15px;
   background: #ffffff;
-  border-bottom: 1px solid #e4e7ed;
+  border-radius: 5px;
+  box-shadow: 0 0 12px rgb(0 0 0 / 5%);
   .back-btn {
     padding: 8px 16px;
     font-size: 14px;

+ 22 - 2
src/views/home/components/go-examine.vue

@@ -52,8 +52,8 @@ 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 } from "@/api/modules/homeEntry.ts";
-import { localGet } from "@/utils/index";
+import { verifyOrder, verifyCoupon, getTodayOrderCount, getTodayIncome, getMerchantByPhone } from "@/api/modules/homeEntry";
+import { localGet, localSet } from "@/utils/index";
 const userInfo = localGet("geeker-user").userInfo;
 // 数据(可根据实际接口替换)
 const storeName = ref("时间图书馆");
@@ -66,7 +66,24 @@ const todayRevenue = ref(0);
 onMounted(() => {
   getOrder();
   getInCome();
+  getMyMoney();
 });
+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) {
@@ -95,6 +112,9 @@ const handleVerify = async () => {
     } else {
       ElMessage.success(res.msg);
     }
+    voucherCode.value = "";
+    getOrder();
+    getInCome();
   } else {
     ElMessage.success(res.msg);
   }

+ 5 - 1
src/views/home/components/go-flow.vue

@@ -192,7 +192,7 @@
         <el-button type="danger" size="large" class="register-btn-red" @click="changeRefuse" v-if="storeApplicationStatus == 2">
           审核拒绝,重新入驻
         </el-button>
-        <el-button type="primary" size="large" class="register-btn" v-else> 等待审核 </el-button>
+        <el-button type="primary" size="large" class="register-btn" v-if="storeApplicationStatus == 0"> 等待审核 </el-button>
       </div>
     </div>
   </div>
@@ -679,8 +679,12 @@ const handleSubmit = async () => {
           try {
             const res: any = await applyStore(params);
             if (res && res.code == 200) {
+              // 重新提交后,状态应该变为等待审核(0)
+              storeApplicationStatus.value = 0;
               setStep(3); // 跳转到等待审核步骤
               ElMessage.success(res.msg);
+              // 通知父组件重新获取用户信息,更新状态
+              callGetUserInfo();
             } else {
               ElMessage.error(res.msg || "提交失败");
             }

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

@@ -61,10 +61,16 @@ const getUserInfo = async () => {
         const resStore: any = await getDetail(param1);
         if (resStore && resStore.code == 200 && resStore.data) {
           storeApplicationStatus.value = resStore.data.storeApplicationStatus;
+          console.log(storeApplicationStatus.value);
+          if (storeApplicationStatus.value == 0) {
+            currentStep.value = 3;
+          }
           if (storeApplicationStatus.value == 2) {
             currentStep.value = 3;
           }
-          if (resStore.data.storeApplicationStatus == 2 && res.data.storeId != null) {
+
+          if (resStore.data.storeApplicationStatus !== 1 && res.data.storeId != null) {
+            //storeId && storeDetail.storeApplicationStatus === 1
             isEntry.value = true;
           } else {
             isExaime.value = true;