|
|
@@ -189,26 +189,36 @@
|
|
|
<!--收款账户-->
|
|
|
<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 type="primary" class="auth-button" @click="handleGoZFB" v-if="!userInfo.alipayAccount">
|
|
|
添加支付宝账号
|
|
|
</el-button>
|
|
|
-
|
|
|
- <div class="zfb-wrapper" v-else>
|
|
|
- <div class="zfb-left">
|
|
|
- <el-image :src="zfbIcon" class="zfbIcon" />
|
|
|
- <div>
|
|
|
- <div>支付宝</div>
|
|
|
- <div>{{ userInfo.phone }}</div>
|
|
|
+ <div class="zfb-wrapper" v-if="userInfo.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>
|
|
|
+ </div>
|
|
|
+ <div class="operate">
|
|
|
+ <div @click="getEditZfb">编辑</div>
|
|
|
+ <div @click="getDelZfb">删除</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="operate">
|
|
|
- <div @click="getEditZfb">编辑</div>
|
|
|
- <div @click="getDelZfb">删除</div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="goToCashApply"
|
|
|
+ class="submit-button"
|
|
|
+ style=" position: relative; left: -10%; width: 20%;margin-top: 90px; margin-left: 50%"
|
|
|
+ >
|
|
|
+ 去提现
|
|
|
+ </el-button>
|
|
|
</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">
|
|
|
@@ -284,13 +294,13 @@ 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 userInfo = ref(localGet("geeker-user")?.userInfo || {});
|
|
|
const router = useRouter();
|
|
|
const activeTab = ref("realName");
|
|
|
const dialogVisible = ref(false);
|
|
|
const loading = ref(false);
|
|
|
//实名认证
|
|
|
-const goAuth = ref(!userInfo.idCard);
|
|
|
+const goAuth = ref(!userInfo.value.idCard);
|
|
|
const authFormRef = ref<FormInstance>();
|
|
|
const authForm = reactive({
|
|
|
name: "",
|
|
|
@@ -338,7 +348,7 @@ const handleConfirm = async () => {
|
|
|
if (res && res.code == 200) {
|
|
|
ElMessage.success(res.msg || "实名认证提交成功");
|
|
|
let param = {
|
|
|
- phone: userInfo.phone
|
|
|
+ phone: userInfo.value.phone
|
|
|
};
|
|
|
const res1: any = await getMerchantByPhone(param);
|
|
|
if (res1.code == 200) {
|
|
|
@@ -429,7 +439,7 @@ const handlePasswordOneSubmit = async () => {
|
|
|
try {
|
|
|
const res: any = await setPayPassword({
|
|
|
payPassword: passwordForm.password,
|
|
|
- id: userInfo.id
|
|
|
+ id: userInfo.value.id
|
|
|
});
|
|
|
if (res.code == 200) {
|
|
|
ElMessage.success(res.msg || "提现密码设置成功");
|
|
|
@@ -497,7 +507,7 @@ const getForgetPassword = async () => {
|
|
|
};
|
|
|
// 发送短信验证码
|
|
|
const sendForgotCode = async () => {
|
|
|
- let phoneCode: any = await getPhoneCode({ phone: userInfo.phone, appType: "2", businessType: "6" });
|
|
|
+ let phoneCode: any = await getPhoneCode({ phone: userInfo.value.phone, appType: "2", businessType: "6" });
|
|
|
if (phoneCode.code === 200) {
|
|
|
ElMessage.success("验证码已发送");
|
|
|
// 开始倒计时
|
|
|
@@ -525,7 +535,7 @@ const oldTwoPasswordForm = reactive({
|
|
|
});
|
|
|
|
|
|
const nextStept = async () => {
|
|
|
- if (oldPasswordForm.password === userInfo.payPassword) {
|
|
|
+ if (oldPasswordForm.password === userInfo.value.payPassword) {
|
|
|
currentStep.value = 2;
|
|
|
} else {
|
|
|
ElMessage.error("原密码错误");
|
|
|
@@ -542,7 +552,7 @@ const handlePasswordTwoSubmit = async () => {
|
|
|
try {
|
|
|
const res: any = await setPayPassword({
|
|
|
payPassword: oldTwoPasswordForm.password,
|
|
|
- id: userInfo.id
|
|
|
+ id: userInfo.value.id
|
|
|
});
|
|
|
if (res.code == 200) {
|
|
|
ElMessage.success(res.msg || "提现密码修改成功");
|
|
|
@@ -605,13 +615,14 @@ const handleConfirmZFB = async () => {
|
|
|
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);
|
|
|
+ // 更新响应式的 userInfo
|
|
|
+ userInfo.value.alipayAccount = authForm1.zfbName;
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error("更新本地存储失败:", error);
|
|
|
@@ -636,7 +647,7 @@ const handleConfirmZFB = async () => {
|
|
|
const getEditZfb = async () => {
|
|
|
zfbTitle.value = "编辑支付宝账号";
|
|
|
dialogVisibleZFB.value = true;
|
|
|
- authForm1.zfbName = userInfo.phone;
|
|
|
+ authForm1.zfbName = userInfo.value.alipayAccount || userInfo.value.phone;
|
|
|
};
|
|
|
const getDelZfb = async () => {
|
|
|
ElMessageBox.confirm("确定要删除该账号,删除后无法进行提现操作", "删除账号", {
|
|
|
@@ -660,9 +671,9 @@ const forgotPasswordRules: FormRules = {
|
|
|
// 检查提现密码状态
|
|
|
const checkPasswordStatus = async () => {
|
|
|
try {
|
|
|
- if (userInfo.idCard && userInfo.id) {
|
|
|
+ if (userInfo.value.idCard && userInfo.value.id) {
|
|
|
const param = {
|
|
|
- storeUserId: userInfo.id
|
|
|
+ storeUserId: userInfo.value.id
|
|
|
};
|
|
|
const res: any = await checkPayPassword(param as any);
|
|
|
if (res.code == 200) {
|
|
|
@@ -687,9 +698,9 @@ const checkPasswordStatus = async () => {
|
|
|
const checkWithdrawPassword = async () => {
|
|
|
try {
|
|
|
// 如果已实名认证,检查是否设置了提现密码
|
|
|
- if (userInfo.idCard) {
|
|
|
+ if (userInfo.value.idCard) {
|
|
|
const param = {
|
|
|
- storeUserId: userInfo.id
|
|
|
+ storeUserId: userInfo.value.id
|
|
|
};
|
|
|
const res: any = await checkPayPassword(param as any);
|
|
|
if (res.code == 200) {
|