fix(walletBindBank): 修复绑定银行卡错误的问题 bug-67 bug-68

This commit is contained in:
woody 2025-05-08 13:51:08 +08:00
parent c09af127fa
commit a06830e905
2 changed files with 46 additions and 45 deletions

View File

@ -20,8 +20,8 @@
placeholder="请输入银行卡号" placeholder="请输入银行卡号"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="银行选择:" prop="bankId"> <el-form-item label="银行选择:" prop="pkBank">
<el-select v-model="form.bankId" placeholder="请选择银行名称"> <el-select v-model="form.pkBank" placeholder="请选择银行名称">
<el-option <el-option
v-for="(item, index) in bankCardChioceList" v-for="(item, index) in bankCardChioceList"
:key="index" :key="index"
@ -64,7 +64,7 @@
placeholder="银行卡预留手机号" placeholder="银行卡预留手机号"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <!-- <el-form-item
v-if="isMainlandChinaUser && needsVerificationCode" v-if="isMainlandChinaUser && needsVerificationCode"
label="验证码:" label="验证码:"
prop="verificationCode" prop="verificationCode"
@ -82,7 +82,7 @@
> >
{{ verificationCodeButtonText }} {{ verificationCodeButtonText }}
</el-button> </el-button>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
</div> </div>
<div class="dialog-footer"> <div class="dialog-footer">
@ -127,7 +127,7 @@ export default {
accountName: "", // accountName: "", //
idCard: "", // idCard: "", //
phone: "", // phone: "", //
bankId: "", // ID ( pkBank) pkBank: "", // ID ( pkBank)
verificationCode: "", // verificationCode: "", //
subBankName: "", // subBankName: "", //
idType: "", // idType: "", //
@ -168,7 +168,7 @@ export default {
// { min: 11, message: '', trigger: "blur" }, // validator // { min: 11, message: '', trigger: "blur" }, // validator
{ validator: validatePhoneNumber, trigger: "blur" }, { validator: validatePhoneNumber, trigger: "blur" },
], ],
bankId: [ pkBank: [
// pkBank // pkBank
{ required: true, message: "请选择银行卡", trigger: "change" }, { required: true, message: "请选择银行卡", trigger: "change" },
], ],
@ -176,7 +176,7 @@ export default {
isBankCardVerified: false, // ( ifpass) isBankCardVerified: false, // ( ifpass)
bankCardChioceList: [], // bankCardChioceList: [], //
// pkCountry: "", // isMainlandChinaUser // pkCountry: "", // isMainlandChinaUser
needsVerificationCode: true, // ( cancode) needsVerificationCode: false, // ( cancode)
}; };
}, },
props: { props: {
@ -286,17 +286,17 @@ export default {
// //
performBindBank() { performBindBank() {
// //
if (!this.isMainlandChinaUser || !this.needsVerificationCode) { // if (!this.isMainlandChinaUser || !this.needsVerificationCode) {
this.isBankCardVerified = true; // this.isBankCardVerified = true;
} // }
if (!this.isBankCardVerified) { // if (!this.isBankCardVerified) {
this.$message({ // this.$message({
message: "请先完成银行卡验证", // '' // message: "", // ''
type: "warning", // type: "warning",
}); // });
return; // return;
} // }
// let that = this; // // let that = this; //
@ -328,31 +328,32 @@ export default {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
// //
if (this.isMainlandChinaUser && this.needsVerificationCode) { // if (this.isMainlandChinaUser && this.needsVerificationCode) {
walletApi // walletApi
.verifyBankCard(this.form) // .verifyBankCard(this.form)
.then(() => { // .then(() => {
// // //
this.isBankCardVerified = true; // this.isBankCardVerified = true;
this.performBindBank(); // this.performBindBank();
}) // })
.catch((_err) => { // .catch((_err) => {
// 使 _err 使 // // 使 _err 使
// // //
this.isBankCardVerified = false; // this.isBankCardVerified = false;
// // //
this.$message({ // this.$message({
message: _err?.msg || "银行卡验证失败", // 使 // message: _err?.msg || "", // 使
type: "warning", // type: "warning",
}); // });
// this.countdownSeconds = 0; // clearCountdown // // this.countdownSeconds = 0; // clearCountdown
this.clearCountdown(); // // this.clearCountdown(); //
}); // });
} else { // } else {
// // //
// isBankCardVerified performBindBank true // // isBankCardVerified performBindBank true
this.performBindBank(); // this.performBindBank();
} // }
this.performBindBank();
} else { } else {
console.log("表单验证失败!"); console.log("表单验证失败!");
return false; return false;

View File

@ -24,7 +24,7 @@
<el-empty description="暂无公告" /> <el-empty description="暂无公告" />
</div> </div>
</div> </div>
<InSiteMessage /> <!-- <InSiteMessage /> -->
</div> </div>
</template> </template>
@ -32,11 +32,11 @@
import * as sid from "@/api/sidebaruserinfo.js"; import * as sid from "@/api/sidebaruserinfo.js";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import "swiper/dist/css/swiper.css"; import "swiper/dist/css/swiper.css";
import InSiteMessage from "./in-site-message.vue"; // import InSiteMessage from "./in-site-message.vue";
export default { export default {
name: "sidebarUserInfo", name: "sidebarUserInfo",
components: { components: {
InSiteMessage, // InSiteMessage,
}, },
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),