|
@@ -90,18 +90,29 @@
|
|
|
radioChange(val) {
|
|
|
for (let i = 0; i < this.bankList.length; i++) {
|
|
|
if (val.id == this.bankList[i].id) {
|
|
|
- this.bankList[i].defaultFlag = 1
|
|
|
+ if(this.bankList[i].defaultFlag == 1){
|
|
|
+ this.bankList[i].defaultFlag = 0
|
|
|
+ this.bankList[i].flag = 2 //取消标志
|
|
|
+ }else{
|
|
|
+ this.bankList[i].defaultFlag = 1
|
|
|
+ this.bankList[i].flag = 1 //设置标志
|
|
|
+ }
|
|
|
this.$request.baseRequest('post', '/driverPayeeInfo/api/setDefault', val).then(res => {
|
|
|
if (res.code == '200') {
|
|
|
- // this.bankList = res.data
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'success',
|
|
|
- message: "设置成功!",
|
|
|
- })
|
|
|
+ if(this.bankList[i].flag == 1){
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: "设置成功!",
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: "取消成功!",
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.$u.toast(res.message);
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
.catch(res => {
|
|
|
uni.$u.toast(res.message);
|