coachHome.vue 12.6 KB
<template>
	<view class="home_container">
		<u-navbar
			title="世纪创软"
			:placeholder="true"
			leftIconSize="0"
			titleStyle="font-family: STKaiti, Kati, Kati_GB2312, serif;color: #000;fontSize: 48rpx;fontWeight: 600;"
		/>
		<!-- 头部教练信息 -->
		<view class="nav_header">
			<view class="left_box">
				<image src="@/static/logo.png" mode="widthFix" class="avatar_img"></image>
				<view style="display: flex;flex-direction: column;">
					<text class="title">教练名称</text>
					<text class="tag">标签名号</text>
				</view>
			</view>
			<view class="right_box">
				<u-icon name="bell-fill" size="28" color="#FACC15"></u-icon>
				<text class="notice">23</text>
			</view>
		</view>
	
		<!-- 数据卡片 -->
		<view class="data_card">
			<!-- 今日订单 -->
			<view class="card_item">
				<text class="card_title">今日订单</text>
				<text class="card_value">12<text style="color: #6B7280;font-size: 20rpx;margin-left: 10rpx;">单</text></text>
				<view style="display: flex;align-items: center;">
					<u-icon name="arrow-upward" color="#22C55E" size="12"></u-icon>
					<text class="other_text" style="color: #22C55E;">较昨日 +2</text>
				</view>
				<view class="right_icon">
					<u-icon name="calendar-fill" size="16" :color="ThemeColor.PrimaryColor"></u-icon>
				</view>
			</view>
			<!-- 待处理预约 -->
			<view class="card_item">
				<text class="card_title">待处理预约</text>
				<text class="card_value">5<text style="color: #6B7280;font-size: 20rpx;margin-left: 10rpx;">单</text></text>
				<view style="display: flex;align-items: center;">
					<u-icon name="info-circle-fill" color="#F97316" size="12"></u-icon>
					<text class="other_text" style="color: #F97316;">需及时处理</text>
				</view>
				<view class="right_icon">
					<u-icon name="clock-fill" size="14" :color="ThemeColor.PrimaryColor"></u-icon>
				</view>
			</view>
			<!-- 本月收入 -->
			<view class="card_item">
				<text class="card_title">本月收入</text>
				<text class="card_value">15,280<text style="color: #6B7280;font-size: 20rpx;margin-left: 10rpx;">元</text></text>
				<view style="display: flex;align-items: center;">
					<u-icon name="arrow-upward" color="#22C55E" size="12"></u-icon>
					<text class="other_text" style="color: #22C55E;">月同比 +15%</text>
				</view>
				<view class="right_icon">
					<u-icon name="rmb" size="16" :color="ThemeColor.PrimaryColor"></u-icon>
				</view>
			</view>
			<!-- 综合评分 -->
			<view class="card_item">
				<text class="card_title">综合评分</text>
				<text class="card_value">4.9<text style="color: #6B7280;font-size: 20rpx;margin-left: 10rpx;">分</text></text>
				<view style="display: flex;align-items: center;">
					<u-icon name="thumb-up-fill" color="#3B82F6" size="12"></u-icon>
					<text class="other_text" style="color: #3B82F6;">好评 98%</text>
				</view>
				<view class="right_icon">
					<u-icon name="star-fill" size="15" :color="ThemeColor.PrimaryColor"></u-icon>
				</view>
			</view>
		</view>
	
		<!-- 今日安排 -->
		<view class="toDay">
			<u-cell-group :border="false">
			    <u-cell title="今日课程安排" :titleStyle="{fontSize: '28rpx', fontWeight: 500}" center :border="false">
						<text slot="icon" class="title_before"></text>
						<text slot="value" style="color: #4B5563;font-size: 24rpx;">查看完整课程</text>
					</u-cell>
			</u-cell-group>
			
			<view class="courseList">
				<view class="courseItem">
					<view class="dis-flex flex-dir-column flex-gap10 flex-y-center">
						<text class="family-number col-0 f-w-500 f-24">09:00</text>
						<text class="f-22" style="color: #6B7280;">上午</text>
					</view>
					<view class="dis-flex flex-dir-column flex-gap10">
						<view class="dis-flex flex-y-center">
							<text class="state-success">已确认</text>
							<text class="f-w-500 f-24 m-l-20">私教课程·力量训练</text>
						</view>
						<view class="dis-flex flex-y-center">
							<text class="f-22" style="color: #4B5563;">学员:王新旭</text>
							<text style="width: 1px;height: 20rpx;background-color: #4B5563;margin: 0 4rpx;"></text>
							<text class="f-22" style="color: #4B5563;">时长:60分钟</text>
						</view>
					</view>
				</view>
				<view class="courseItem" style="background-color: #fff;">
					<view class="dis-flex flex-dir-column flex-gap10 flex-y-center">
						<text class="family-number col-0 f-w-500 f-24">11:00</text>
						<text class="f-22" style="color: #6B7280;">上午</text>
					</view>
					<view class="dis-flex flex-dir-column flex-gap10">
						<view class="dis-flex flex-y-center">
							<text class="state-primary">待确认</text>
							<text class="f-w-500 f-24 m-l-20">团体教程·瑜伽基础</text>
						</view>
						<view class="dis-flex flex-y-center">
							<text class="f-22" style="color: #4B5563;">学员:团体课(6人)</text>
							<text style="width: 1px;height: 20rpx;background-color: #4B5563;margin: 0 4rpx;"></text>
							<text class="f-22" style="color: #4B5563;">时长:60分钟</text>
						</view>
					</view>
				</view>
				<view class="courseItem">
					<view class="dis-flex flex-dir-column flex-gap10 flex-y-center">
						<text class="family-number col-0 f-w-500 f-24">15:00</text>
						<text class="f-22" style="color: #6B7280;">下午</text>
					</view>
					<view class="dis-flex flex-dir-column flex-gap10">
						<view class="dis-flex flex-y-center">
							<text class="state-success">已确认</text>
							<text class="f-w-500 f-24 m-l-20">私教课程·体态矫正</text>
						</view>
						<view class="dis-flex flex-y-center">
							<text class="f-22" style="color: #4B5563;">学员:林雨晴</text>
							<text style="width: 1px;height: 20rpx;background-color: #4B5563;margin: 0 4rpx;"></text>
							<text class="f-22" style="color: #4B5563;">时长:60分钟</text>
						</view>
					</view>
				</view>
			</view>
		
		</view>
	
		<!-- 学员反馈 -->
		<view class="studentBack">
			<u-cell-group :border="false">
			    <u-cell title="学员反馈" :titleStyle="{fontSize: '28rpx', fontWeight: 500}" center :border="false">
						<text slot="icon" class="title_before"></text>
						<text slot="value" style="color: #4B5563;font-size: 24rpx;">查看全部</text>
					</u-cell>
			</u-cell-group>
			
			<view class="backList">
				<view class="backItem">
					<view class="dis-flex flex-gap20 mb-10">
						<u-avatar src="https://xfwbzs.crgx.net/static/img/profile.473f5971.jpg" size="36"></u-avatar>
						<view class="dis-flex flex-dir-column flex-gap10">
							<text class="f-24 col-0 f-w-500">林雨晴</text>
							<u-rate :count="count" v-model="value" :readonly="true" activeColor="#FACC15" size="12" :allowHalf="true"></u-rate>
						</view>
					</view>
					<text class="f-24 u-line-2" style="color: #4B5563;">教练非常专业,针对我的情况制定了很合适的训练计划,每次训练都有收货</text>
				</view>
				<view class="backItem">
					<view class="dis-flex flex-gap20 mb-10">
						<u-avatar src="https://xfwbzs.crgx.net/static/img/profile.473f5971.jpg" size="36"></u-avatar>
						<view class="dis-flex flex-dir-column flex-gap10">
							<text class="f-24 col-0 f-w-500">张志远</text>
							<u-rate :count="count" v-model="value" :readonly="true" activeColor="#FACC15" size="12" :allowHalf="true"></u-rate>
						</view>
					</view>
					<text class="f-24 u-line-2" style="color: #4B5563;">教练很有耐心,动作讲解很细致,让我对健身有更深的理解</text>
				</view>
			</view>
		</view>
	
		<!-- 最近订单 -->
		<view class="newOrder">
			<u-cell-group :border="false">
			    <u-cell title="最近订单" :titleStyle="{fontSize: '28rpx', fontWeight: 500}" center :border="false">
						<text slot="icon" class="title_before"></text>
						<text slot="value" style="color: #4B5563;font-size: 24rpx;">查看全部</text>
					</u-cell>
			</u-cell-group>
			
			<view class="orderList">
				<view class="orderItem">
					<view class="dis-flex flex-x-between flex-y-center mb-10">
						<view class="dis-flex flex-gap20 mb-10">
							<u-avatar src="https://xfwbzs.crgx.net/static/img/profile.473f5971.jpg" size="36"></u-avatar>
							<view class="dis-flex flex-dir-column flex-gap10">
								<text class="f-24 col-0">刘天成</text>
								<text class="state-success">已确认</text>
							</view>
						</view>
						<text class="right_btn">查看详情</text>
					</view>
					<view class="dis-flex flex-y-center flex-gap10 f-24" style="color: #4B5563;">
						<text>私教课程·增肌计划</text>
						<text>2025-03-27 10:00</text>
					</view>
				</view>
				<view class="orderItem">
					<view class="dis-flex flex-x-between flex-y-center mb-10">
						<view class="dis-flex flex-gap20 mb-10">
							<u-avatar src="https://xfwbzs.crgx.net/static/img/profile.473f5971.jpg" size="36"></u-avatar>
							<view class="dis-flex flex-dir-column flex-gap10">
								<text class="f-24 col-0">赵雪莹</text>
								<text class="state-primary">待确认</text>
							</view>
						</view>
						<text class="right_btn">确认预约</text>
					</view>
					<view class="dis-flex flex-y-center flex-gap10 f-24" style="color: #4B5563;">
						<text>私教课程·减脂塑形</text>
						<text>2025-03-27 10:00</text>
					</view>
				</view>
			</view>
		</view>
		<CommonTabbar />
	</view>
