|
@@ -1,5 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="container">
|
|
<div class="container">
|
|
|
|
+ <!-- Add Toast component -->
|
|
|
|
+ <Toast ref="toast" />
|
|
<!-- 导航栏 -->
|
|
<!-- 导航栏 -->
|
|
<div class="nav-bar">
|
|
<div class="nav-bar">
|
|
<div class="back-btn" @click="$router.back()">
|
|
<div class="back-btn" @click="$router.back()">
|
|
@@ -9,95 +11,67 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="main">
|
|
<div class="main">
|
|
- <div class="income-card funs">
|
|
|
|
- <div class="u-field u-border-bottom">
|
|
|
|
- <div class="u-field-inner u-label-postion-left">
|
|
|
|
- <div class="u-label">
|
|
|
|
- <span class="u-label-text">开户银行</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="fild-body">
|
|
|
|
- <div class="u-flex-1 u-flex">
|
|
|
|
- <input
|
|
|
|
- type="text"
|
|
|
|
- class="u-field__input-wrap"
|
|
|
|
- placeholder="输入银行名称"
|
|
|
|
- v-model="formData.banktype"
|
|
|
|
- :disabled="!!bankInfo.status"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!-- 顶部提示文字 -->
|
|
|
|
+ <div class="header-text">
|
|
|
|
+ <div class="sub-text">绑定银行卡</div>
|
|
|
|
+ <div class="sub-text">为了保证您的账户资金安全</div>
|
|
|
|
+ <div class="sub-text">请先完成银行卡绑定</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="income-card funs">
|
|
|
|
- <div class="u-field u-border-bottom">
|
|
|
|
- <div class="u-field-inner u-label-postion-left">
|
|
|
|
- <div class="u-label">
|
|
|
|
- <span class="u-label-text">开户地址</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="fild-body">
|
|
|
|
- <div class="u-flex-1 u-flex">
|
|
|
|
- <input
|
|
|
|
- type="text"
|
|
|
|
- class="u-field__input-wrap"
|
|
|
|
- placeholder="输入银行开户地址"
|
|
|
|
- v-model="formData.address"
|
|
|
|
- :disabled="!!bankInfo.status"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="form-container">
|
|
|
|
+ <div class="form-item">
|
|
|
|
+ <div class="form-label">姓名</div>
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ class="form-input"
|
|
|
|
+ placeholder="输入姓名"
|
|
|
|
+ v-model="formData.lastname"
|
|
|
|
+ :disabled="!!bankInfo.status"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
|
|
- <div class="income-card funs">
|
|
|
|
- <div class="u-field u-border-bottom">
|
|
|
|
- <div class="u-field-inner u-label-postion-left">
|
|
|
|
- <div class="u-label">
|
|
|
|
- <span class="u-label-text">卡号姓名</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="fild-body">
|
|
|
|
- <div class="u-flex-1 u-flex">
|
|
|
|
- <input
|
|
|
|
- type="text"
|
|
|
|
- class="u-field__input-wrap"
|
|
|
|
- placeholder="输入银行卡绑定姓名"
|
|
|
|
- v-model="formData.lastname"
|
|
|
|
- :disabled="!!bankInfo.status"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
+ <div class="form-label">银行名称</div>
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ class="form-input"
|
|
|
|
+ placeholder="输入银行名称"
|
|
|
|
+ v-model="formData.banktype"
|
|
|
|
+ :disabled="!!bankInfo.status"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
|
|
- <div class="income-card funs">
|
|
|
|
- <div class="u-field u-border-bottom">
|
|
|
|
- <div class="u-field-inner u-label-postion-left">
|
|
|
|
- <div class="u-label">
|
|
|
|
- <span class="u-label-text">银行账号</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="fild-body">
|
|
|
|
- <div class="u-flex-1 u-flex">
|
|
|
|
- <input
|
|
|
|
- type="text"
|
|
|
|
- class="u-field__input-wrap"
|
|
|
|
- placeholder="输入银行卡账号"
|
|
|
|
- v-model="formData.banknum"
|
|
|
|
- :disabled="!!bankInfo.status"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
+ <div class="form-label">开户行</div>
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ class="form-input"
|
|
|
|
+ placeholder="输入银行卡开户行"
|
|
|
|
+ v-model="formData.address"
|
|
|
|
+ :disabled="!!bankInfo.status"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="form-item">
|
|
|
|
+ <div class="form-label">银行卡号</div>
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ class="form-input"
|
|
|
|
+ placeholder="输入银行卡号"
|
|
|
|
+ v-model="formData.banknum"
|
|
|
|
+ :disabled="!!bankInfo.status"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
|
|
- <div
|
|
|
|
- class="mt30 h40 lh40 tc white bgBlue radius28 ft14 w90 mauto"
|
|
|
|
- @click="handleSubmit"
|
|
|
|
- >
|
|
|
|
- {{ bankInfo.status ? '已绑定' : '确认绑定' }}
|
|
|
|
|
|
+ <div style="display: flex;justify-content: center;align-items: center;">
|
|
|
|
+ <button
|
|
|
|
+ class="submit-btn"
|
|
|
|
+ @click="handleSubmit"
|
|
|
|
+ :disabled="!!bankInfo.status"
|
|
|
|
+ >
|
|
|
|
+ {{ bankInfo.status ? '已绑定' : '立即绑定' }}
|
|
|
|
+ </button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -105,9 +79,13 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { getBankInfo } from '@/api/profile';
|
|
import { getBankInfo } from '@/api/profile';
|
|
|
|
+import Toast from '@/components/Toast.vue';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'BankCard',
|
|
name: 'BankCard',
|
|
|
|
+ components: {
|
|
|
|
+ Toast
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
bankInfo: {},
|
|
bankInfo: {},
|
|
@@ -126,16 +104,25 @@ export default {
|
|
async getBankInfo() {
|
|
async getBankInfo() {
|
|
try {
|
|
try {
|
|
const res = await getBankInfo();
|
|
const res = await getBankInfo();
|
|
- this.bankInfo = res.data;
|
|
|
|
- if (this.bankInfo.status) {
|
|
|
|
- this.formData = {
|
|
|
|
- banktype: this.bankInfo.banktype,
|
|
|
|
- address: this.bankInfo.address,
|
|
|
|
- lastname: this.bankInfo.lastname,
|
|
|
|
- banknum: this.bankInfo.banknum
|
|
|
|
|
|
+ if (res && res.data) {
|
|
|
|
+ this.bankInfo = res.data;
|
|
|
|
+ if (this.bankInfo && this.bankInfo.status) {
|
|
|
|
+ this.formData = {
|
|
|
|
+ banktype: this.bankInfo.banktype || '',
|
|
|
|
+ address: this.bankInfo.address || '',
|
|
|
|
+ lastname: this.bankInfo.lastname || '',
|
|
|
|
+ banknum: this.bankInfo.banknum || ''
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.bankInfo = {
|
|
|
|
+ status: false
|
|
};
|
|
};
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
+ this.bankInfo = {
|
|
|
|
+ status: false
|
|
|
|
+ };
|
|
console.error('获取银行卡信息失败:', error);
|
|
console.error('获取银行卡信息失败:', error);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -143,23 +130,23 @@ export default {
|
|
if (this.bankInfo.status) return;
|
|
if (this.bankInfo.status) return;
|
|
|
|
|
|
if (!this.formData.banktype) {
|
|
if (!this.formData.banktype) {
|
|
- alert('请输入开户银行');
|
|
|
|
|
|
+ this.$refs.toast.show('请输入开户银行', 'warning');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (!this.formData.address) {
|
|
if (!this.formData.address) {
|
|
- alert('请输入开户地址');
|
|
|
|
|
|
+ this.$refs.toast.show('请输入开户地址', 'warning');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (!this.formData.lastname) {
|
|
if (!this.formData.lastname) {
|
|
- alert('请输入卡号姓名');
|
|
|
|
|
|
+ this.$refs.toast.show('请输入卡号姓名', 'warning');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (!this.formData.banknum) {
|
|
if (!this.formData.banknum) {
|
|
- alert('请输入银行账号');
|
|
|
|
|
|
+ this.$refs.toast.show('请输入银行账号', 'warning');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// TODO: 实现银行卡绑定逻辑
|
|
// TODO: 实现银行卡绑定逻辑
|
|
- alert('银行卡绑定成功');
|
|
|
|
|
|
+ this.$refs.toast.show('银行卡绑定成功', 'success');
|
|
await this.getBankInfo();
|
|
await this.getBankInfo();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -169,12 +156,14 @@ export default {
|
|
<style scoped>
|
|
<style scoped>
|
|
.container {
|
|
.container {
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|
|
- background: #f5f5f5;
|
|
|
|
|
|
+ background: url('../assets/dabag.png') no-repeat;
|
|
|
|
+ background-size: cover;
|
|
|
|
+ background-position: center;
|
|
}
|
|
}
|
|
|
|
|
|
.nav-bar {
|
|
.nav-bar {
|
|
height: 44px;
|
|
height: 44px;
|
|
- background-color: #ed4b39;
|
|
|
|
|
|
+ background-color: transparent;
|
|
color: #fff;
|
|
color: #fff;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -206,93 +195,82 @@ export default {
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
|
|
|
|
-.main {
|
|
|
|
- padding: 15px;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.income-card {
|
|
|
|
- background: #fff;
|
|
|
|
- border-radius: 8px;
|
|
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
+.header-text {
|
|
|
|
+ padding: 40px 20px;
|
|
|
|
+ color: #fff;
|
|
}
|
|
}
|
|
|
|
|
|
-.u-field {
|
|
|
|
- padding: 10px 15px;
|
|
|
|
|
|
+.title-text {
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin-bottom: 15px;
|
|
}
|
|
}
|
|
|
|
|
|
-.u-field-inner {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.u-label {
|
|
|
|
- flex: 0 0 65px;
|
|
|
|
|
|
+.sub-text {
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
- color: #333;
|
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
|
|
|
|
-.fild-body {
|
|
|
|
- flex: 1;
|
|
|
|
|
|
+.form-container {
|
|
|
|
+ background: #fff;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ margin: 0 20px;
|
|
|
|
+ padding: 20px;
|
|
}
|
|
}
|
|
|
|
|
|
-.u-flex-1 {
|
|
|
|
- flex: 1;
|
|
|
|
|
|
+.form-item {
|
|
|
|
+ /* margin-bottom: 20px; */
|
|
}
|
|
}
|
|
|
|
|
|
-.u-flex {
|
|
|
|
- display: flex;
|
|
|
|
|
|
+.form-label {
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: #333;
|
|
|
|
+ margin-bottom: 8px;
|
|
}
|
|
}
|
|
|
|
|
|
-.u-field__input-wrap {
|
|
|
|
|
|
+.form-input {
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 24px;
|
|
|
|
- line-height: 24px;
|
|
|
|
|
|
+ height: 44px;
|
|
border: none;
|
|
border: none;
|
|
- outline: none;
|
|
|
|
|
|
+ background: #fff;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
|
+ padding: 0;
|
|
color: #333;
|
|
color: #333;
|
|
- background: transparent;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-.u-field__input-wrap::placeholder {
|
|
|
|
|
|
+.form-input::placeholder {
|
|
color: #999;
|
|
color: #999;
|
|
}
|
|
}
|
|
|
|
|
|
-.u-field__input-wrap:disabled {
|
|
|
|
- color: #666;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.u-border-bottom {
|
|
|
|
- position: relative;
|
|
|
|
|
|
+.form-input:focus {
|
|
|
|
+ outline: none;
|
|
}
|
|
}
|
|
|
|
|
|
-.u-border-bottom::after {
|
|
|
|
- content: '';
|
|
|
|
- position: absolute;
|
|
|
|
- left: 0;
|
|
|
|
- bottom: 0;
|
|
|
|
- width: 100%;
|
|
|
|
- height: 1px;
|
|
|
|
- background: rgba(85, 89, 105, 0.12);
|
|
|
|
- transform: scaleY(0.5);
|
|
|
|
|
|
+.form-input:disabled {
|
|
|
|
+ color: #666;
|
|
|
|
+ background: #f5f5f5;
|
|
}
|
|
}
|
|
|
|
|
|
-.mt30 { margin-top: 30px; }
|
|
|
|
-.h40 { height: 40px; }
|
|
|
|
-.lh40 { line-height: 40px; }
|
|
|
|
-.tc { text-align: center; }
|
|
|
|
-.white { color: #fff; }
|
|
|
|
-.ft14 { font-size: 14px; }
|
|
|
|
-.w90 { width: 90%; }
|
|
|
|
-.mauto { margin: 0 auto; }
|
|
|
|
-.radius28 { border-radius: 28px; }
|
|
|
|
-
|
|
|
|
-.bgBlue {
|
|
|
|
- background: #ed4b39;
|
|
|
|
|
|
+.submit-btn {
|
|
|
|
+ width: 60%;
|
|
|
|
+ height: 44px;
|
|
|
|
+ background: #FF6B6B;
|
|
|
|
+ border-radius: 22px;
|
|
|
|
+ border: none;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ font-weight: 500;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
|
|
-.bgBlue:active {
|
|
|
|
|
|
+.submit-btn:active {
|
|
opacity: 0.9;
|
|
opacity: 0.9;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.submit-btn:disabled {
|
|
|
|
+ background: #ccc;
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|