Commit f89de467 authored by linxin's avatar linxin

add:增加银行卡图标识别

parent 93583bf2
......@@ -28,7 +28,7 @@
</section>
</item>
<item v-for="(item,index) in lists" :proportion="[7,1,1]" :key="index" @click.native="isSelect(`three${index}`)">
<div slot="name" style="flex=3"> <img src="@/assets/payment/ly.png" alt="" class="icon"> {{ item.bank_full_name }}({{ selectLast(item) }})</div>
<div slot="name" style="flex=3"> <img :src="selectImg(item)" alt="" class="icon"> {{ item.bank_full_name }}({{ selectLast(item) }})</div>
<section slot="content">
<img v-show="select === `three${index}`" src="@/assets/payment/select.png" alt="">
<img v-show="select !== `three${index}`" src="@/assets/payment/unselect.png" alt="">
......@@ -46,7 +46,21 @@
</template>
<script>
import js from '@/assets/payment/js.png'
import ny from '@/assets/payment/ly.png'
import pf from '@/assets/payment/pf.png'
import gd from '@/assets/payment/gd.png'
import gf from '@/assets/payment/gf.png'
import jt from '@/assets/payment/jt.png'
import gs from '@/assets/payment/gs.png'
import ms from '@/assets/payment/ms.png'
import pa from '@/assets/payment/pa.png'
import xy from '@/assets/payment/xy.png'
import yzcx from '@/assets/payment/yzcx.png'
import zg from '@/assets/payment/zg.png'
import zs from '@/assets/payment/zs.png'
import zx from '@/assets/payment/zx.png'
import bank from '@/assets/payment/bank.png'
export default {
name: 'PayEntry',
components: {
......@@ -71,6 +85,39 @@ export default {
this.money = this.$route.params.money
},
methods: {
selectImg (e) {
if (e.bank_full_name.indexOf('建设') !== -1) {
return js
} else if (e.bank_full_name.indexOf('农业') !== -1) {
return ny
} else if (e.bank_full_name.indexOf('光大') !== -1) {
return gd
} else if (e.bank_full_name.indexOf('广发') !== -1) {
return gf
} else if (e.bank_full_name.indexOf('浦') !== -1) {
return pf
} else if (e.bank_full_name.indexOf('工商') !== -1) {
return gs
} else if (e.bank_full_name.indexOf('交通') !== -1) {
return jt
} else if (e.bank_full_name.indexOf('民生') !== -1) {
return ms
} else if (e.bank_full_name.indexOf('平安') !== -1) {
return pa
} else if (e.bank_full_name.indexOf('兴业') !== -1) {
return xy
} else if (e.bank_full_name.indexOf('邮') !== -1) {
return yzcx
} else if (e.bank_full_name.indexOf('中国') !== -1) {
return zg
} else if (e.bank_full_name.indexOf('招商') !== -1) {
return zs
} else if (e.bank_full_name.indexOf('中信') !== -1) {
return zx
} else {
return bank
}
},
selectLast (item) {
let num = item.bank_account_num
return num.substring(num.length - 4)
......
......@@ -28,7 +28,7 @@
</section>
</item>
<item v-for="(item,index) in lists" :proportion="[7,1,1]" :key="index" @click.native="isSelect(`three${index}`)">
<div slot="name" style="flex=3"> <img src="@/assets/payment/ly.png" alt="" class="icon"> {{ item.bank_full_name }}({{ selectLast(item) }})</div>
<div slot="name" style="flex=3"> <img :src="selectImg(item)" alt="" class="icon"> {{ item.bank_full_name }}({{ selectLast(item) }})</div>
<section slot="content">
<img v-show="select === `three${index}`" src="@/assets/payment/select.png" alt="">
<img v-show="select !== `three${index}`" src="@/assets/payment/unselect.png" alt="">
......@@ -54,7 +54,20 @@
</template>
<script>
import js from '@/assets/payment/js.png'
import ny from '@/assets/payment/ly.png'
import pf from '@/assets/payment/pf.png'
import gd from '@/assets/payment/gd.png'
import gf from '@/assets/payment/gf.png'
import jt from '@/assets/payment/jt.png'
import gs from '@/assets/payment/gs.png'
import ms from '@/assets/payment/ms.png'
import pa from '@/assets/payment/pa.png'
import xy from '@/assets/payment/xy.png'
import yzcx from '@/assets/payment/yzcx.png'
import zg from '@/assets/payment/zg.png'
import zs from '@/assets/payment/zs.png'
import zx from '@/assets/payment/zx.png'
export default {
name: 'PaymentPayEntry',
components: {
......@@ -67,7 +80,8 @@ export default {
}
},
computed: {},
watch: {},
watch: {
},
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'PaymentFirstPay') {
......@@ -91,6 +105,37 @@ export default {
let num = item.bank_account_num
return num.substring(num.length - 4)
},
selectImg (e) {
if (e.bank_full_name.indexOf('建设') !== -1) {
return js
} else if (e.bank_full_name.indexOf('农业') !== -1) {
return ny
} else if (e.bank_full_name.indexOf('光大') !== -1) {
return gd
} else if (e.bank_full_name.indexOf('广发') !== -1) {
return gf
} else if (e.bank_full_name.indexOf('浦') !== -1) {
return pf
} else if (e.bank_full_name.indexOf('工商') !== -1) {
return gs
} else if (e.bank_full_name.indexOf('交通') !== -1) {
return jt
} else if (e.bank_full_name.indexOf('民生') !== -1) {
return ms
} else if (e.bank_full_name.indexOf('平安') !== -1) {
return pa
} else if (e.bank_full_name.indexOf('兴业') !== -1) {
return xy
} else if (e.bank_full_name.indexOf('邮') !== -1) {
return yzcx
} else if (e.bank_full_name.indexOf('中国') !== -1) {
return zg
} else if (e.bank_full_name.indexOf('招商') !== -1) {
return zs
} else if (e.bank_full_name.indexOf('中信') !== -1) {
return zx
}
},
goSuccess () {
this.$router.push({
name: 'Success',
......@@ -114,7 +159,6 @@ export default {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
vm.userName = res.lists[0].bank_account_name
} else {
hlsPopup.showLongCenter(res.message)
}
......
......@@ -75,7 +75,7 @@ export default {
this.sendFlag(false)
},
changeBgImg (item) {
if (item.bank_full_name === '中国农业银行') {
if (item.bank_full_name.indexOf('农业银行') !== -1) {
return backImg1
} else {
return backImg2
......
......@@ -82,7 +82,7 @@ export default {
this.sendFlag(false)
},
changeBgImg (item) {
if (item.bank_full_name === '中国农业银行') {
if (item.bank_full_name.indexOf('农业银行') !== -1) {
return backImg1
} else {
return backImg2
......
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