zhuli 3 週間 前
コミット
ff8b1997d7

+ 16 - 0
src/api/modules/homeEntry.ts

@@ -62,6 +62,10 @@ export const getPaymentCycle = params => {
 export const checkPayPassword = params => {
   return http.get<StoreUser.ResStoreUserList>(PORT_NONE + `/merchantUser/checkPayPassword`, params);
 };
+//设置提现密码
+export const setPayPassword = params => {
+  return http.post(PORT_NONE + `/merchantUser/setPayPassword`, params);
+};
 //提现记录列表
 export const getCashOutRecordList = params => {
   return http.get<StoreUser.ResStoreUserList>(PORT_NONE + `/incomeManage/getCashOutRecordList`, params);
@@ -72,3 +76,15 @@ export const getUserByPhone = params => {
 export const getDetail = params => {
   return http.get(PORT_NONE + `/storeManage/getStoreDetail`, params);
 };
+//重置商户到刚注册状态
+export const resetToInitialStatus = () => {
+  return http.post(PORT_NONE + `/merchantUser/resetToInitialStatus`);
+};
+//添加支付宝账号
+export const addAlipayAccount = params => {
+  return http.post(PORT_NONE + `/merchantUser/addAlipayAccount`, params);
+};
+//提现申请-提交
+export const cashOut = params => {
+  return http.get(PORT_NONE + `/incomeManage/cashOut`, params);
+};

+ 144 - 56
src/views/financialManagement/cashApply.vue

@@ -36,37 +36,68 @@
       <div class="section">
         <div class="section-title">提现账户</div>
         <div class="account-list">
-          <div
-            v-for="account in accountList"
-            :key="account.id"
-            class="account-item"
-            :class="{ active: selectedAccountId === account.id }"
-            @click="selectAccount(account.id)"
-          >
+          <div class="account-item" @click="selectAccount">
             <div class="account-left">
-              <img :src="account.icon" alt="" class="account-icon" />
+              <img :src="zfbIcon" alt="" class="account-icon" />
               <div class="account-info">
                 <div class="account-name">
-                  {{ account.name }}
+                  {{ userInfo.name }}
                 </div>
                 <div class="account-number">
-                  {{ account.accountNumber }}
+                  {{ userInfo.alipayAccount }}
                 </div>
               </div>
             </div>
             <div class="account-right">
-              <div v-if="selectedAccountId === account.id" class="selected-indicator" />
+              <div class="selected-indicator" />
             </div>
           </div>
         </div>
       </div>
+      <!-- 底部按钮 -->
+      <div class="footer">
+        <el-button type="primary" class="submit-btn" @click="handleSubmit"> 提交申请11 </el-button>
+      </div>
     </div>
-
-    <!-- 底部按钮 -->
-    <div class="footer">
-      <el-button class="cancel-btn" @click="goBack"> 取消 </el-button>
-      <el-button type="primary" class="submit-btn" @click="handleSubmit"> 提交申请 </el-button>
-    </div>
+    <!-- 确认对话框 -->
+    <el-dialog
+      v-model="cashDialogVisible"
+      title="提现金额域账户确认"
+      width="500px"
+      :close-on-click-modal="false"
+      class="confirm-dialog"
+    >
+      <div class="confirm-content">
+        <div class="confirm-item">
+          <span class="confirm-label">提现金额:</span>
+          <span class="confirm-value">¥ {{ withdrawAmount || "0" }}</span>
+        </div>
+        <div class="confirm-item">
+          <span class="confirm-label">提现账户:</span>
+          <span class="confirm-value">支付宝账户 ({{ userInfo.alipayAccount }})</span>
+        </div>
+        <div class="password-section">
+          <div class="password-label">请输入提现密码</div>
+          <el-input
+            v-model="withdrawPassword"
+            type="password"
+            placeholder="请输入6位提现密码"
+            maxlength="6"
+            show-password
+            class="password-input"
+            @input="handlePasswordInput"
+          />
+        </div>
+      </div>
+      <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>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -74,26 +105,43 @@
 import { ref, onMounted } from "vue";
 import { useRouter } from "vue-router";
 import { ElMessage } from "element-plus";
-import { getAccountBalance } from "@/api/modules/homeEntry";
+import { getAccountBalance, cashOut } from "@/api/modules/homeEntry";
 import zfbIcon from "@/assets/financial/zfb-icon.png";
+import { localGet } from "@/utils";
+const userInfo = localGet("geeker-user").userInfo;
 
 const router = useRouter();
-
-// 可提现金额
-const availableAmount = ref<number>(586);
-
+const cashDialogVisible = ref(false);
+const withdrawPassword = ref("");
 // 提现金额
 const withdrawAmount = ref<string>("");
+// 密码输入处理(只允许数字)
+const handlePasswordInput = (value: string) => {
+  withdrawPassword.value = value.replace(/\D/g, "");
+};
+// 取消确认
+const handleCancelConfirm = () => {
+  cashDialogVisible.value = false;
+  withdrawPassword.value = "";
+};
+const handleConfirmSubmit = async () => {
+  const res: any = await cashOut({
+    storeId: userInfo.storeId,
+    payPassword: withdrawPassword.value,
+    withdrawalMoney: Number(withdrawAmount.value) * 100
+  });
+  if (res.code == 200) {
+    ElMessage.success("提现申请已发起成功,请耐心等待");
+    cashDialogVisible.value = false;
+  } else {
+    ElMessage.error(res.message);
+  }
+};
+// 可提现金额
+const availableAmount = ref<number>(0);
 
 // 账户列表
-const accountList = ref([
-  {
-    id: 1,
-    name: "支付宝",
-    accountNumber: "130****1234",
-    icon: zfbIcon
-  }
-]);
+const accountList = ref({});
 
 // 选中的账户ID
 const selectedAccountId = ref<number>(1);
@@ -156,28 +204,21 @@ const handleSubmit = () => {
     ElMessage.warning("请选择提现账户");
     return;
   }
-
-  // TODO: 调用提现API
-  ElMessage.success("提现申请提交成功");
-  // 提交成功后返回上一页
-  setTimeout(() => {
-    goBack();
-  }, 1500);
+  cashDialogVisible.value = true;
 };
 
 // 获取可提现金额
 const fetchAccountBalance = async () => {
-  try {
-    let param = {
-      storeId: 138
-    };
-    const res: any = await getAccountBalance(param as any);
-    if (res.code == 200 && res.data) {
-      // 根据实际API返回的数据结构更新
-      // availableAmount.value = res.data.availableAmount || res.data.amount || 586;
-    }
-  } catch (error) {
-    console.error("获取可提现金额失败:", error);
+  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返回的数据结构更新
+    // availableAmount.value = res.data.availableAmount || res.data.amount || 586;
   }
 };
 
@@ -336,13 +377,10 @@ onMounted(() => {
 }
 .footer {
   display: flex;
-  gap: 12px;
-  padding: 20px;
-  background-color: #ffffff;
-  border-top: 1px solid #e4e7ed;
+  justify-content: center;
+  margin-top: 100px;
   .cancel-btn {
-    flex: 1;
-    padding: 12px;
+    padding: 20px;
     font-size: 16px;
     color: #606266;
     background-color: #f5f7fa;
@@ -355,8 +393,7 @@ onMounted(() => {
     }
   }
   .submit-btn {
-    flex: 1;
-    padding: 12px;
+    padding: 20px;
     font-size: 16px;
     color: #ffffff;
     background-color: #409eff;
@@ -367,4 +404,55 @@ onMounted(() => {
     }
   }
 }
+:deep(.confirm-dialog) {
+  .el-dialog__header {
+    padding: 20px 24px;
+    border-bottom: 1px solid #e4e7ed;
+  }
+  .el-dialog__title {
+    font-size: 18px;
+    font-weight: 600;
+    color: #333333;
+  }
+  .el-dialog__body {
+    padding: 24px;
+  }
+}
+.confirm-content {
+  display: flex;
+  flex-direction: column;
+  gap: 20px;
+  .confirm-item {
+    display: flex;
+    gap: 12px;
+    align-items: center;
+    font-size: 14px;
+    .confirm-label {
+      min-width: 80px;
+      font-weight: 500;
+      color: #606266;
+    }
+    .confirm-value {
+      font-weight: 500;
+      color: #333333;
+    }
+  }
+  .password-section {
+    display: flex;
+    flex-direction: column;
+    gap: 12px;
+    margin-top: 8px;
+    .password-label {
+      font-size: 14px;
+      font-weight: 500;
+      color: #606266;
+    }
+    .password-input {
+      :deep(.el-input__wrapper) {
+        padding: 12px 16px;
+        border-radius: 4px;
+      }
+    }
+  }
+}
 </style>

+ 125 - 11
src/views/financialManagement/index.vue

@@ -44,6 +44,21 @@
         </el-button>
       </el-card>
     </div>
+
+    <!-- 重置按钮 -->
+    <el-card class="reset-card" shadow="hover">
+      <div class="reset-content">
+        <div class="reset-info">
+          <h3 class="reset-title">重置到刚注册状态</h3>
+          <p class="reset-desc">
+            此操作将删除所有入住申请数据、订单、优惠券、验券、消息等相关数据,恢复到刚注册时的初始状态。此操作不可恢复,请谨慎操作!
+          </p>
+        </div>
+        <el-button type="danger" class="reset-btn" @click="handleResetToInitialStatus" :loading="resetLoading">
+          重置到刚注册状态
+        </el-button>
+      </div>
+    </el-card>
   </div>
 </template>
 
@@ -51,10 +66,16 @@
 import { ref, reactive, watch, onMounted, nextTick } from "vue";
 import { QuestionFilled, ArrowRight } from "@element-plus/icons-vue";
 import gold from "../../assets/financial/gold.png";
-import { getAccountBalance, getTodayIncome, getPaymentCycle, checkPayPassword } from "@/api/modules/homeEntry";
+import {
+  getAccountBalance,
+  getTodayIncome,
+  getPaymentCycle,
+  checkPayPassword,
+  resetToInitialStatus
+} from "@/api/modules/homeEntry";
 import { localGet } from "@/utils/index";
 import { useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
 import en from "@/languages/modules/en";
 import { pa } from "element-plus/es/locale";
 const router = useRouter();
@@ -146,18 +167,24 @@ const fetchGetTodayIncome = async () => {
 };
 
 const handleAction = async (key: string) => {
-  console.log(key);
   if (key == "withdraw") {
-    let param = {
-      storeUserId: userInfo.id
-    };
-    const res: any = await checkPayPassword(param as any);
-    if (res.code == 200) {
-      if (res.data.data == "false") {
+    if (userInfo.idCard == null) {
+      router.push({ path: "/financialManagement/realName" });
+    } 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" });
-      } else {
-        router.push({ path: "/financialManagement/withdrawaRequest" });
+        return;
+        if (res.data.data == "false") {
+          ElMessage.error(res.data.message);
+          router.push({ path: "/financialManagement/realName" });
+        } else {
+          router.push({ path: "/financialManagement/withdrawaRequest" });
+        }
       }
     }
   }
@@ -168,6 +195,48 @@ const handleAction = async (key: string) => {
     router.push({ path: "/financialManagement/unposted" });
   }
 };
+
+// 重置到刚注册状态
+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();
+
+    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">
@@ -280,4 +349,49 @@ const handleAction = async (key: string) => {
     grid-template-columns: repeat(1, 1fr);
   }
 }
+.reset-card {
+  width: 100%;
+  border: none;
+  border-radius: 12px;
+  .reset-content {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 20px;
+    .reset-info {
+      flex: 1;
+      .reset-title {
+        margin: 0 0 8px;
+        font-size: 18px;
+        font-weight: 600;
+        color: #222222;
+      }
+      .reset-desc {
+        margin: 0;
+        font-size: 14px;
+        line-height: 1.6;
+        color: #666666;
+      }
+    }
+    .reset-btn {
+      padding: 12px 32px;
+      margin-left: 24px;
+      font-size: 16px;
+    }
+  }
+}
+
+@media (width <= 768px) {
+  .reset-card {
+    .reset-content {
+      flex-direction: column;
+      gap: 16px;
+      align-items: flex-start;
+      .reset-btn {
+        width: 100%;
+        margin-left: 0;
+      }
+    }
+  }
+}
 </style>

+ 333 - 62
src/views/financialManagement/realName.vue

@@ -106,7 +106,7 @@
               />
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" class="submit-button" :loading="passwordLoading" @click="handlePasswordSubmit">
+              <el-button type="primary" class="submit-button" :loading="passwordLoading" @click="handlePasswordOneSubmit">
                 确认
               </el-button>
             </el-form-item>
@@ -134,7 +134,7 @@
           >
             <el-form-item label="验证原密码" prop="password">
               <el-input
-                v-model="passwordForm.password"
+                v-model="oldPasswordForm.password"
                 type="password"
                 placeholder="请输入6位提现密码"
                 clearable
@@ -143,13 +143,13 @@
                 class="password-input"
               />
             </el-form-item>
-            <div class="forget-password">忘记密码</div>
+            <div class="forget-password" @click="getForgetPassword">忘记密码</div>
             <el-button type="primary" class="submit-button" @click="nextStept"> 下一步 </el-button>
           </el-form>
           <el-form
             ref="passwordFormRef"
-            :model="passwordForm"
-            :rules="passwordRules"
+            :model="oldTwoPasswordForm"
+            :rules="passwordRulesTwo"
             label-width="120px"
             label-position="left"
             class="form-wrapper"
@@ -157,7 +157,7 @@
           >
             <el-form-item label="设置提现密码" prop="password">
               <el-input
-                v-model="passwordForm.password"
+                v-model="oldTwoPasswordForm.password"
                 type="password"
                 placeholder="请输入6位提现密码"
                 clearable
@@ -168,7 +168,7 @@
             </el-form-item>
             <el-form-item label="请确认密码" prop="confirmPassword">
               <el-input
-                v-model="passwordForm.confirmPassword"
+                v-model="oldTwoPasswordForm.confirmPassword"
                 type="password"
                 placeholder="请输入6位提现密码"
                 clearable
@@ -178,7 +178,7 @@
               />
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" class="submit-button" :loading="passwordLoading" @click="handlePasswordSubmit">
+              <el-button type="primary" class="submit-button" :loading="passwordLoading" @click="handlePasswordTwoSubmit">
                 确认
               </el-button>
             </el-form-item>
@@ -187,15 +187,18 @@
       </div>
     </div>
     <!--收款账户-->
-    <!-- <div class="content-section" v-if="activeTab === 'receivingAccount'">
-      <div class="content-wrapper"> -->
-    <!-- <el-button type="primary" class="auth-button" @click="handleGoZFB"> 添加支付宝账号 </el-button> -->
-    <!-- <div class="zfb-wrapper">
+    <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 == null">
+          添加支付宝账号
+        </el-button>
+
+        <div class="zfb-wrapper" v-else>
           <div class="zfb-left">
             <el-image :src="zfbIcon" class="zfbIcon" />
             <div>
               <div>支付宝</div>
-              <div>130******111</div>
+              <div>{{ userInfo.phone }}</div>
             </div>
           </div>
           <div class="operate">
@@ -204,10 +207,24 @@
           </div>
         </div>
       </div>
-    </div> -->
-
+    </div>
+    <el-button type="primary" @click="goToCashApply"> 去提现 </el-button>
+    <!--添加支付宝账号--->
+    <el-dialog v-model="dialogVisibleZFB" :title="zfbTitle" width="500px" :close-on-click-modal="false">
+      <el-form ref="authFormRef1" :model="authForm1" :rules="authRules1" label-width="100px" label-position="left">
+        <el-form-item label="支付宝账号" prop="zfbName">
+          <el-input v-model="authForm1.zfbName" placeholder="请输入支付宝账号" clearable />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="handleCancelZFB">取消</el-button>
+          <el-button type="primary" :loading="loading" @click="handleConfirmZFB">确认</el-button>
+        </span>
+      </template>
+    </el-dialog>
     <!-- 忘记密码对话框 -->
-    <!-- <el-dialog v-model="forgotPasswordVisible" title="忘记密码" width="500px" draggable :close-on-click-modal="false">
+    <el-dialog v-model="forgotPasswordVisible" title="忘记密码" width="500px" draggable :close-on-click-modal="false">
       <el-form
         ref="forgotPasswordFormRef"
         :model="forgotPasswordForm"
@@ -219,11 +236,11 @@
           <span>{{ maskedPhone }}</span>
         </el-form-item>
 
-        <el-form-item label="" prop="verificationCode">
+        <el-form-item label="验证码">
           <div style="display: flex; gap: 12px; width: 100%">
             <el-input v-model="forgotPasswordForm.verificationCode" placeholder="请输入" clearable style="flex: 1" />
-            <el-button type="primary" :disabled="codeCountdown > 0" @click="sendLoginCode">
-              {{ codeCountdown > 0 ? `${codeCountdown}秒后重新获取` : "获取验证码" }}
+            <el-button :disabled="codeCountdown > 0" @click="sendForgotCode" class="code-button">
+              {{ codeCountdown > 0 ? `${codeCountdown}秒后重` : "获取验证码" }}
             </el-button>
           </div>
         </el-form-item>
@@ -232,39 +249,41 @@
           <el-input
             v-model="forgotPasswordForm.newPassword"
             type="password"
-            placeholder="请输入6-16位的密码,包含字母和数字"
+            placeholder="请输入6位提现密码"
             show-password
             clearable
           />
         </el-form-item>
-      </el-form>
-    </el-dialog> -->
-
-    <!--添加支付宝账号--->
-    <!-- <el-dialog v-model="dialogVisibleZFB" title="添加支付宝账号" width="500px" :close-on-click-modal="false">
-      <el-form ref="authFormRef1" :model="authForm" :rules="authRules" label-width="100px" label-position="left">
-        <el-form-item label="支付宝账号" prop="name">
-          <el-input v-model="authForm.zfbName" placeholder="请输入支付宝账号" clearable />
+        <el-form-item label="确认密码" prop="newPassword">
+          <el-input
+            v-model="forgotPasswordForm.confireNewPassword"
+            type="password"
+            placeholder="请输入6位提现密码"
+            show-password
+            clearable
+          />
         </el-form-item>
       </el-form>
       <template #footer>
         <span class="dialog-footer">
-          <el-button @click="handleCancel">取消</el-button>
+          <el-button @click="handleCancelZFB">取消</el-button>
           <el-button type="primary" :loading="loading" @click="handleConfirmZFB">确认</el-button>
         </span>
       </template>
-    </el-dialog> -->
+    </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
 import { ref, reactive, computed, onMounted } from "vue";
 import { useRouter } from "vue-router";
-import { ElMessage, type FormInstance, type FormRules } from "element-plus";
-import { verifyIdInfo, checkPayPassword } from "@/api/modules/homeEntry";
-import { localGet } from "@/utils/index";
+import { ElMessage, type FormInstance, ElMessageBox, type FormRules } from "element-plus";
+import { verifyIdInfo, checkPayPassword, setPayPassword, getMerchantByPhone, addAlipayAccount } 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 = localGet("geeker-user").userInfo;
 const router = useRouter();
 const activeTab = ref("realName");
@@ -300,6 +319,7 @@ const handleGoAuth = () => {
   }
 };
 //实名认证 确认
+const shimingInfo = ref(null);
 const handleConfirm = async () => {
   if (!authFormRef.value) return;
 
@@ -317,11 +337,18 @@ const handleConfirm = async () => {
         console.log(res);
         if (res && res.code == 200) {
           ElMessage.success(res.msg || "实名认证提交成功");
-          dialogVisible.value = false;
-          goAuth.value = false;
-          // 重置表单
-          authFormRef.value?.resetFields();
-          // 这里可以更新认证状态或刷新页面数据
+          let param = {
+            phone: userInfo.phone
+          };
+          const res1: any = await getMerchantByPhone(param);
+          if (res1.code == 200) {
+            dialogVisible.value = false;
+            goAuth.value = false;
+            // 重置表单
+            authFormRef.value?.resetFields();
+            shimingInfo.value = res1.data;
+            // 这里可以更新认证状态或刷新页面数据
+          }
         } else {
           ElMessage.error(res.msg || "实名认证失败,请重试");
         }
@@ -366,22 +393,78 @@ const passwordRules = reactive<FormRules>({
     }
   ]
 });
+// 第二步修改密码的验证规则
+const passwordRulesTwo = reactive<FormRules>({
+  password: [
+    { required: true, message: "请输入6位提现密码", trigger: "blur" },
+    {
+      pattern: /^\d{6}$/,
+      message: "请输入6位数字密码",
+      trigger: "blur"
+    }
+  ],
+  confirmPassword: [
+    { required: true, message: "请确认密码", trigger: "blur" },
+    {
+      validator: (rule: any, value: any, callback: any) => {
+        if (value !== oldTwoPasswordForm.password) {
+          callback(new Error("两次输入的密码不一致"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "blur"
+    }
+  ]
+});
 //提现密码 确认
-const handlePasswordSubmit = async () => {
+const passwordLoading = ref(false);
+const handlePasswordOneSubmit = async () => {
   if (!passwordFormRef.value) return;
 
   // 表单验证
-  await passwordFormRef.value.validate(valid => {
+  await passwordFormRef.value.validate(async valid => {
     if (valid) {
       passwordLoading.value = true;
-      // 这里可以调用API设置提现密码
-      // 模拟API调用
-      setTimeout(() => {
+      try {
+        const res: any = await setPayPassword({
+          payPassword: passwordForm.password,
+          id: userInfo.id
+        });
+        if (res.code == 200) {
+          ElMessage.success(res.msg || "提现密码设置成功");
+
+          // 更新本地存储中的提现密码
+          try {
+            const geekerUser = localGet("geeker-user");
+            if (geekerUser && geekerUser.userInfo) {
+              geekerUser.userInfo.payPassword = passwordForm.password;
+              localSet("geeker-user", geekerUser);
+            }
+          } catch (error) {
+            console.error("更新本地存储失败:", error);
+          }
+
+          // 重置表单
+          passwordFormRef.value?.resetFields();
+          // 如果是在修改密码流程中(twoEnterPage为true),设置状态为已设置
+          if (twoEnterPage.value) {
+            twoEnterPage.value = true;
+            withdrawPass.value = false;
+            currentStep.value = 1; // 重置步骤
+          } else {
+            // 首次设置密码,跳转到收款账户
+            activeTab.value = "receivingAccount";
+          }
+        } else {
+          ElMessage.error(res.msg || "提现密码设置失败");
+        }
+      } catch (error) {
+        console.error("设置提现密码失败:", error);
+        ElMessage.error("提现密码设置失败,请重试");
+      } finally {
         passwordLoading.value = false;
-        ElMessage.success("提现密码设置成功");
-        // 重置表单
-        passwordFormRef.value?.resetFields();
-      }, 1000);
+      }
     }
   });
 };
@@ -397,34 +480,209 @@ const passList = [
     title: "设置新密码"
   }
 ];
+//忘记密码
+
+const forgotPasswordVisible = ref(false);
+const forgotPasswordFormRef = ref<FormInstance>();
+// 验证码倒计时
+const codeCountdown = ref(0);
+let countdownTimer: NodeJS.Timeout | null = null;
+const forgotPasswordForm = reactive({
+  newPassword: "",
+  confireNewPassword: "",
+  verificationCode: ""
+});
+const getForgetPassword = async () => {
+  forgotPasswordVisible.value = true;
+};
+// 发送短信验证码
+const sendForgotCode = async () => {
+  let phoneCode: any = await getPhoneCode({ phone: userInfo.phone, appType: "2", businessType: "6" });
+  if (phoneCode.code === 200) {
+    ElMessage.success("验证码已发送");
+    // 开始倒计时
+    codeCountdown.value = 60;
+    countdownTimer = setInterval(() => {
+      codeCountdown.value--;
+      if (codeCountdown.value <= 0) {
+        if (countdownTimer) {
+          clearInterval(countdownTimer);
+          countdownTimer = null;
+        }
+      }
+    }, 1000);
+  }
+};
 //下一步
+
+const oldPasswordForm = reactive({
+  password: ""
+});
+
+const oldTwoPasswordForm = reactive({
+  password: "",
+  confirmPassword: ""
+});
+
 const nextStept = async () => {
-  currentStep.value = 2;
+  if (oldPasswordForm.password === userInfo.payPassword) {
+    currentStep.value = 2;
+  } else {
+    ElMessage.error("原密码错误");
+  }
+};
+
+const handlePasswordTwoSubmit = async () => {
+  if (!passwordFormRef.value) return;
+
+  // 表单验证
+  await passwordFormRef.value.validate(async valid => {
+    if (valid) {
+      passwordLoading.value = true;
+      try {
+        const res: any = await setPayPassword({
+          payPassword: oldTwoPasswordForm.password,
+          id: userInfo.id
+        });
+        if (res.code == 200) {
+          ElMessage.success(res.msg || "提现密码修改成功");
+
+          // 更新本地存储中的提现密码
+          try {
+            const geekerUser = localGet("geeker-user");
+            if (geekerUser && geekerUser.userInfo) {
+              geekerUser.userInfo.payPassword = oldTwoPasswordForm.password;
+              localSet("geeker-user", geekerUser);
+            }
+          } catch (error) {
+            console.error("更新本地存储失败:", error);
+          }
+
+          // 重置表单
+          passwordFormRef.value?.resetFields();
+          oldPasswordForm.password = "";
+          oldTwoPasswordForm.password = "";
+          oldTwoPasswordForm.confirmPassword = "";
+          // 重置步骤
+          currentStep.value = 1;
+        } else {
+          ElMessage.error(res.msg || "提现密码修改失败");
+        }
+      } catch (error) {
+        console.error("修改提现密码失败:", error);
+        ElMessage.error("提现密码修改失败,请重试");
+      } finally {
+        passwordLoading.value = false;
+      }
+    }
+  });
 };
 
 //收款账户
+const authFormRef1 = ref<FormInstance>();
+const authRules1 = reactive<FormRules>({
+  zfbName: [{ required: true, message: "请输入支付宝账号", trigger: "blur" }]
+});
+const authForm1 = reactive({
+  zfbName: ""
+});
+const zfbShow = ref(false);
+const zfbTitle = ref("");
 const dialogVisibleZFB = ref(false);
 const handleGoZFB = async () => {
+  zfbTitle.value = "添加支付宝账号";
   dialogVisibleZFB.value = true;
 };
 const handleConfirmZFB = async () => {
-  dialogVisibleZFB.value = false;
+  if (!authFormRef1.value) return;
+  await authFormRef1.value.validate(async valid => {
+    if (valid) {
+      loading.value = true;
+      try {
+        const params = {
+          alipayAccount: authForm1.zfbName
+        };
+        const res: any = await addAlipayAccount(params);
+        if (res && res.code == 200) {
+          ElMessage.success(res.msg || "添加支付宝账号成功");
+
+          // 更新本地存储中的支付宝账号
+          try {
+            const geekerUser = localGet("geeker-user");
+            if (geekerUser && geekerUser.userInfo) {
+              geekerUser.userInfo.aliPayAccount = authForm1.zfbName;
+              localSet("geeker-user", geekerUser);
+            }
+          } catch (error) {
+            console.error("更新本地存储失败:", error);
+          }
+
+          dialogVisibleZFB.value = false;
+          zfbShow.value = true;
+          // 重置表单
+          authFormRef1.value?.resetFields();
+        } else {
+          ElMessage.error(res.msg || "添加支付宝账号失败,请重试");
+        }
+      } catch (error) {
+        console.error("添加支付宝账号失败:", error);
+        ElMessage.error("添加支付宝账号失败,请重试");
+      } finally {
+        loading.value = false;
+      }
+    }
+  });
+};
+const getEditZfb = async () => {
+  zfbTitle.value = "编辑支付宝账号";
+  dialogVisibleZFB.value = true;
+  authForm1.zfbName = userInfo.phone;
+};
+const getDelZfb = async () => {
+  ElMessageBox.confirm("确定要删除该账号,删除后无法进行提现操作", "删除账号", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消"
+  })
+    .then(() => {})
+    .catch(() => {});
+};
+
+// 跳转到提现申请页面
+const goToCashApply = () => {
+  router.push("/financialManagement/cashApply");
 };
-const getEditZfb = async () => {};
-const getDelZfb = async () => {};
 
-const passwordLoading = ref(false);
-const forgotPasswordVisible = ref(false);
-const forgotPasswordFormRef = ref<FormInstance>();
-const forgotPasswordForm = reactive({
-  verificationCode: "",
-  newPassword: ""
-});
 // 忘记密码表单验证规则
 const forgotPasswordRules: FormRules = {
   verificationCode: [{ required: true, message: "请输入验证码", trigger: "blur" }]
 };
 
+// 检查提现密码状态
+const checkPasswordStatus = async () => {
+  try {
+    if (userInfo.idCard && userInfo.id) {
+      const param = {
+        storeUserId: userInfo.id
+      };
+      const res: any = await checkPayPassword(param as any);
+      if (res.code == 200) {
+        // 如果已设置提现密码,显示修改密码界面
+        if (res.data.data == "true") {
+          twoEnterPage.value = true;
+          withdrawPass.value = false;
+          currentStep.value = 1; // 重置步骤
+        } else {
+          // 如果未设置提现密码,显示首次设置界面
+          twoEnterPage.value = false;
+          withdrawPass.value = true;
+        }
+      }
+    }
+  } catch (error) {
+    console.error("检查提现密码状态失败:", error);
+  }
+};
+
 // 检查提现密码并自动跳转
 const checkWithdrawPassword = async () => {
   try {
@@ -438,6 +696,8 @@ const checkWithdrawPassword = async () => {
         // 如果未设置提现密码,自动跳转到提现密码标签页
         if (res.data.data == "false") {
           activeTab.value = "withdrawPassword";
+        } else {
+          activeTab.value = "receivingAccount";
         }
       }
     }
@@ -463,10 +723,13 @@ const maskedPhone = computed(() => {
   return userPhone.value.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
 });
 
-const handleTabClick = (tab: any) => {
+const handleTabClick = async (tab: any) => {
   // 根据不同的标签页可以跳转到不同的页面或显示不同的内容
   console.log("切换到标签:", tab.props.name);
-  // 这里可以根据需要实现路由跳转或内容切换
+  // 如果切换到提现密码标签页,检查提现密码状态
+  if (tab.props.name === "withdrawPassword") {
+    await checkPasswordStatus();
+  }
 };
 
 const handleCancel = () => {
@@ -476,6 +739,14 @@ const handleCancel = () => {
     authFormRef.value.resetFields();
   }
 };
+
+const handleCancelZFB = () => {
+  dialogVisibleZFB.value = false;
+  // 重置表单
+  if (authFormRef1.value) {
+    authFormRef1.value.resetFields();
+  }
+};
 </script>
 
 <style scoped lang="scss">
@@ -625,10 +896,10 @@ const handleCancel = () => {
     .zfb-wrapper {
       display: flex;
       justify-content: space-between;
-      width: 800px;
+      width: 100%;
       height: 80px;
       padding: 0 20px;
-      border: 1px solid #aaaaaa;
+      border: 1px solid #dddddd;
       border-radius: 8px;
       .operate {
         display: flex;

+ 42 - 0
src/views/financialManagement/reconciled.vue

@@ -1,4 +1,9 @@
 <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">
       <!-- 表格操作 -->
@@ -32,7 +37,13 @@ import ProTable from "@/components/ProTable/index.vue";
 import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
 import { getPaymentCycle } from "@/api/modules/homeEntry";
 import { localGet } from "@/utils";
+import { useRouter } from "vue-router";
+const router = useRouter();
 const dialogVisible = ref(true);
+// 返回
+const goBack = () => {
+  router.back();
+};
 const toDetail = (row: any) => {
   dialogVisible.value = true;
 };
@@ -101,6 +112,37 @@ const getTableList = (params: any) => {
 </script>
 
 <style lang="scss" scoped>
+.header {
+  position: relative;
+  display: flex;
+  align-items: center;
+  padding: 20px;
+  background: #ffffff;
+  border-bottom: 1px solid #e4e7ed;
+  .back-btn {
+    padding: 8px 16px;
+    font-size: 14px;
+    color: #606266;
+    background-color: #f5f7fa;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    &:hover {
+      color: #409eff;
+      background-color: #ecf5ff;
+      border-color: #b3d8ff;
+    }
+  }
+  .title {
+    position: absolute;
+    left: 50%;
+    margin: 0;
+    font-size: 18px;
+    font-weight: bold;
+    color: #333333;
+    transform: translateX(-50%);
+  }
+}
+
 // 在组件样式中添加
 .date-range {
   display: block; // 确保换行生效

+ 233 - 0
src/views/financialManagement/todayIncomeList.vue

@@ -0,0 +1,233 @@
+<template>
+  <div class="todayIncomeList">
+    <!-- 头部 -->
+    <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 }} </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 class="orderInfo">订单信息</h3>
+        <div>
+          <div class="couponRow">下单时间:{{ unposted.orderTime }}</div>
+          <div class="couponRow">验券时间:{{ unposted.checkTime }}</div>
+          <div class="couponRow">入账时间:</div>
+        </div>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script setup lang="tsx" name="voucherManagement">
+import { computed, onActivated, onMounted, reactive, ref, watch } from "vue";
+import { useRouter } from "vue-router";
+import type { FormInstance, FormRules } from "element-plus";
+import { ElMessage } from "element-plus";
+import ProTable from "@/components/ProTable/index.vue";
+import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
+import { getPaymentCycle } from "@/api/modules/homeEntry";
+import { ElMessageBox } from "element-plus/es";
+import { localGet } from "@/utils";
+const router = useRouter();
+const dialogVisible = ref(true);
+const unposted = ref<any>({});
+const toDetail = (row: any) => {
+  dialogVisible.value = true;
+  unposted.value = row;
+};
+// 返回
+const goBack = () => {
+  router.back();
+};
+// ProTable 实例(需要在使用它的地方之前定义)
+const proTable = ref<ProTableInstance>();
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  {
+    prop: "couponName",
+    label: "商品名称"
+  },
+  {
+    prop: "price",
+    label: "券码",
+    render: (scope: any) => {
+      return scope.row.price ? `¥${scope.row.price}` : "--";
+    }
+  },
+  {
+    prop: "createdTime",
+    label: "实际收益",
+    render: scope => {
+      return scope.row.saleNum === null || !scope.row.saleNum ? "--" : scope.row.saleNum;
+    }
+  },
+  {
+    prop: "createdTime",
+    label: "售价",
+    render: scope => {
+      return scope.row.saleNum === null || !scope.row.saleNum ? "--" : scope.row.saleNum;
+    }
+  },
+  {
+    prop: "createdTime",
+    label: "技术服务费",
+    render: scope => {
+      return scope.row.saleNum === null || !scope.row.saleNum ? "--" : scope.row.saleNum;
+    }
+  },
+  { prop: "operation", label: "操作", fixed: "right", width: 330 }
+]);
+
+// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
+const initParam = reactive({
+  storeId: localGet("createdId"),
+  incomeType: 0,
+  paymentType: 0,
+  startTime: null,
+  endTime: null
+});
+// 页面加载时触发查询
+onMounted(async () => {
+  proTable.value?.getTableList();
+});
+
+// 从其他页面返回时触发查询
+onActivated(() => {
+  proTable.value?.getTableList();
+});
+
+// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
+// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
+const dataCallback = (data: any) => {
+  return {
+    list: data.data?.records || data.records || [],
+    total: data.data?.total || data.total || 0
+  };
+};
+
+// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
+// 默认不做操作就直接在 ProTable 组件上绑定	:requestApi="getUserList"
+const getTableList = (params: any) => {
+  let newParams = JSON.parse(JSON.stringify(params));
+  return getPaymentCycle(newParams);
+};
+</script>
+
+<style lang="scss" scoped>
+.todayIncomeList {
+  height: 100%;
+  border: 1px solid red;
+}
+.header {
+  position: relative;
+  display: flex;
+  align-items: center;
+  padding: 20px;
+  background: #ffffff;
+  border-bottom: 1px solid #e4e7ed;
+  .back-btn {
+    padding: 8px 16px;
+    font-size: 14px;
+    color: #606266;
+    background-color: #f5f7fa;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    &:hover {
+      color: #409eff;
+      background-color: #ecf5ff;
+      border-color: #b3d8ff;
+    }
+  }
+  .title {
+    position: absolute;
+    left: 50%;
+    margin: 0;
+    font-size: 18px;
+    font-weight: bold;
+    color: #333333;
+    transform: translateX(-50%);
+  }
+}
+
+// 在组件样式中添加
+.date-range {
+  display: block; // 确保换行生效
+  padding: 0 8px; // 可选:增加内边距
+  word-wrap: break-word; // 长单词内换行
+  white-space: normal; // 允许自然换行
+}
+.table-header-btn {
+  .button {
+    margin-bottom: 10px;
+  }
+  .tabs {
+    :deep(.el-tabs__nav-wrap::after) {
+      height: 0;
+    }
+  }
+}
+.orderInfo {
+  padding-bottom: 20px;
+  font-size: 18px;
+  font-weight: bold;
+}
+.couponRow {
+  padding-bottom: 20px;
+}
+.couponRow:last-child {
+  padding-bottom: 0;
+}
+.reject-reason-content {
+  padding: 20px 0;
+  .reject-reason-item {
+    display: flex;
+    margin-bottom: 20px;
+    &:last-child {
+      margin-bottom: 0;
+    }
+    .reject-reason-label {
+      flex-shrink: 0;
+      min-width: 100px;
+      font-size: 14px;
+      font-weight: 500;
+      color: #606266;
+    }
+    .reject-reason-value {
+      flex: 1;
+      font-size: 14px;
+      color: #303133;
+      word-break: break-word;
+      &.reject-reason-text {
+        min-height: 80px;
+        padding: 12px;
+        line-height: 1.6;
+        white-space: pre-wrap;
+        background-color: #f5f7fa;
+        border-radius: 4px;
+      }
+    }
+  }
+}
+</style>

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

@@ -1,4 +1,9 @@
 <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"
@@ -42,6 +47,7 @@ import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
 import { getPaymentCycle } from "@/api/modules/homeEntry";
 import { ElMessageBox } from "element-plus/es";
 import { localGet } from "@/utils";
+const router = useRouter();
 const dialogVisible = ref(false);
 const unposted = ref<any>({});
 const toDetail = (row: any) => {
@@ -50,6 +56,10 @@ const toDetail = (row: any) => {
 };
 // ProTable 实例(需要在使用它的地方之前定义)
 const proTable = ref<ProTableInstance>();
+// 返回
+const goBack = () => {
+  router.back();
+};
 
 // 表格配置项
 const columns = reactive<ColumnProps<any>[]>([
@@ -113,6 +123,37 @@ const getTableList = (params: any) => {
 </script>
 
 <style lang="scss" scoped>
+.header {
+  position: relative;
+  display: flex;
+  align-items: center;
+  padding: 20px;
+  background: #ffffff;
+  border-bottom: 1px solid #e4e7ed;
+  .back-btn {
+    padding: 8px 16px;
+    font-size: 14px;
+    color: #606266;
+    background-color: #f5f7fa;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    &:hover {
+      color: #409eff;
+      background-color: #ecf5ff;
+      border-color: #b3d8ff;
+    }
+  }
+  .title {
+    position: absolute;
+    left: 50%;
+    margin: 0;
+    font-size: 18px;
+    font-weight: bold;
+    color: #333333;
+    transform: translateX(-50%);
+  }
+}
+
 // 在组件样式中添加
 .date-range {
   display: block; // 确保换行生效

+ 0 - 570
src/views/financialManagement/withdrawaRequest.vue

@@ -1,570 +0,0 @@
-<template>
-  <div class="withdrawal-request-page">
-    <!-- 头部 -->
-    <div class="header">
-      <el-button class="back-btn" @click="goBack"> 返回 </el-button>
-      <h2 class="title">提现申请</h2>
-    </div>
-
-    <!-- 内容区域 -->
-    <div class="content">
-      <!-- 可提现金额 -->
-      <div class="section">
-        <div class="section-title">可提现金额</div>
-        <div class="available-amount-box">
-          <div class="available-amount">¥ {{ formatCurrency(availableAmount) }}</div>
-        </div>
-      </div>
-
-      <!-- 提现金额输入 -->
-      <div class="section">
-        <div class="section-title">提现金额</div>
-        <div class="amount-input-wrapper">
-          <el-input
-            v-model="withdrawAmount"
-            placeholder="请输入提现金额"
-            class="amount-input"
-            type="number"
-            @input="handleAmountInput"
-          />
-          <el-button type="primary" link class="withdraw-all-btn" @click="handleWithdrawAll"> 全部提现 </el-button>
-        </div>
-        <div class="min-amount-tip">最低提现金额为0.01元</div>
-      </div>
-
-      <!-- 提现账户 -->
-      <div class="section">
-        <div class="section-title">提现账户</div>
-        <div class="account-list">
-          <div
-            v-for="account in accountList"
-            :key="account.id"
-            class="account-item"
-            :class="{ active: selectedAccountId === account.id }"
-            @click="selectAccount(account.id)"
-          >
-            <div class="account-left">
-              <img :src="account.icon" alt="" class="account-icon" />
-              <div class="account-info">
-                <div class="account-name">
-                  {{ account.name }}
-                </div>
-                <div class="account-number">
-                  {{ account.accountNumber }}
-                </div>
-              </div>
-            </div>
-            <div class="account-right">
-              <div v-if="selectedAccountId === account.id" class="selected-indicator" />
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-
-    <!-- 底部按钮 -->
-    <div class="footer">
-      <el-button class="cancel-btn" @click="goBack"> 取消 </el-button>
-      <el-button type="primary" class="submit-btn" @click="handleSubmit"> 提交申请 </el-button>
-    </div>
-
-    <!-- 确认对话框 -->
-    <el-dialog
-      v-model="confirmDialogVisible"
-      title="提现金额域账户确认"
-      width="500px"
-      :close-on-click-modal="false"
-      class="confirm-dialog"
-    >
-      <div class="confirm-content">
-        <div class="confirm-item">
-          <span class="confirm-label">提现金额:</span>
-          <span class="confirm-value">¥ {{ withdrawAmount || "0" }}</span>
-        </div>
-        <div class="confirm-item">
-          <span class="confirm-label">提现账户:</span>
-          <span class="confirm-value">{{ selectedAccount?.name }}账户 ({{ selectedAccount?.accountNumber }})</span>
-        </div>
-        <div class="password-section">
-          <div class="password-label">请输入提现密码</div>
-          <el-input
-            v-model="withdrawPassword"
-            type="password"
-            placeholder="请输入6位提现密码"
-            maxlength="6"
-            show-password
-            class="password-input"
-            @input="handlePasswordInput"
-          />
-        </div>
-      </div>
-      <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>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { ref, computed, onMounted } from "vue";
-import { useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-import { getAccountBalance } from "@/api/modules/homeEntry";
-import { localGet } from "@/utils";
-import zfbIcon from "@/assets/financial/zfb-icon.png";
-
-const router = useRouter();
-
-// 可提现金额
-const availableAmount = ref<number>(586);
-
-// 提现金额
-const withdrawAmount = ref<string>("");
-
-// 账户列表
-const accountList = ref([
-  {
-    id: 1,
-    name: "支付宝",
-    accountNumber: "130****1234",
-    icon: zfbIcon
-  }
-]);
-
-// 选中的账户ID
-const selectedAccountId = ref<number>(1);
-
-// 确认对话框
-const confirmDialogVisible = ref<boolean>(false);
-const withdrawPassword = ref<string>("");
-const submitLoading = ref<boolean>(false);
-
-// 获取选中的账户
-const selectedAccount = computed(() => {
-  return accountList.value.find(account => account.id === selectedAccountId.value);
-});
-
-// 返回
-const goBack = () => {
-  router.back();
-};
-
-// 格式化金额
-const formatCurrency = (value: number) => {
-  return value.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
-};
-
-// 全部提现
-const handleWithdrawAll = () => {
-  withdrawAmount.value = availableAmount.value.toString();
-};
-
-// 金额输入处理
-const handleAmountInput = (value: string) => {
-  const numValue = parseFloat(value);
-  if (isNaN(numValue) || numValue < 0) {
-    withdrawAmount.value = "";
-    return;
-  }
-  if (numValue > availableAmount.value) {
-    withdrawAmount.value = availableAmount.value.toString();
-    ElMessage.warning("提现金额不能超过可提现金额");
-  }
-};
-
-// 选择账户(已选中的不能取消)
-const selectAccount = (id: number) => {
-  // 如果点击的是已选中的账户,不执行任何操作(不可取消)
-  if (selectedAccountId.value === id) {
-    return;
-  }
-  selectedAccountId.value = id;
-};
-
-// 提交申请
-const handleSubmit = () => {
-  const amount = parseFloat(withdrawAmount.value);
-
-  // 验证提现金额
-  if (!withdrawAmount.value || isNaN(amount) || amount <= 0) {
-    ElMessage.warning("请输入提现金额");
-    return;
-  }
-
-  if (amount < 0.01) {
-    ElMessage.warning("最低提现金额为0.01元");
-    return;
-  }
-
-  if (amount > availableAmount.value) {
-    ElMessage.warning("提现金额不能超过可提现金额");
-    return;
-  }
-
-  // 验证账户
-  if (!selectedAccountId.value) {
-    ElMessage.warning("请选择提现账户");
-    return;
-  }
-
-  // 打开确认对话框
-  confirmDialogVisible.value = true;
-  withdrawPassword.value = "";
-};
-
-// 密码输入处理(只允许数字)
-const handlePasswordInput = (value: string) => {
-  withdrawPassword.value = value.replace(/\D/g, "");
-};
-
-// 取消确认
-const handleCancelConfirm = () => {
-  confirmDialogVisible.value = false;
-  withdrawPassword.value = "";
-};
-
-// 确认提交
-const handleConfirmSubmit = async () => {
-  // 验证密码
-  if (!withdrawPassword.value) {
-    ElMessage.warning("请输入提现密码");
-    return;
-  }
-
-  if (withdrawPassword.value.length !== 6) {
-    ElMessage.warning("请输入6位提现密码");
-    return;
-  }
-
-  if (!/^\d{6}$/.test(withdrawPassword.value)) {
-    ElMessage.warning("提现密码必须为6位数字");
-    return;
-  }
-
-  submitLoading.value = true;
-  try {
-    // TODO: 调用提现API
-    // const params = {
-    //   amount: parseFloat(withdrawAmount.value),
-    //   accountId: selectedAccountId.value,
-    //   password: withdrawPassword.value
-    // };
-    // const res = await submitWithdrawal(params);
-
-    // 模拟API调用
-    await new Promise(resolve => setTimeout(resolve, 1500));
-
-    ElMessage.success("提现申请提交成功");
-    confirmDialogVisible.value = false;
-    withdrawPassword.value = "";
-
-    // 提交成功后返回上一页
-    setTimeout(() => {
-      goBack();
-    }, 1500);
-  } catch (error: any) {
-    ElMessage.error(error.message || "提现申请提交失败,请重试");
-  } finally {
-    submitLoading.value = false;
-  }
-};
-
-// 获取可提现金额
-const fetchAccountBalance = async () => {
-  try {
-    const userInfo = localGet("geeker-user")?.userInfo || {};
-    let param = {
-      storeId: userInfo.storeId || localGet("createdId")
-    };
-    const res: any = await getAccountBalance(param as any);
-    if (res.code == 200 && res.data) {
-      availableAmount.value = res.data.balance || res.data.availableAmount || res.data.amount || 586;
-    }
-  } catch (error) {
-    console.error("获取可提现金额失败:", error);
-  }
-};
-
-onMounted(() => {
-  fetchAccountBalance();
-});
-</script>
-
-<style scoped lang="scss">
-.withdrawal-request-page {
-  display: flex;
-  flex-direction: column;
-  width: 100%;
-  min-height: 100vh;
-  background-color: #ffffff;
-}
-.header {
-  position: relative;
-  display: flex;
-  align-items: center;
-  padding: 20px;
-  border-bottom: 1px solid #e4e7ed;
-  .back-btn {
-    padding: 8px 16px;
-    font-size: 14px;
-    color: #606266;
-    border: 1px solid #dcdfe6;
-    border-radius: 4px;
-    &:hover {
-      color: #409eff;
-      background-color: #ecf5ff;
-      border-color: #b3d8ff;
-    }
-  }
-  .title {
-    position: absolute;
-    left: 50%;
-    margin: 0;
-    font-size: 18px;
-    font-weight: bold;
-    color: #333333;
-    transform: translateX(-50%);
-  }
-}
-.content {
-  display: flex;
-  flex: 1;
-  flex-direction: column;
-  gap: 32px;
-  padding: 24px 20px;
-}
-.section {
-  display: flex;
-  flex-direction: column;
-  gap: 12px;
-  .section-title {
-    font-size: 16px;
-    font-weight: 500;
-    color: #333333;
-  }
-}
-.available-amount-box {
-  padding: 20px;
-  margin-top: 8px;
-  background-color: #ffffff;
-  border: 1px solid #e4e7ed;
-  border-radius: 4px;
-  .available-amount {
-    font-size: 36px;
-    font-weight: 600;
-    color: #333333;
-  }
-}
-.amount-input-wrapper {
-  display: flex;
-  gap: 12px;
-  align-items: center;
-  margin-top: 8px;
-  .amount-input {
-    flex: 1;
-    :deep(.el-input__wrapper) {
-      padding: 12px 16px;
-      border-radius: 4px;
-    }
-  }
-  .withdraw-all-btn {
-    padding: 0;
-    font-size: 14px;
-    color: #409eff;
-    white-space: nowrap;
-    background: transparent;
-    border: none;
-    &:hover {
-      color: #66b1ff;
-    }
-  }
-}
-.min-amount-tip {
-  margin-top: 4px;
-  font-size: 12px;
-  color: #909399;
-}
-.account-list {
-  display: flex;
-  flex-direction: column;
-  gap: 12px;
-  margin-top: 8px;
-}
-.account-item {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  padding: 16px;
-  cursor: pointer;
-  background-color: #ffffff;
-  border: 1px solid #e4e7ed;
-  border-radius: 4px;
-  transition: all 0.3s;
-  &:hover {
-    border-color: #409eff;
-  }
-  &.active {
-    background-color: #f5f7fa;
-    border-color: #409eff;
-  }
-  .account-left {
-    display: flex;
-    flex: 1;
-    gap: 12px;
-    align-items: center;
-    .account-icon {
-      width: 40px;
-      height: 40px;
-      object-fit: contain;
-    }
-    .account-info {
-      display: flex;
-      flex-direction: column;
-      gap: 4px;
-      .account-name {
-        font-size: 16px;
-        font-weight: 500;
-        color: #333333;
-      }
-      .account-number {
-        font-size: 14px;
-        color: #909399;
-      }
-    }
-  }
-  .account-right {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    width: 24px;
-    height: 24px;
-    .selected-indicator {
-      width: 16px;
-      height: 16px;
-      background-color: #409eff;
-      border: 3px solid #ffffff;
-      border-radius: 50%;
-      box-shadow: 0 0 0 2px #409eff;
-    }
-  }
-}
-.footer {
-  display: flex;
-  gap: 12px;
-  justify-content: center;
-  padding: 20px;
-  background-color: #ffffff;
-  border-top: 1px solid #e4e7ed;
-  .cancel-btn {
-    width: 100px;
-    padding: 12px;
-    font-size: 16px;
-    color: #606266;
-    background-color: #f5f7fa;
-    border: 1px solid #dcdfe6;
-    border-radius: 4px;
-    &:hover {
-      color: #409eff;
-      background-color: #ecf5ff;
-      border-color: #b3d8ff;
-    }
-  }
-  .submit-btn {
-    width: 100px;
-    padding: 12px;
-    font-size: 16px;
-    color: #ffffff;
-    background-color: #409eff;
-    border: none;
-    border-radius: 4px;
-    &:hover {
-      background-color: #66b1ff;
-    }
-  }
-}
-:deep(.confirm-dialog) {
-  .el-dialog__header {
-    padding: 20px 24px;
-    border-bottom: 1px solid #e4e7ed;
-  }
-  .el-dialog__title {
-    font-size: 18px;
-    font-weight: 600;
-    color: #333333;
-  }
-  .el-dialog__body {
-    padding: 24px;
-  }
-}
-.confirm-content {
-  display: flex;
-  flex-direction: column;
-  gap: 20px;
-  .confirm-item {
-    display: flex;
-    gap: 12px;
-    align-items: center;
-    font-size: 14px;
-    .confirm-label {
-      min-width: 80px;
-      font-weight: 500;
-      color: #606266;
-    }
-    .confirm-value {
-      font-weight: 500;
-      color: #333333;
-    }
-  }
-  .password-section {
-    display: flex;
-    flex-direction: column;
-    gap: 12px;
-    margin-top: 8px;
-    .password-label {
-      font-size: 14px;
-      font-weight: 500;
-      color: #606266;
-    }
-    .password-input {
-      :deep(.el-input__wrapper) {
-        padding: 12px 16px;
-        border-radius: 4px;
-      }
-    }
-  }
-}
-.dialog-footer {
-  display: flex;
-  gap: 12px;
-  justify-content: flex-end;
-  .dialog-cancel-btn {
-    padding: 10px 20px;
-    font-size: 14px;
-    color: #606266;
-    background-color: #f5f7fa;
-    border: 1px solid #dcdfe6;
-    border-radius: 4px;
-    &:hover {
-      color: #409eff;
-      background-color: #ecf5ff;
-      border-color: #b3d8ff;
-    }
-  }
-  .dialog-confirm-btn {
-    padding: 10px 20px;
-    font-size: 14px;
-    color: #ffffff;
-    background-color: #409eff;
-    border: none;
-    border-radius: 4px;
-    &:hover {
-      background-color: #66b1ff;
-    }
-  }
-}
-</style>

+ 33 - 3
src/views/home/components/go-flow.vue

@@ -210,9 +210,9 @@ import {
 } from "element-plus";
 import { Plus } from "@element-plus/icons-vue";
 
-import { verifyIdInfo, applyStore } from "@/api/modules/homeEntry";
+import { verifyIdInfo, applyStore, getMerchantByPhone } from "@/api/modules/homeEntry";
 import { getBusinessSection, getBusinessSectionTypes, getInputPrompt, getDistrict, uploadImg } from "@/api/modules/newLoginApi";
-import { localGet } from "@/utils/index";
+import { localGet, localSet } from "@/utils/index";
 const userInfo = localGet("geeker-user")?.userInfo || {};
 const latShow = ref(false);
 onMounted(() => {
@@ -327,7 +327,7 @@ const step2Form = reactive({
   administrativeRegionDistrictAdcode: "", //区
   storeAddress: "", //门店地址(完整地址)
   storeBlurb: "", //门店简介
-  businessSection: "", //经营板块
+  businessSection: "1", //经营板块
   businessSectionName: "KTV",
   businessTypes: [], //经营种类
   businessTypesList: [], //经营种类集合
@@ -503,6 +503,36 @@ const handleNextStep = async () => {
       if (res && res.code == 200) {
         ElMessage.success(res.msg);
 
+        // 更新本地存储中的idCard
+        try {
+          const geekerUser = localGet("geeker-user");
+          if (geekerUser && geekerUser.userInfo) {
+            // 获取最新的用户信息
+            const phone = geekerUser.userInfo.phone;
+            if (phone) {
+              const userRes: any = await getMerchantByPhone({ phone });
+              if (userRes && userRes.code == 200 && userRes.data) {
+                // 更新本地存储中的用户信息,特别是idCard
+                geekerUser.userInfo.idCard = userRes.data.idCard || step1Form.idNumber;
+                geekerUser.userInfo.name = userRes.data.name || step1Form.name;
+                localSet("geeker-user", geekerUser);
+              } else {
+                // 如果获取失败,至少更新idCard字段
+                geekerUser.userInfo.idCard = step1Form.idNumber;
+                geekerUser.userInfo.name = step1Form.name;
+                localSet("geeker-user", geekerUser);
+              }
+            } else {
+              // 如果没有phone,直接更新idCard
+              geekerUser.userInfo.idCard = step1Form.idNumber;
+              geekerUser.userInfo.name = step1Form.name;
+              localSet("geeker-user", geekerUser);
+            }
+          }
+        } catch (error) {
+          console.error("更新本地存储失败:", error);
+        }
+
         setStep(2);
       }
     } else {

+ 22 - 17
src/views/home/index.vue

@@ -3,10 +3,10 @@
     <!--已入驻-->
     <go-examine v-if="isExaime" />
     <!-- 第一步  未入驻 -->
-    <go-enter :current-step="currentStep" @update:current-step="handleUpdateCurrentStep" v-if="isEntry" />
-
+    <go-enter :current-step="currentStep" @update:current-step="handleUpdateCurrentStep" v-if="isEntry && currentStep === 0" />
     <!-- 第二步 -->
     <go-flow
+      v-if="isEntry && currentStep > 0"
       :current-step="currentStep"
       @update:current-step="handleUpdateCurrentStep"
       @update:get-user-info="getUserInfo"
@@ -22,6 +22,7 @@ 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";
 const isEntry = ref<boolean>(false);
 const isExaime = ref<boolean>(false);
 
@@ -49,21 +50,25 @@ const getUserInfo = async () => {
     };
     const res: any = await getMerchantByPhone(param);
     storeId.value = res.data.storeId;
-    if (res && res.code == 200 && res.data && res.data.storeId) {
-      let param1 = {
-        id: res.data.storeId
-      };
-      const resStore: any = await getDetail(param1);
-      if (resStore && resStore.code == 200 && resStore.data) {
-        storeApplicationStatus.value = resStore.data.storeApplicationStatus;
-        if (storeApplicationStatus.value == 2) {
-          currentStep.value = 3;
-        }
-
-        if (resStore.data.storeApplicationStatus == 2 && res.data.storeId != null) {
-          isEntry.value = true;
-        } else {
-          isExaime.value = true;
+    if (res && res.code == 200 && res.data) {
+      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;
+          if (storeApplicationStatus.value == 2) {
+            currentStep.value = 3;
+          }
+          if (resStore.data.storeApplicationStatus == 2 && res.data.storeId != null) {
+            isEntry.value = true;
+          } else {
+            isExaime.value = true;
+          }
         }
       }
     }