<template>
	<view class="container clearfix">
		<view class="cm-member-top">
			<view class="cm-member-head">
				<view class="cm-member-text">
					<view class="cm-member-h1">
						<text>采美·超级会员</text>
					</view>
					<view class="cm-member-p">
						<text>有效期至：2021-10-01</text>
					</view>
				</view>
			</view>
		</view>
		<view class="cm-member-main">
			<view class="record-list" v-for="(pay,index) in payList" :key="index" >
				<view class="record-list-type">
					<view class="list-type-h1"> {{ pay.text }} </view>
					<view class="list-type-p"> {{ pay.time }} </view>
				</view>
				<view class="record-list-text">
					<text v-if="pay.type == 1">￥{{ pay.money }}</text>
					<text v-else>{{ pay.money }}采美豆</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState,mapMutations} from 'vuex'
	export default {
		components:{
			
		},
		data() {
			return {
				StaticUrl:this.$Static,
				memberType:0,
				tabCurrent:0,
				params:{
					userId:0,
					redemptionCode:'',
					source:2,
				},
				payList:[
					{month:'1个月',money:'600',type:1,text:'超级会员套餐-1个月',time:'2021-09-28  13:54:48'},
					{month:'3个月',money:'1500',type:1,text:'超级会员套餐-3个月',time:'2021-09-28  13:54:48'},
					{month:'12个月',money:'4800',type:1,text:'超级会员套餐-12个月',time:'2021-09-28  13:54:48'},
					{month:'12个月',money:'48000',type:2,text:'超级会员套餐-12个月',time:'2021-09-28  13:54:48'},
				],
				payAmount:4800,
				payBeans:480000,
			}
		},
		onLoad() {
			
		},
		filters: {
			TypeFormat:function(value) {
				switch (value) {
					case 0:
						return  '活动券'
						break
					case 1:
						return  '品类券'
						break
					case 2:
						return  '用户专享券'
						break
					case 3:
						return  '店铺券'
						break
					case 4:
						return  '新用户券'
						break
				}
			}
		},
		computed: {
			...mapState(['hasLogin','userInfo','identity','isActivity'])
		},
		methods: {
			handleCheckedPay(index,pay){// 选择会员
				this.tabCurrent = index
				this.payAmount = pay.money
				this.payBeans = pay.beans
			}
		},
		onPullDownRefresh() {
			setTimeout(() => {
				uni.stopPullDownRefresh()
			}, 200)
		},
		onShow(){
			this.$api.getComStorage('userInfo').then((resolve) =>{
				this.params.userId = resolve.userId ? resolve.userId : 0
			}).catch(error =>{
				console.log('暂无用户信息~')
			})
		}
	}
</script>

<style lang="scss">
	.container{
		width: 100%;
		height: auto;
	}
	.cm-member-top{
		width: 100%;
		height: 242rpx;
		box-sizing: border-box;
		padding: 0 24rpx;
		background: url(https://static.caimei365.com/app/img/icon/icon-member-bg01@2x.png) no-repeat;
		background-size: cover;
		position: relative;
		.cm-member-head{
			width: 702rpx;
			height: 132rpx;
			box-sizing: border-box;
			padding: 30rpx 32rpx 0 109rpx;
			background: url(https://static.caimei365.com/app/img/icon/icon-member-bg02@2x.png) no-repeat;
			background-size: cover;
			position: absolute;
			bottom: 0;
			left: 24rpx;
			border-radius: 16rpx 16rpx 0 0;
			.cm-member-text{
				float: left;
				.cm-member-h1{
					line-height: 42rpx;
					font-size: $font-size-30;
					color: #55331D;
					text-align: left;
					margin-bottom: 12rpx;
					font-weight: bold;
				}
				.cm-member-p{
					line-height: 30rpx;
					font-size: $font-size-22;
					color: #55331D;
					text-align: left;
				}
			}
		}
	}
	.cm-member-main{
		width: 100%;
		box-sizing: border-box;
		padding: 40rpx 24rpx;
		background-color: #FFFFFF;
		margin-bottom: 20rpx;
		.record-list{
			width: 100%;
			height: 135rpx;
			border-bottom: 1px solid #F0F0F0;
			box-sizing: border-box;
			padding: 24rpx 0;
			.record-list-type{
				float: left;
				height: 100%;
				.list-type-h1{
					line-height: 37rpx;
					font-size: $font-size-26;
					color: #333333;
					text-align: left;
					margin-bottom: 16rpx;
				}
				.list-type-p{
					line-height: 33rpx;
					font-size: $font-size-24;
					color: #999999;
					text-align: left;
				}
			}
			.record-list-text{
				float: right;
				line-height: 86rpx;
				font-size: $font-size-34;
				color: #FF2A2A;
				text-align: right;
			}
		}
	}
</style>
