Commit 588b69f4 authored by 786817560's avatar 786817560

'bank'

parents 1ad4d0b4 7bd04006
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @Author: your name * @Author: your name
* @Date: 2019-09-24 21:29:35 * @Date: 2019-09-24 21:29:35
* @LastEditTime: 2019-09-25 20:08:44 * @LastEditTime: 2019-09-26 17:41:15
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
--> -->
<template> <template>
<div>
<div id="bank-card"> <div id="bank-card">
<div class="info"> <div class="info">
<div class="info-icon"> <div class="info-icon">
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
<img src="@/assets/userBind/bankIcon.png" class="icon" > <img src="@/assets/userBind/bankIcon.png" class="icon" >
<span class="top-word"> <span class="top-word">
我的卡 我的卡
<span class="sum">(共4张)</span> <span class="sum">(共{{ getBankList.length }}张)</span>
</span> </span>
</div> </div>
<img src="@/assets/userBind/add.png" class="icon-right" @click="sendFlag" > <img src="@/assets/userBind/add.png" class="icon-right" @click="sendFlag" >
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
<div class="clear" /> <div class="clear" />
<div class="card-content"> <div class="card-content">
<ul> <ul>
<li v-for="(item,index) in bankList" :key="index"> <li v-for="(item,index) in getBankList" :key="index">
<item-option class="slider"> <item-option class="slider">
<div <div
:style="'background-image: url('+ changeBgImg (item) +')'" :style="'background-image: url('+ changeBgImg (item) +')'"
...@@ -51,39 +50,21 @@ ...@@ -51,39 +50,21 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import backImg1 from '@/assets/userBind/nong.png' import backImg1 from '@/assets/userBind/nong.png'
import backImg2 from '@/assets/userBind/unNong.png' import backImg2 from '@/assets/userBind/unNong.png'
export default { export default {
props: { props: {
bp_id: { 'getBankList': {
type: String, default: [],
default: '', type: Array,
}, },
}, },
data () { data () {
return { return {
backImg: null, backImg: null,
showModalValue: true, showModalValue: true,
bankList: [
{
bank_account_num: '1231123112311231',
bank_full_name: '中国农业银行',
bank_card_type: '信用卡',
},
{
bank_account_num: '2345763456980965',
bank_full_name: '中国建设银行',
bank_card_type: '储蓄卡',
},
{
bank_account_num: '2345763456980965',
bank_full_name: '中国建设银行',
bank_card_type: '储蓄卡',
},
],
} }
}, },
methods: { methods: {
...@@ -103,24 +84,25 @@ export default { ...@@ -103,24 +84,25 @@ export default {
return num.substring(num.length - 4) return num.substring(num.length - 4)
}, },
deleteFun (e) { deleteFun (e) {
console.log(this.bp_id) let index = this.getBankList.findIndex(item => {
let url = $config.basePath + 'bp_bank_delete' if (item.bank_account_num === e) {
return true
}
})
this.getBankList.splice(index, 1)
let vm = this
let url = process.env.basePath + 'bp_bank_delete'
let param = { let param = {
'master': { 'master': {
'bp_id': this.bp_id, 'bp_id': window.localStorage.user_id,
'bank_account_num': e, 'bank_account_num': e,
}, },
} }
let vm = this vm.hlsPopup.showLoading('请稍候')
this.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
console.log('银行卡删除', res) vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
let index = vm.bankList.findIndex(item => { console.log(res)
if (item.bank_account_num === e) {
return true
}
})
vm.bankList.splice(index, 1)
} }
}) })
}, },
...@@ -128,7 +110,7 @@ export default { ...@@ -128,7 +110,7 @@ export default {
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
#bank-card { #bank-card {
.info { .info {
height: 70px; height: 70px;
background-color: rgba(142, 195, 30, 0.1); background-color: rgba(142, 195, 30, 0.1);
...@@ -261,5 +243,5 @@ export default { ...@@ -261,5 +243,5 @@ export default {
no-repeat; no-repeat;
background-size: 20px 20px; background-size: 20px 20px;
} }
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @Author: your name * @Author: your name
* @Date: 2019-09-19 09:31:19 * @Date: 2019-09-19 09:31:19
* @LastEditTime: 2019-09-26 14:00:48 * @LastEditTime: 2019-09-26 17:28:42
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -491,6 +491,8 @@ export default { ...@@ -491,6 +491,8 @@ export default {
if (res.result === 'S') { if (res.result === 'S') {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
vm.hlsPopup.showSuccess('保存成功') vm.hlsPopup.showSuccess('保存成功')
window.localStorage.setItem('user_id', res.bp_id)
window.sessionStorage.setItem('user_id', res.bp_id)
vm.bp_id = res.bp_id vm.bp_id = res.bp_id
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment