vipRecharge.vue 3.3 KB
<template>
	<view class="vip_recharge">
		<!-- 头部详情 -->
		<view class="vip_head">
			<image class="head_cover" src="@/static/images/arenaDetail/vip_bg.png" mode="widthFix"></image>
			<u-navbar
				title="申请场馆会员卡"
				:autoBack="true"
				:bgColor="bgColor"
			/>
			
			<view class="uesrInfoCard">
				<view class="userInfo">
					<u-avatar :src="src"></u-avatar>
					<text class="name">CLOOL</text>
					<text class="phone">(158****1234)</text>
				</view>
			</view>
		</view>
		<!-- 充值列表 -->
		<view class="vip_list">
			<view class="list_title">VIP会员</view>
			<view class="price_list">
				<PriceCard v-for="(item, index) in priceList" :key="index" :info="item" :active="index === current" @toggle="ontoggle(item, index)"/>
			</view>
			
			<view class="pay_btn">确认并支付¥{{ price }}</view>
			<view class="agreement">
				<u-checkbox-group>
					<u-checkbox v-model="checked" shape="circle" :activeColor="ThemeColor.PrimaryColor" label="开通前请阅读《世纪创软运动系列会员服务协议》"></u-checkbox>
				</u-checkbox-group>
			</view>
		</view>
	</view>
</template>

<script>
	import PriceCard from './components/priceCard.vue'
	import ThemeColor from '@/utils/themeColor'
	export default {
		components: { PriceCard },
		data(){
			return {
				current: 0,
				ThemeColor,
				bgColor: 'transparent',
				checked: false,
				price: 0,
				priceList: [
					{ name: '3次卡', price: 40, oldPrice: 68, avgText: '约13.3/次'},
					{ name: '周卡', price: 150, oldPrice: 500, avgText: '约21.4/天'},
					{ name: '季卡', price: 999, oldPrice: 1500, avgText: '约333/月'},
					{ name: '年卡', price: 3000, oldPrice: 5000, avgText: '约250/月'}
				],
				src: 'https://cdn.uviewui.com/uview/album/1.jpg'
			}
		},
		mounted() {
			this.price = this.priceList[0].price
		},
		methods: {
			ontoggle(item, index){
				this.current = index
				this.price = item.price
			}
		}
	}
</script>

<style lang="scss" scoped>
	.vip_recharge{
		min-height: 100vh;
	}
	// 头部
	.vip_head{
		position: relative;
		height: 540rpx;
		overflow: hidden;
		.head_cover{
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
		}
		.uesrInfoCard {
			width: 100%;
			position: absolute;
			bottom: 40rpx;
			padding: 0 30rpx;
			height: 100rpx;
			box-sizing: border-box;
			.userInfo{
				display: flex;
				align-items: center;
				height: 100%;
				padding: 0 40rpx;
				background: rgba(255,255,255,0.7);
				border-radius: 16rpx;
				color: #999999;
				font-size: 24rpx;
				.name{
					margin-left: 20rpx;
					color: #3d3d3d;
					font-size: 28rpx;
				}
			}
		}
	}
	
	// 充值列表
	.vip_list{
		position: relative;
		min-height: calc(100vh - 540rpx);
		background-color: #fff;
		margin-top: -55rpx;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
		padding: 40rpx 30rpx 0;
		.list_title{
			font-size: 36rpx;
			line-height: 48rpx;
			font-weight: 600;
			color: #3d3d3d;
			padding-left: 30rpx;
			margin-bottom: 20rpx;
		}
		.price_list{
			display: flex;
			flex-wrap: wrap;
			gap: 30rpx;
		}
		.pay_btn{
			margin: 30rpx 0;
			width: 100%;
			height: 100rpx;
			background: linear-gradient( 90deg, #FFD176 0%, #FEDE9C 100%);
			border-radius: 200rpx;
			line-height: 100rpx;
			text-align: center;
			font-size: 40rpx;
			color: #722F06;
		}
	}
</style>