|
@@ -1,9 +1,11 @@
|
|
<template>
|
|
<template>
|
|
<view class="container">
|
|
<view class="container">
|
|
<view class="navList flex" v-if="!info.id">
|
|
<view class="navList flex" v-if="!info.id">
|
|
- <view v-for="(item, index) in navList" :key="index" class="navItem"
|
|
|
|
- :class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index)">{{ item }}
|
|
|
|
- </view>
|
|
|
|
|
|
+ <template v-for="(item, index) in navList">
|
|
|
|
+ <view class="navItem" v-if="bankInfo[item.type]=='1'"
|
|
|
|
+ :class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index)">{{ item.name }}
|
|
|
|
+ </view>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
<view class="login_text" v-if="tabIndex == 0">
|
|
<view class="login_text" v-if="tabIndex == 0">
|
|
<view class="login_input flex" style="padding-top: 45rpx;">
|
|
<view class="login_input flex" style="padding-top: 45rpx;">
|
|
@@ -67,43 +69,67 @@
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- import { bankInfo,addBank } from '@/api/set.js';
|
|
|
|
- import { upload } from '@/api/order.js';
|
|
|
|
|
|
+ import {
|
|
|
|
+ bankInfo,
|
|
|
|
+ addBank,
|
|
|
|
+ getBank
|
|
|
|
+ } from '@/api/set.js';
|
|
|
|
+ import {
|
|
|
|
+ upload
|
|
|
|
+ } from '@/api/order.js';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
- return{
|
|
|
|
- navList:['银行卡','支付宝','微信'],
|
|
|
|
- tabIndex:0,
|
|
|
|
- info:{
|
|
|
|
- id:'',
|
|
|
|
- bank_real_name:'',
|
|
|
|
- bank_code:'',
|
|
|
|
- bank:'',
|
|
|
|
- bank_name:'',
|
|
|
|
- default:0,
|
|
|
|
- name:'',
|
|
|
|
- phone:'',
|
|
|
|
- qrcode:''
|
|
|
|
|
|
+ return {
|
|
|
|
+ navList: [{
|
|
|
|
+ name: '银行卡',
|
|
|
|
+ show: true,
|
|
|
|
+ type: "sell_bank_open"
|
|
|
|
+ }, {
|
|
|
|
+ name: '支付宝',
|
|
|
|
+ show: true,
|
|
|
|
+ type: "sell_alipay_open"
|
|
|
|
+ }, {
|
|
|
|
+ name: '微信',
|
|
|
|
+ show: true,
|
|
|
|
+ type: "sell_weixin_open"
|
|
|
|
+ }],
|
|
|
|
+ tabIndex: 0,
|
|
|
|
+ info: {
|
|
|
|
+ id: '',
|
|
|
|
+ bank_real_name: '',
|
|
|
|
+ bank_code: '',
|
|
|
|
+ bank: '',
|
|
|
|
+ bank_name: '',
|
|
|
|
+ default: 0,
|
|
|
|
+ name: '',
|
|
|
|
+ phone: '',
|
|
|
|
+ qrcode: ''
|
|
},
|
|
},
|
|
- type:'bank',
|
|
|
|
- loding:false,
|
|
|
|
|
|
+ type: 'bank',
|
|
|
|
+ loding: false,
|
|
|
|
+ bankInfo: {
|
|
|
|
+ sell_alipay_open: "0",
|
|
|
|
+ sell_bank_open: "0",
|
|
|
|
+ sell_weixin_open: "0"
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
- if(option.type){
|
|
|
|
- if(option.type == 'alipay'){
|
|
|
|
|
|
+ if (option.type) {
|
|
|
|
+ if (option.type == 'alipay') {
|
|
this.tabIndex = 1
|
|
this.tabIndex = 1
|
|
- }else if(option.type == 'wx'){
|
|
|
|
|
|
+ } else if (option.type == 'wx') {
|
|
this.tabIndex = 2
|
|
this.tabIndex = 2
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.tabIndex = 0
|
|
this.tabIndex = 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(option.id){
|
|
|
|
|
|
+ if (option.id) {
|
|
this.info.id = option.id
|
|
this.info.id = option.id
|
|
this.type = option.type
|
|
this.type = option.type
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
|
|
+ this.getBank();
|
|
// getMoneyLog({
|
|
// getMoneyLog({
|
|
// page: navItem.page,
|
|
// page: navItem.page,
|
|
// limit: navItem.limit
|
|
// limit: navItem.limit
|
|
@@ -111,84 +137,89 @@
|
|
},
|
|
},
|
|
onShow() {},
|
|
onShow() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getBank() {
|
|
|
|
+ getBank({}).then(res => {
|
|
|
|
+ this.bankInfo = res.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
tabClick(index) {
|
|
tabClick(index) {
|
|
this.tabIndex = index
|
|
this.tabIndex = index
|
|
- if(index == 0){
|
|
|
|
|
|
+ if (index == 0) {
|
|
this.type = 'bank'
|
|
this.type = 'bank'
|
|
- }else if(index == 1){
|
|
|
|
|
|
+ } else if (index == 1) {
|
|
this.type = 'alipay'
|
|
this.type = 'alipay'
|
|
this.info.name = ''
|
|
this.info.name = ''
|
|
this.info.phone = ''
|
|
this.info.phone = ''
|
|
this.info.qrcode = ''
|
|
this.info.qrcode = ''
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.type = 'wx'
|
|
this.type = 'wx'
|
|
this.info.name = ''
|
|
this.info.name = ''
|
|
this.info.phone = ''
|
|
this.info.phone = ''
|
|
this.info.qrcode = ''
|
|
this.info.qrcode = ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getList(){
|
|
|
|
|
|
+ getList() {
|
|
let obj = this
|
|
let obj = this
|
|
bankInfo({
|
|
bankInfo({
|
|
- id:obj.info.id
|
|
|
|
|
|
+ id: obj.info.id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
obj.info = res.data.info
|
|
obj.info = res.data.info
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- submission(){
|
|
|
|
|
|
+ submission() {
|
|
let obj = this
|
|
let obj = this
|
|
- if(obj.tabIndex == 0){
|
|
|
|
- if(!obj.info.bank_real_name){
|
|
|
|
|
|
+ if (obj.tabIndex == 0) {
|
|
|
|
+ if (!obj.info.bank_real_name) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入真实姓名',
|
|
title: '请输入真实姓名',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!obj.info.bank){
|
|
|
|
|
|
+ if (!obj.info.bank) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入银行',
|
|
title: '请输入银行',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!obj.info.bank_code){
|
|
|
|
|
|
+ if (!obj.info.bank_code) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入银行卡号',
|
|
title: '请输入银行卡号',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(obj.info.bank_code.length < 16){
|
|
|
|
|
|
+ if (obj.info.bank_code.length < 16) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入正确的银行卡号',
|
|
title: '请输入正确的银行卡号',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!obj.info.bank_name){
|
|
|
|
|
|
+ if (!obj.info.bank_name) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入开户行',
|
|
title: '请输入开户行',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
- if(!obj.info.name){
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (!obj.info.name) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入姓名',
|
|
title: '请输入姓名',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!obj.info.phone&&obj.tabIndex == 1){
|
|
|
|
|
|
+ if (!obj.info.phone && obj.tabIndex == 1) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入账号',
|
|
title: '请输入账号',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!obj.info.qrcode){
|
|
|
|
|
|
+ if (!obj.info.qrcode) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请输入收款码',
|
|
title: '请输入收款码',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -197,32 +228,32 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let data = ''
|
|
let data = ''
|
|
- if(obj.info.id){
|
|
|
|
|
|
+ if (obj.info.id) {
|
|
data = {
|
|
data = {
|
|
- id:0,
|
|
|
|
- bank:obj.info.bank,//银行
|
|
|
|
- bank_name:obj.info.bank_name,//开户行
|
|
|
|
- bank_code:obj.info.bank_code,//银行卡号
|
|
|
|
- real_name:obj.info.bank_real_name,//开户人
|
|
|
|
- default:0,//1设为默认,0取消默认
|
|
|
|
- id:obj.info.id,
|
|
|
|
- type:obj.type,
|
|
|
|
- name:obj.info.name,
|
|
|
|
- phone:obj.info.phone,
|
|
|
|
- qrcode:obj.info.qrcode,
|
|
|
|
|
|
+ id: 0,
|
|
|
|
+ bank: obj.info.bank, //银行
|
|
|
|
+ bank_name: obj.info.bank_name, //开户行
|
|
|
|
+ bank_code: obj.info.bank_code, //银行卡号
|
|
|
|
+ real_name: obj.info.bank_real_name, //开户人
|
|
|
|
+ default: 0, //1设为默认,0取消默认
|
|
|
|
+ id: obj.info.id,
|
|
|
|
+ type: obj.type,
|
|
|
|
+ name: obj.info.name,
|
|
|
|
+ phone: obj.info.phone,
|
|
|
|
+ qrcode: obj.info.qrcode,
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
data = {
|
|
data = {
|
|
- id:0,
|
|
|
|
- bank:obj.info.bank,//银行
|
|
|
|
- bank_name:obj.info.bank_name,//开户行
|
|
|
|
- bank_code:obj.info.bank_code,//银行卡号
|
|
|
|
- real_name:obj.info.bank_real_name,//开户人
|
|
|
|
- default:0,//1设为默认,0取消默认
|
|
|
|
- name:obj.info.name,
|
|
|
|
- phone:obj.info.phone,
|
|
|
|
- qrcode:obj.info.qrcode,
|
|
|
|
- type:obj.type
|
|
|
|
|
|
+ id: 0,
|
|
|
|
+ bank: obj.info.bank, //银行
|
|
|
|
+ bank_name: obj.info.bank_name, //开户行
|
|
|
|
+ bank_code: obj.info.bank_code, //银行卡号
|
|
|
|
+ real_name: obj.info.bank_real_name, //开户人
|
|
|
|
+ default: 0, //1设为默认,0取消默认
|
|
|
|
+ name: obj.info.name,
|
|
|
|
+ phone: obj.info.phone,
|
|
|
|
+ qrcode: obj.info.qrcode,
|
|
|
|
+ type: obj.type
|
|
}
|
|
}
|
|
}
|
|
}
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
@@ -235,9 +266,9 @@
|
|
icon: 'none',
|
|
icon: 'none',
|
|
duration: 1000
|
|
duration: 1000
|
|
})
|
|
})
|
|
- setTimeout(function () {
|
|
|
|
|
|
+ setTimeout(function() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url:'/pages/user/set/bindBank'
|
|
|
|
|
|
+ url: '/pages/user/set/bindBank'
|
|
})
|
|
})
|
|
}, 1000);
|
|
}, 1000);
|
|
});
|
|
});
|
|
@@ -261,47 +292,52 @@
|
|
font-size: 28rpx !important;
|
|
font-size: 28rpx !important;
|
|
padding: 0rpx 25rpx;
|
|
padding: 0rpx 25rpx;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.login_input {
|
|
.login_input {
|
|
border-bottom: 1px solid #464755;
|
|
border-bottom: 1px solid #464755;
|
|
padding: 35rpx;
|
|
padding: 35rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.uni-input {
|
|
.uni-input {
|
|
width: 450rpx;
|
|
width: 450rpx;
|
|
text-align: left !important;
|
|
text-align: left !important;
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.submission {
|
|
.submission {
|
|
padding: 80rpx 25rpx;
|
|
padding: 80rpx 25rpx;
|
|
-
|
|
|
|
|
|
+
|
|
.golden {
|
|
.golden {
|
|
background: #0C5AFA;
|
|
background: #0C5AFA;
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.login_name {
|
|
.login_name {
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
|
|
+
|
|
.login_name image {
|
|
.login_name image {
|
|
width: 100rpx;
|
|
width: 100rpx;
|
|
height: 100rpx;
|
|
height: 100rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.navList {
|
|
.navList {
|
|
padding: 20rpx 50rpx;
|
|
padding: 20rpx 50rpx;
|
|
background: #1F2A4A;
|
|
background: #1F2A4A;
|
|
width: 100%;
|
|
width: 100%;
|
|
z-index: 9;
|
|
z-index: 9;
|
|
|
|
+
|
|
.navItem {
|
|
.navItem {
|
|
color: #fff;
|
|
color: #fff;
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
text-align: center;
|
|
text-align: center;
|
|
width: 50%;
|
|
width: 50%;
|
|
-
|
|
|
|
|
|
+
|
|
&.activeItem {
|
|
&.activeItem {
|
|
color: #0C5AFA;
|
|
color: #0C5AFA;
|
|
position: relative;
|
|
position: relative;
|
|
-
|
|
|
|
|
|
+
|
|
&:after {
|
|
&:after {
|
|
content: '';
|
|
content: '';
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -314,10 +350,10 @@
|
|
border-radius: 0rpx 20rpx 0rpx 0rpx;
|
|
border-radius: 0rpx 20rpx 0rpx 0rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
&.tip {
|
|
&.tip {
|
|
border-right: 1rpx solid #333D5B;
|
|
border-right: 1rpx solid #333D5B;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|