<template>
	<view class="page">
		<u-navbar title="购买记录" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
			height='45'></u-navbar>

		<view class="cont">
			<view class="vip_card">
				<view class="top">
					<view class="txt">
						电单车15天5次卡
					</view>
					<view class="txt">
						3.9 <span style="font-size: 32rpx;">元</span>
					</view>
				</view>
				<view class="bot">
					2024-07-28 17:39:50
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: '#fff'
				},
				sn: '',
				istrue: false,
				CouponLists:[]
			}
		},
		onShow() {
			this.getinfo()
		},
		methods: {
			getinfo() {
				// uni.showLoading({
				// 	title:'加载中'
				// })
				this.$u.get("/getAppInfo").then((res) => {
			
					if (res.code == 200) {
					
						this.$store.commit('SET_USERID', res.user.userId);
						this.userinfo = res.user
						this.getcard()
					} else {
					
					}
				});
			},
			 formatDate(dateString) {
			    if (!dateString) return '';
			    const date = new Date(dateString);
			    const year = date.getFullYear();
			    const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始，需要加1
			    const day = date.getDate().toString().padStart(2, '0');
			    return `${year}-${month}-${day}`;
			  },
			getcard(){
				let data={
					userId:this.userinfo.userId
				}
				this.$u.get("/appVerify/getCouponListByUserId?",data ).then((res) => {
							
					if (res.code == 200) {
						this.CouponLists = res.data
						
					} else { 
						// uni.showToast({
						// 	title: res.msg,
						// 	icon: 'none',
						// 	duration: 2000
						// });
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}

	.page {
		width: 750rpx;

		.cont {
			display: flex;
			justify-content: center;
			flex-wrap: wrap;

			.tit1 {
				font-weight: 500;
				font-size: 32rpx;
				color: #FFFFFF;
			}

			.tit2 {
				margin-top: 10rpx;
				font-weight: 500;
				font-size: 24rpx;
				color: #FFFFFF;
			}
			.vip_card{
			
				width: 95%;
				padding: 10rpx 12rpx;
				// margin: 0 auto;
				border-bottom: 1rpx solid #D8D8D8 ;
				.top{
					display: flex;
					flex-wrap: nowrap;
					justify-content: space-between;
					align-items: center;
					.txt{
						font-weight: 500;
						font-size: 40rpx;
						color: #2F3240;
					}
				}
				.bot{
					margin-top: 14rpx;
					font-weight: 400;
					font-size: 28rpx;
					color: #808080;
				}
			}
		
		}


	}
</style>