</template>

<script>
	import ThemeColor from '@/utils/themeColor.js'
	export default {
		data() {
			return {
				ThemeColor,
				count: 5,
				value: 4.5,
				dataList: [
					{ title: '今日订单', value: 12, iconName: 'calendar-fill', other: 2, otherIcon: 'arrow-upward', otherText: `较昨日 + `, textColor: '#22C55E' },
					{ title: '待处理预约', value: 5, iconName: 'clock-fill', other: '', otherIcon: 'info-circle-fill', otherText: `需及时处理`, textColor: '#F97316' },
					{ title: '本月收入', value: 15280, iconName: 'rmb', other: '15%', otherIcon: 'arrow-upward', otherText: `月同比 + `, textColor: '#22C55E' },
					{ title: '综合评分', value: 4.9, iconName: 'star-fill', other: '98%', otherIcon: 'thumb-up-fill', otherText: `好评`, textColor: '#3B82F6' }
				]
			};
		}
	}
</script>

<style lang="scss" scoped>
.home_container{
	background-color: #fff;
	min-height: calc(100vh - 88rpx);
	padding-bottom: 60rpx;
}

.nav_header{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10rpx 30rpx;
	background-color: #fff;
	border-bottom: 1px solid #eee;
	.left_box{
		display: flex;
		align-items: center;
		gap: 15rpx;
		.avatar_img{
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
		}
		.title{
			font-size: 32rpx;
			color: #000;
			font-weight: 500;
			line-height: 40rpx;
		}
		.tag{
			font-size: 24rpx;
			color: #6b7280;
		}
	}
	.right_box{
		position: relative;
		.notice{
			position: absolute;
			top: -4rpx;
			right: 4rpx;
			width: 30rpx;
			height: 30rpx;
			font-size: 20rpx;
			background-color: red;
			color: #fff;
			border-radius: 50%;
			text-align: center;
			line-height: 30rpx;
		}
	}
}

