<template>
	<view class='mybank-page'>
		<!-- 空页面 -->
		<view class='mybank-null' v-if="bankList.length!=0">
			<view class='mybank-img'></view>
			<view class='mybank-text'>暂无绑定银行卡</view>
			<view class='mybank-btn' @click='addbank'>
				<i class='mybank-btn-icon'></i>
				<span>添加银行卡</span>
			</view>
		</view>
		<!-- 有银行 -->
		<view class='mybank-card' v-else>
			<view class='mybank-card-box' v-for="item in bankList" :key='item.id' :style="{'background':item.backgroundImg}">
				<view class='card-box-top'>
					<image class='card-box-img' :src='item.logoImg'></image>
					<span class='card-box-img-text'>{{item.openBankName}}</span>
				</view>
				<view class='card-box-number'>
					****     ****     ****       {{item.bankAccountShow}} 
				</view>
			</view>
			
			<view class='mybank-card-btn'  @click='addbank'>
				<i class='mybank-btn-icons'></i>
				<span>添加银行卡</span>
			</view>
			<view class='mybank-card-text-f'>
				仅支持添加储蓄卡
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bankList:[]
			}
		},
		methods: {
			initbank(){
				const self=this
				const payload={
					at: "bankcard.list",
					v: '1.0.2'
				}
				self.$request(payload).then(res=>{
					const { bankCardList }=JSON.parse(res.desData)
					console.log(bankCardList,75)
					self.bankList=bankCardList
							
				})
			},
			addbank(){
				uni.navigateTo({
					url:'/pages/bankadd/bankadd'
				})
			}
		},
		onShow(){
			// this.initbank()
		}
	}
</script>

<style src='./index.less' lang="less" scoped></style>
