myWallet.vue 3.9 KB
<template>
	<view class="wallet_bg">
		<view class="banner card">
			<view class="my_money">
				<text>钱包余额</text>
				<text class="number">¥2000.00</text> 
			</view>
			<!-- 收益列表 -->
			<view class="day_list dis-flex flex-y-center flex-x-around">
				<view class="dis-flex flex-dir-column flex-y-center">
					<text class="col-9 f-24 l-h-32 mb-10">今日收益</text>
					<text class="f-w-500 col-3 f-32 l-h-42">¥567.12</text>
				</view>
				<view class="dis-flex flex-dir-column flex-y-center">
					<text class="col-9 f-24 l-h-32 mb-10">今日支出</text>
					<text class="f-w-500 col-3 f-32 l-h-42">¥567.12</text>
				</view>
				<view class="dis-flex flex-dir-column flex-y-center">
					<text class="col-9 f-24 l-h-32 mb-10">累积收益</text>
					<text class="f-w-500 col-3 f-32 l-h-42">¥567.12</text>
				</view>
			</view>
			<view class="dis-flex flex-y-center m-top30">
				<view class="use col-3 f-32 f-w-500">提现</view>
				<view class="recharge col-f f-32 f-w-500">充值</view>
			</view>
		</view>
		
		<view class="card m-top20">
			<!-- 头部模块 -->
			<view class="header">
				<view class="title">收支账单</view>
				<u-tabs
					:list="list" 
					lineColor="#FFA100" 
					:activeStyle="{ color: '#FFA100' }" 
					itemStyle="padding-left: 15px; padding-right: 15px; height: 92rpx;width: 33%;box-sizing: border-box;"
					@click="toggleData" 
				/>
			</view>
			<!-- 账单列表 -->
			<view class="bill_list">
				<u-cell-group :border="false">
					<u-cell
						v-for="(item, index) in billList" 
						:key="index" :title="item.name" 
						:label="item.createTime" 
						:value="priceActive(item)"
						:border="false"
					/>
				</u-cell-group>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{ name: '全部', id: 1},
					{ name: '收入', id: 2},
					{ name: '支出', id: 3},
				],
				billList: [
					{ name: '南宁站 000026', createTime: '2022-12-26 14:00:35', price: '1.09', status: 'add' },
					{ name: '南宁站 000026', createTime: '2022-12-26 14:00:35', price: '1.09', status: 'add' },
					{ name: '提现', createTime: '2022-12-26 14:00:35', price: '1.09', status: 'minus' },
					{ name: '提现', createTime: '2022-12-26 14:00:35', price: '1.09', status: 'minus' },
				]
			};
		},
		computed: {
			priceActive(){
				return (item) => {
					return item.status === 'add' ? `+ ${item.price}` : `- ${item.price}`
				}
			}
		},
		methods: {
			toggleData(){
				
			}
		}
	}
</script>

<style lang="scss" scoped>
.wallet_bg{
	padding: 20rpx 30rpx;
	background-color: #F5F6FA;
	min-height: 100vh;
	.card{
		background-color: #fff;
		border-radius: 12rpx;
	}
	.banner{
		padding: 36rpx 20rpx;
		border-radius: 16rpx;
		overflow: hidden;
		.my_money{
			display: flex;
			align-items: center;
			flex-direction: column;
			gap: 20rpx;
			font-size: 28rpx;
			line-height: 38rpx;
			color: #3d3d3d;
			margin-bottom: 40rpx;
			.number{
				font-size: 40rpx;
				font-weight: 500;
				line-height: 54rpx;
			}
		}
		.use{
			flex: 1;
			height: 80rpx;
			border-radius: 12rpx;
			border: 2rpx solid #333333;
			margin-right: 10rpx;
			text-align: center;
			line-height: 80rpx;
		}
		.recharge{
			flex: 1;
			height: 80rpx;
			border-radius: 12rpx;
			background-color: #333;
			text-align: center;
			line-height: 80rpx;
		}
	}
	.bill_list{
		margin-top: 30rpx;
	}
}
.header{
	border-bottom: 1px solid #e1e1e1;
	padding-top: 30rpx;
	.title{
		position: relative;
		width: 120rpx;
		margin: 0 auto;
		font-size: 28rpx;
		color: #3d3d3d;
		line-height: 38rpx;
		&::before{
			content: '';
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			left: -50rpx;
			width: 30rpx;
			height: 2rpx;
			background: linear-gradient(to right, #fff, #333);
		}
		&::after{
			content: '';
			position: absolute;
			top: 50%;
			right: -50rpx;
			transform: translateY(-50%);
			width: 30rpx;
			height: 2rpx;
			background: linear-gradient(to right, #333, #fff);
		}
	}
}
</style>