.data_card{
	display: grid;
	grid-template-columns: repeat(2, 1fr); /* 两列,每列占等分 */
	grid-template-rows: repeat(2, 1fr);     /* 两行,每行占等分 */
	gap: 20rpx; /* 单元格间距 */
	margin-top: 20rpx;
	padding: 0 30rpx;
	.card_item{
		position: relative;
		display: flex;
		flex-direction: column;
		gap: 10rpx;
		padding: 20rpx;
		justify-content: space-around;
		background-color: #fff;
		border-radius: 20rpx;
		box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 4rpx 0px;
		.card_title{
			font-size: 24rpx;
			color: #4B5563;
		}
		.card_value{
			color: #000;
			font-size: 32rpx;
			font-weight: 500;
			font-family: SemiBold, Verdana, Georgia, Times, 'Times New Roman', serif;
		}
		
		.other_text{
			font-size: 20rpx;
			margin-left: 10rpx;
		}
		.right_icon{
			position: absolute;
			top: 20rpx;
			right: 20rpx;
		}
	}
}

.toDay, .studentBack, .newOrder{
	padding: 0 30rpx;
	margin-top: 20rpx;
}
.courseList, .backList, .orderList{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10rpx;
	padding: 20rpx;
	box-shadow: rgba(17, 17, 26, 0.04) 0px 1px 0px;
	border-radius: 10rpx;
	.courseItem{
		display: flex;
		align-items: center;
		gap: 30rpx;
		width: 100%;
		border-radius: 10rpx;
		padding: 20rpx 30rpx;
		background-color: #f4f5fa;
	}
	.backItem{
		width: 100%;
		border-radius: 10rpx;
		padding: 20rpx 30rpx;
		background-color: #f9fafb;
	}
	.orderItem{
		width: 100%;
		border-radius: 10rpx;
		padding: 20rpx 30rpx;
		.right_btn{
			font-size: 24rpx;
			border-radius: 60rpx;
			width: 120rpx;
			height: 50rpx;
			line-height: 50rpx;
			text-align: center;
			background: linear-gradient( 270deg, $uni-color-primary 0%, #FCD723 100%);
			color: #fff;
		}
	}
}
.title_before{
	width: 8rpx;
	height: 32rpx;
	border-radius: 4rpx;
	background-color: $uni-color-primary;
}
</style>