<template>
	<view class="content">
		<view class="collection-box">
			<view class="collection-item">
				<view class="left">
					<view class="img"><image src="../../static/user/mybank.png" mode=""></image></view>
					<view class="bank">银行卡</view>
				</view>
				<view class="gg" @click="nav('/pages/collection/bank')">
					<view class="status" v-if="bankData.name != null">{{ bankData.name}}</view>
					<view class="status" v-else>未添加</view>
					<view class="img1"><text class="iconfont iconenter"></text></view>
				</view>
			</view>
			<view class="collection-item">
				<view class="left">
					<view class="img"><image src="../../static/user/zfb.png" mode=""></image></view>
					<view class="bank">支付宝</view>
				</view>
				<view class="gg" @click="nav('/pages/collection/zfb')">
					<view class="status" v-if="aliData.name != null">{{aliData.name}}</view>
					<view class="status" v-else>未添加</view>
					<view class="img1"><text class="iconfont iconenter"></text></view>
				</view>
			</view>
			<view class="collection-item">
				<view class="left">
					<view class="img">
						<image src="../../static/user/wx.png" mode=""></image>
					</view>
					<view class="bank">
						微信
					</view>
				</view>
				<view class="gg" @click="nav('/pages/collection/wx')">
					<view class="status" v-if="wx.name != null">{{wx.name}}</view>
					<view class="status" v-else>未添加</view>
					<view class="img1">
						<text class="iconfont iconenter"></text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex';
import { pay_list } from '../../api/wallet.js'
export default {
	data() {
		return {
			aliData: {},
			bankData: {},
			wx:{},
		};
	},
	computed: {
		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
	},
	onShow() {
		this.loadDate();
	},
	methods: {
		nav(url) {
			uni.navigateTo({
				url
			});
		},
		loadDate() {
			pay_list().then(({data}) =>{
				this.wx = data.wx
				this.aliData = data.zfb
				this.bankData = data.bank
			})
		}
	}
};
</script>
<style lang="scss">
page,
.content {
	height: 100%;
	margin: 0;
	height: 0;
}

.collection-box {
	background: #ffffff;
	margin: 50rpx 20rpx;
	width: 710rpx;
	display: flex;
	flex-direction: column;

	.collection-item {
		margin: 35rpx 30rpx;
		display: flex;
		justify-content: space-between;

		.left {
			display: flex;

			.img {
				height: 40rpx;
				width: 40rpx;

				image {
					height: 100%;
					width: 100%;
				}
			}

			.bank {
				margin-left: 25rpx;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #333333;
			}
		}

		.gg {
			display: flex;

			.status {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #999999;
				margin-right: 20rpx;
			}

			.img1 {
				width: 15rpx;
				height: 25rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
}
</style>
