<template>
	<!-- 钱包卡片 -->
	<view class="sh-wallet-box u-flex u-m-b-10">
		<view class="u-flex wallet-left">
			<view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/wallet/index')">
				<text class="wallet-item__detail item-balance u-ellipsis-1">{{ userInfo.money || '0' }}</text>
				<text class="wallet-item__title">账户余额</text>
			</view>
			<view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/wallet/score-balance')">
				<text class="wallet-item__detail item-score u-ellipsis-1">{{ userInfo.score || '0' }}</text>
				<text class="wallet-item__title">积分</text>
			</view>
			<view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/app/coupon/list')">
				<text class="wallet-item__detail item-coupon u-ellipsis-1">{{ userOtherData.coupons_num || '0' }}</text>
				<text class="wallet-item__title">优惠券</text>
			</view>
		</view>
		<view class="wallet-item u-flex-col wallet-right u-col-center" @tap="jump('/pages/user/wallet/index')">
			<image class="cut-off--line" :src="$IMG_URL + '/imgs/user/cut_off_line.png'" mode=""></image>
			<image class="wallet-img" :src="'/static/images/tab1.png'" mode="aspectFill"></image>
			<text class="wallet-item__title">我的钱包</text>
		</view>
	</view>
</template>

<script>
/**
 * 钱包样式卡片
 */
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
export default {
	components: {},
	data() {
		return {};
	},
	computed: {
		...mapGetters(['userInfo', 'userOtherData'])
	},
	methods: {
		jump(path, query) {
			this.$Router.push({
				path: path,
				query: query
			});
		}
	}
};
</script>

<style lang="scss">
// 钱包卡片
.sh-wallet-box {
	background: #fff;
	height: 170rpx;
	position: relative;
	border-radius: 20rpx;
	margin: 0 24rpx;
	margin-top: 20rpx;
	.wallet-left {
		flex: 4;
	}
	.wallet-right {
		position: relative;
		.cut-off--line {
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			right: (750rpx/5) - 15rpx;
			width: 30rpx;
			height: 136rpx;
		}
	}
	.wallet-item {
		flex: 1;
		.wallet-img {
			width: 60rpx;
			height: 60rpx;
		}
		.wallet-item__detail {
			font-size: 36rpx;
			width: 180rpx;
			text-align: center;
			font-weight: bold;
			color: #21222B;
		}
		.wallet-item__title {
			font-size: 24rpx;
			font-weight: 400;
			color: #21222B;
			margin-top: 20rpx;
		}
		.item-balance::after {
			content: '元';
			font-size: 16rpx;
			margin-left: 4rpx;
		}
		.item-score::after {
			content: '个';
			font-size: 14rpx;
			margin-left: 4rpx;
		}
		.item-coupon::after {
			content: '张';
			font-size: 16rpx;
			margin-left: 4rpx;
		}
	}
}
</style>
