dataDetail.vue 2.2 KB
<template>
	<view class="detail_content">
		<!-- 时间列表 -->
		<view class="time_list">
			<view
				v-for="item in timeList"
				:key="item.id"
				class="time_item"
				:class="{active: current === item.id}"
				@click="current = item.id"
			>
			{{ item.text }}
			</view>
		</view>
		<!-- 收入列表 -->
		<view class="revenue">
			<DataComputed v-show="current === 0" :showTitle="false" bgColor="transparent" :marginTop="0" />
			<view v-show="current === 3" class="month">
				4<text class="f-36 l-h-48">月</text>
			</view>
			<view v-show="current !== 0">
				<view class="dis-flex flex-dir-column flex-y-center">
					<text class="f-w-600 col-3d f-48 l-h-64">123456</text>
					<text class="f-28 col-9 l-h-38 m-top10">总收入</text>
				</view>
			</view>
		</view>
		<view class="px-20" style="background-color: #fff;">
			<RevenueCard v-for="item in 5" :key="item" />
		</view>
	</view>
</template>

<script>
	import DataComputed from '@/components/data/dataComputed.vue'
	import RevenueCard from '@/components/data/revenueCard.vue'
	export default {
		name:"dataDetail",
		components: { DataComputed, RevenueCard },
		data() {
			return {
				current: 0,
				timeList: [
					{ id: 0, text: '今日', time: new Date() },
					{ id: 1, text: '近7日', time: '' },
					{ id: 2, text: '近30日', time: '' },
					{ id: 3, text: '近1年', time: '' }
				]
			}
		}
	}
</script>

<style lang="scss" scoped>
.detail_content{
	padding: 20rpx 30rpx 0;
	.time_list{
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 68rpx;
		.time_item{
			width: 160rpx;
			height: 60rpx;
			background: #FFF0C3;
			color: #666;
			font-size: 28rpx;
			line-height: 60rpx;
			border-radius: 12rpx;
			text-align: center;
			&.active{
				color: #333;
				background: linear-gradient( 45deg, #FEE14D 0%, #FFC24D 100%);
			}
		}
	}
	.revenue{
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 200rpx;
		background: radial-gradient(ellipse at 10% 20%, #e186ff33 0%, #86fbff33 90%);
		border-radius: 12rpx 12rpx 0rpx 0rpx;
		.month{
			position: absolute;
			top: -44rpx;
			left: 40rpx;
			color: #3d3d3d;
			font-size: 72rpx;
			font-weight: 500;
			line-height: 96rpx;
		}
	}
}
</style>