<template>
	<view class="app-custom-root">
		<view class="app-container">
			<!-- 顶部头部区域 -->
			<view class="container-header">
				<view class="header-top">
					<view class="header-btnLf button-click" @click="seemsg(1)" :class="{ active: state.current === 1 }">
						线上招聘会
					</view>
					<view class="header-btnLf button-click" @click="seemsg(2)" :class="{ active: state.current === 2 }">
						线下招聘会
					</view>
					<view class="header-btnLf button-click" @click="seemsg(3)" :class="{ active: state.current === 3 }">
						我参与的
					</view>
					<!-- <view class="header-btnLf button-click" @click="navTo('/packageB/login')">
						登录
					</view> -->
				</view>
				<view class="header-input btn-feel">
					<uni-icons class="iconsearch" color="#666666" type="search" size="18"
						@click="getFair('refresh')"></uni-icons>
					<input class="input" placeholder="招聘会" placeholder-class="inputplace"
						v-model="pageState.jobFairTitle" />
					<view class="btn-feel" v-show="state.current != 3" @click="openFilter">筛选</view>
				</view>
			</view>
			 <uni-popup
				ref="selectFilterModel"
				type="bottom"
				borderRadius="10px 10px 0 0"
				background-color="#FFFFFF"
				class="popup-fix"
			>
				<view class="popup-content">
					<view class="popup-list">
						<view class="content-wrapper">
							<!-- 左侧筛选类别 -->
							<!-- <scroll-view class="filter-nav" scroll-y>
								<view
									v-for="(item, index) in filterOptions"
									:key="index"
									class="nav-item button-click"
									:class="{ active: activeTab === item.key }"
									@click="scrollTo(item.key)"
								>
									{{ item.label }}
								</view>
							</scroll-view> -->

							<!-- 右侧筛选内容 -->
							<scroll-view class="filter-content" :scroll-into-view="activeTab" scroll-y>
								<view v-for="(item, index) in filterOptions" :key="index">
									<view class="content-item">
										<view class="item-title" :id="item.key">{{ item.label }}</view>
										<radio-group class="check-content" @change="handleSelect">
											<label
												v-for="option in item.options"
												:key="option.value"
												class="checkbox-item button-click"
												:class="{
													checkedstyle: selectedValues === String(option.value),
												}"
											>
												<radio
													style="display: none"
													:value="String(option.value)"
													:checked="selectedValues === String(option.value)"
												/>
												<text class="option-label">{{ option.label }}</text>
											</label>
										</radio-group>
									</view>
								</view>
							</scroll-view>
						</view>
					</view>
					<view class="popup-bottom">
						<view class="btn-cancel btn-feel" @click="cleanup">重置</view>
						<view class="btn-confirm btn-feel" @click="confirm">确认</view>
					</view>
				</view>
			</uni-popup>
			<!-- 主体内容区域 -->
			<view class="container-main">
				<scroll-view scroll-y class="main-scroll" :class="{fullHeightScroll:!showTabar}" @scrolltolower="handleScrollToLower">
					<view class="cards" v-if="fairList.length">
						<view class="card press-button" v-for="(item, index) in fairList" :key="index"
							@click="goDetail(item.jobFairId)">
							<view class="center-date"
								:style="{ color: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color,borderColor: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color  }">
								{{ getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).statusText }}
							</view>
							<view class="card-title">
								{{ item.jobFairTitle }}
								
							</view>
							<view class="card-row">
								<text class="">{{ item.jobFairAddress }}</text>
							</view>
							<view class="card-times">
								<view class="time-left">
									<view class="left-date">
										{{parseDateTime(item.jobFairStartTime).time}}
									</view>
									<view class="left-dateDay">
										{{parseDateTime(item.jobFairStartTime).date}}
									</view>
								</view>
								<view class="line"></view>
								<view class="time-center">
									<view class="center-dateDay">
										{{getHoursBetween(item.jobFairStartTime,item.jobFairEndTime)}}小时
									</view>
								</view>
								<view class="line"></view>
								<view class="time-right">
									<view class="left-date">
										{{parseDateTime(item.jobFairEndTime).time}}
									</view>
									<view class="left-dateDay">
										{{parseDateTime(item.jobFairEndTime).date}}
									</view>
								</view>
							</view>
							<view class="recommend-card-line"></view>
							<view class="card-footer">内容简介：{{ item.jobFairIntroduction || "暂无" }}</view>
						</view>
					</view>
					<empty v-else pdTop="200"></empty>
				</scroll-view>
			</view>
			<!-- 自定义tabbar -->
			<template v-if="showTabar">
				<CustomTabBar :currentPage="5" />
			</template>

			<!-- 微信授权登录弹窗 -->
			<!-- <WxAuthLogin ref="wxAuthLoginRef" @success="handleLoginSuccess"></WxAuthLogin> -->
		</view>
	</view>
</template>

<script setup>
	import {
		reactive,
		inject,
		watch,
		ref,
		onMounted,
		onUnmounted
	} from "vue";
	import {
		onLoad,
		onShow
	} from "@dcloudio/uni-app";
	import useLocationStore from "@/stores/useLocationStore";
	import {
		storeToRefs
	} from "pinia";
	import {
		tabbarManager
	} from "@/utils/tabbarManager";

	import config from "@/config.js";
	// import CryptoJS from 'crypto-js'
	const {
		longitudeVal,
		latitudeVal
	} = storeToRefs(useLocationStore());
	// const wxAuthLoginRef = ref(null);
	const {
		$api,
		navTo,
		cloneDeep
	} = inject("globalFunction");
	const isLogin = ref(false);
	const weekList = ref([]);
	const fairList = ref([]);
	const currentDay = ref({});
	const userInfo = ref({});
	const state = reactive({
		current: 1,
		all: [{}],
	});
	const pageState = reactive({
		pageNum: 0,
		total: 0,
		maxPage: 2,
		pageSize: 10,
		jobFairTitle: "",
	});
	const baseUrl = config.imgBaseUrl;
	const showTabar = ref(false);
	onLoad(async () => {
		// const today = new Date();
		// const year = today.getFullYear();
		// const month = String(today.getMonth() + 1).padStart(2, '0');
		// const day = String(today.getDate()).padStart(2, '0');

		// const currentDate = `${year}-${month}-${day}`;
		// const result = getNextDates({
		//     startDate: currentDate,
		// });
		// weekList.value = result;
		getHeart();
	});

	onShow(() => {
		// 更新自定义tabbar选中状态
		tabbarManager.updateSelected(1);
		getoptions();
	});//
	//筛选
	const filterOptions = ref([]);
	const activeTab = ref('');
	const selectFilterModel = ref(null);
	const selectedValues = ref(null);
	function openFilter() {
		selectFilterModel.value?.open();
	}
	const scrollTo = (key) => {
		activeTab.value = key;
	};

	const handleSelect = (e) => {
		selectedValues.value = e.detail.value
	};
	function cleanup(){
		selectedValues.value = null
		confirm()
	}
	function confirm(){
		getFair("refresh");
		selectFilterModel.value?.close();
	}
	function getoptions() {
		let headers = {
			'Content-Type': 'application/x-www-form-urlencoded',
		}
		let params = {
			dictType:'administrative_division',
			dictParentValue:'653100000000',
			childFlag:'1',
		}
		filterOptions.value = [{
				label: '所在区域',
				key: 'area',
				options: []
		}];
		$api.myRequest('/system/public/dict/data/getByParentValue',params,'POST',9100,headers).then(res=>{
			if (res.code == 200) {
				filterOptions.value[0].options = res.data.map(item=>{
					return {
						label: item.dictLabel,
						value: item.dictValue,
					}
				})
			}
		})
		activeTab.value = 'area';
	}
	async function thirdLogin(needToast){
		let form={}
		if (uni.getStorageSync('userInfo') && (uni.getStorageSync('userInfo').isCompanyUser=='1' || uni.getStorageSync('userInfo').isCompanyUser=='2')) {
			form={
				usertype: '1',
				idno: uni.getStorageSync('userInfo').idCard,
				name: uni.getStorageSync('userInfo').name,
				enterprisecode:"",
				enterprisename: "",
				contactperson: "",
				contactphone: "",
			}
			//用户信息加密方法待更新
			// let key = '9zS+DFKrzxvosO82mTcPJQ=='
			// let secretKey = CryptoJS.enc.Utf8.parse(key);//key  为你的秘钥
			// let srcs = CryptoJS.enc.Utf8.parse(form.idno);
			// let encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
			// form.idno=encrypted
		}else if (uni.getStorageSync('userInfo') && uni.getStorageSync('userInfo').isCompanyUser=='0') {
			form={
				usertype: "2",
				enterprisecode: uni.getStorageSync('userInfo').idCard,
				enterprisename: uni.getStorageSync('userInfo').name,
				contactperson: "",
				contactphone: "",
				idno: "",
				name: ""
			}
		}else{
			if(needToast){
				uni.showToast({
					icon: 'none',
					title: '请先登录'
				})
			}
			return false;
		}
		var resLogin = await $api.myRequest('/auth/login2/ks',form,'post',10100);
		if (resLogin.code=='200') {
			uni.setStorageSync('Padmin-Token', resLogin.data.access_token)
			isLogin.value = true;
			return true;
		}else{
			uni.showToast({
				icon: 'none',
				title: '单点异常'
			})
			return false;
		}
	}

	// onMounted(() => {
	// 	// 监听退出登录事件，显示微信登录弹窗
	// 	uni.$on("showLoginModal", () => {
	// 		wxAuthLoginRef.value?.open();
	// 	});
	// });
	watch(() => userInfo.value.userType, (newVal) => {
		if(newVal=='ent'){
			showTabar.value = true
		}else{
			showTabar.value = false
		}
	},{ immediate: true ,deep: true})
	// onUnmounted(() => {
	// 	uni.$off("showLoginModal");
	// });

	// 登录成功回调
	const handleLoginSuccess = () => {
		console.log("登录成功");
		// 可以在这里添加登录成功后的处理逻辑
	};

	async function goDetail(jobFairId){
			if(state.current != 3 ){
				await thirdLogin()
				navTo('/packageA/pages/exhibitors/exhibitors?jobFairId=' + jobFairId)
			}else{
				if(await thirdLogin('1')){
					if(userInfo.value){
						if(userInfo.value.userType=='ent'){
							navTo('/packageB/jobFair/detailCom?jobFairId=' + jobFairId)
						}else{
							navTo('/packageB/jobFair/detailPerson?jobFairId=' + jobFairId)
						}
					}
				}
			}
	}

	function toSelectDate() {
		navTo("/packageA/pages/selectDate/selectDate", {
			query: {
				date: currentDay.value.fullDate,
			},
			onBack: (res) => {
				const result = getNextDates({
					startDate: res.date,
				});
				const formattedDate = res.date.slice(5); // MM-DD
				const dateFull = {
					date: res.date.slice(5),
					day: "周" + res.week,
					fullDate: res.date,
				};
				currentDay.value = dateFull;
				weekList.value = result;
				getFair("refresh");
			},
		});
	}
	// 查看消息类型
	function changeSwiperMsgType(e) {
		const currented = e.detail.current;
		state.current = currented;
	}

	async function seemsg(index) {
		if (index != 3) {
			state.current = index;
			getFair("refresh");
		} else {
			if(await thirdLogin('1')){
				if (!isLogin.value) {
					getHeart();
					return;
				}
				state.current = index;
				// 确保获取到用户信息后再请求“我参与的”列表
				if (!userInfo.value?.info?.userId) {
					getUser().then(() => {
						getMyFair("refresh");
					});
				} else {
					getMyFair("refresh");
				}
			}
		}
	}

	const handleScrollToLower = () => {
		if (pageState.pageNum >= pageState.maxPage) {
			return;
		} else {
			if (state.current != 3) {
				getFair();
			} else {
				this.$nextTick(() => {
					getMyFair();
				});
			}
		}
	};

	async function getHeart() {


		const raw = uni.getStorageSync("Padmin-Token");
		const token = typeof raw === "string" ? raw.trim() : "";

		var isLogins = await thirdLogin();

		const headers = token ? {
			Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
		} : {};


		$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
			if (isLogins) {
				isLogin.value = true;
				getUser();
			} else {
				isLogin.value = false;
				getFair("refresh");
			}
		});
	}

	function getUser() {
		const raw = uni.getStorageSync("Padmin-Token");
		const token = typeof raw === "string" ? raw.trim() : "";
		const headers = token ? {
			Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
		} : {};

		return $api.myRequest("/system/user/login/user/info", {}, "GET", 10100, headers).then((resData) => {
			// 正确映射响应为用户信息（优先使用 data 字段）
			const data = resData?.data ?? resData;
			userInfo.value = data || {};
			if(data?.info?.entCreditCode && data?.info?.userId){
				updateEnterpriseId({
					unifiedSocialCreditCode: data?.info?.entCreditCode,
					userId: data?.info?.userId,
				})
			}
			getFair("refresh");
			return userInfo.value;
		});
	}
	function updateEnterpriseId(params){
		const headers = {
			'Content-Type':'application/json'
		}
		return $api.myRequest("/jobfair/public/job-fair-sign-up-enterprise/update-enterprise-id", params, "POST", 9100, headers).then((resData) => {
			if(resData.code == 200 && resData.data !=0){
				state.current = 3
				getMyFair("refresh");
			}
		});
	}
	function getMyFair(type = "add") {
		if (type === "refresh") {
			pageState.pageNum = 1;
			pageState.maxPage = 1;
		}
		if (type === "add" && pageState.pageNum < pageState.maxPage) {
			pageState.pageNum += 1;
		}
		let params = {
			pageNum: pageState.pageNum,
			pageSize: pageState.pageSize,
			jobFairTitle: pageState.jobFairTitle,
		};
		if (isLogin.value) {
			console.log(userInfo, 'userInfo');
			if (userInfo.value.userType == "ent") {
				params.enterpriseId = userInfo.value.info.userId;
				$api.myRequest("/jobfair/public/jobfair/enterprise/my-sign-up-job-fair", params).then((resData) => {
					if (type === "add") {
						const reslist = resData.data.list;
						fairList.value = fairList.value.concat(reslist);
					} else {
						fairList.value = resData.data.list;
					}
					pageState.total = resData.data.total;
					pageState.maxPage = resData.data.pages;
				});
			} else {
				params.personId = userInfo.value.info.userId;
				$api.myRequest("/jobfair/public/jobfair/person/my-sign-up-job-fair", params).then((resData) => {
					if (type === "add") {
						const reslist = resData.data.list;
						fairList.value = fairList.value.concat(reslist);
					} else {
						fairList.value = resData.data.list;
					}
					pageState.total = resData.data.total;
					pageState.maxPage = resData.data.pages;
				});
			}
			console.log(params, 'params');
		} else {
			$api.msg('请先登录');
		}
	}

	function getFair(type = "add") {
		if (type === "refresh") {
			pageState.pageNum = 1;
			pageState.maxPage = 1;
		}
		if (type === "add" && pageState.pageNum < pageState.maxPage) {
			pageState.pageNum += 1;
		}
		let params = {
			pageNum: pageState.pageNum,
			pageSize: pageState.pageSize,
			jobFairTitle: pageState.jobFairTitle,
			jobFairType: state.current,
			dictValue: selectedValues.value,
		};
		if (isLogin.value) {
			if (userInfo.value.userType == "ent") {
				params.enterpriseId = userInfo.value.info.userId;
			} else {
				params.personId = userInfo.value.info.userId;
			}
		}
		$api.myRequest("/jobfair/public/jobfair/page", params).then((resData) => {
			if (type === "add") {
				const reslist = resData.data.list;
				fairList.value = fairList.value.concat(reslist);
			} else {
				fairList.value = resData.data.list;
			}
			pageState.total = resData.data.total;
			pageState.maxPage = resData.data.pages;
		});
	}

	function toIOSDate(input) {
		if (!input) return null;
		if (input instanceof Date) return isNaN(input.getTime()) ? null : input;
		if (typeof input === "number") {
			const d = new Date(input);
			return isNaN(d.getTime()) ? null : d;
		}
		if (typeof input !== "string") return null;
		let s = input.trim();
		// "YYYY-MM-DD HH:mm[:ss]" -> "YYYY-MM-DDTHH:mm[:ss]"
		if (/^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}(:\d{2})?$/.test(s)) {
			s = s.replace(" ", "T");
			// 仅到分钟则补秒
			if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(s)) {
				s = s + ":00";
			}
		}
		// 其余已是 iOS 可解析格式："YYYY/MM/DD[ HH:mm:ss]"、"YYYY-MM-DD"、ISO 8601 等
		const d = new Date(s);
		return isNaN(d.getTime()) ? null : d;
	}

	function parseDateTime(datetimeStr) {
		if (!datetimeStr)
			return {
				time: "",
				date: "",
			};

		const dateObj = toIOSDate(datetimeStr);

		if (!dateObj)
			return {
				time: "",
				date: "",
			}; // 无效时间

		const year = dateObj.getFullYear();
		const month = String(dateObj.getMonth() + 1).padStart(2, "0");
		const day = String(dateObj.getDate()).padStart(2, "0");
		const hours = String(dateObj.getHours()).padStart(2, "0");
		const minutes = String(dateObj.getMinutes()).padStart(2, "0");

		return {
			time: `${hours}:${minutes}`,
			date: `${year}年${month}月${day}日`,
		};
	}

	function getTimeStatus(startTimeStr, endTimeStr) {
		const now = new Date();
		const startTime = toIOSDate(startTimeStr);
		const endTime = toIOSDate(endTimeStr);

		if (!startTime || !endTime) {
			return {
				status: 1,
				statusText: "时间异常",
				color: "#999999"
			};
		}

		// 判断状态：0 开始中，1 过期，2 未开始
		let status = 0;
		let statusText = "开始中";
		let color = "#13C57C"; // 进行中 - 绿色
		if (now < startTime) {
			status = 2; // 未开始
			statusText = "未开始";
			color = "#015EEA"; // 未开始 - 蓝色
		} else if (now > endTime) {
			status = 1; // 已过期
			statusText = "已过期";
			color = "#999999"; // 已过期 - 灰色
		} else {
			status = 0; // 进行中
			statusText = "进行中";
			color = "#13C57C"; // 进行中 - 绿色
		}
		return {
			status, // 0: 进行中，1: 已过期，2: 未开始
			statusText,
			color
		};
	}

	function getHoursBetween(startTimeStr, endTimeStr) {
		const start = toIOSDate(startTimeStr);
		const end = toIOSDate(endTimeStr);

		if (!start || !end) return 0;

		const diffMs = end - start;
		const diffHours = diffMs / (1000 * 60 * 60);

		return +diffHours.toFixed(2); // 保留 2 位小数
	}

	const selectDate = (item) => {
		if (currentDay.value?.fullDate === item.fullDate) {
			currentDay.value = {};
			getFair("refresh");
			return;
		}
		currentDay.value = item;
		getFair("refresh");
	};

	function getNextDates({
		startDate = "",
		count = 6
	}) {
		const baseDate = startDate ? toIOSDate(startDate) || new Date() : new Date(); // 指定起点或今天
		const dates = [];
		const dayNames = ["日", "一", "二", "三", "四", "五", "六"];

		for (let i = 0; i < count; i++) {
			const date = new Date(baseDate);
			date.setDate(baseDate.getDate() + i);

			const fullDate = date.toISOString().slice(0, 10); // YYYY-MM-DD
			const formattedDate = fullDate.slice(5); // MM-DD
			const dayOfWeek = dayNames[date.getDay()];

			dates.push({
				date: formattedDate,
				fullDate,
				day: "周" + dayOfWeek,
			});
		}

		// 可选设置默认选中项
		// currentDay.value = dates[0];

		return dates;
	}
</script>
<style lang="scss" scoped>
.popup-fix {
    z-index: 9999 !important;
}
.popup-content {
    color: #000000;
    height: 70vh;
	padding-bottom: 20rpx;
}
.popup-bottom {
    padding: 40rpx 28rpx 20rpx 28rpx;
    display: flex;
    justify-content: space-between;
    .btn-cancel {
        font-weight: 400;
        font-size: 32rpx;
        color: #666d7f;
        line-height: 90rpx;
        width: 33%;
        min-width: 222rpx;
        height: 90rpx;
        background: #f5f5f5;
        border-radius: 12rpx 12rpx 12rpx 12rpx;
        text-align: center;
    }
    .btn-confirm {
        font-weight: 400;
        font-size: 32rpx;
        color: #ffffff;
        text-align: center;
        width: 67%;
        height: 90rpx;
        margin-left: 28rpx;
        line-height: 90rpx;
        background: #256bfa;
        min-width: 444rpx;
        border-radius: 12rpx 12rpx 12rpx 12rpx;
    }
}
.popup-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-evenly;
    height: calc(77vh - 100rpx - 150rpx);
    overflow: hidden;
    .picker-view {
        width: 100%;
        height: 500rpx;
        margin-top: 20rpx;
        .uni-picker-view-mask {
            background: rgba(0, 0, 0, 0);
        }
        .item {
            line-height: 84rpx;
            height: 84rpx;
            text-align: center;
            font-weight: 400;
            font-size: 32rpx;
            color: #cccccc;
        }
        .item-active {
            color: #333333;
        }
        .uni-picker-view-indicator:after {
            border-color: #e3e3e3;
        }
        .uni-picker-view-indicator:before {
            border-color: #e3e3e3;
        }
    }
    // .list {
    //     .row {
    //         font-weight: 400;
    //         font-size: 32rpx;
    //         color: #333333;
    //         line-height: 84rpx;
    //         text-align: center;
    //     }
    // }
}

.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: 100%;
}

.filter-nav {
    width: 200rpx;
    background-color: #ffffff;

    .nav-item {
        height: 100rpx;
        line-height: 100rpx;
        text-align: center;
        font-weight: 400;
        font-size: 28rpx;
        color: #666d7f;
        &.active {
            font-weight: 500;
            font-size: 28rpx;
            color: #256bfa;
        }
    }
}

.filter-content {
    flex: 1;
    padding: 20rpx;
    background-color: #f6f6f6;

    .content-item {
        margin-top: 30rpx;
        .item-title {
            font-weight: 400;
            font-size: 28rpx;
            color: #333333;
            margin-bottom: 15rpx;
        }
    }
    .content-item:first-child {
        margin-top: 0rpx;
    }

    .check-content {
        display: grid;
        gap: 16rpx;
        grid-template-columns: repeat(auto-fill, minmax(300rpx, 1fr));
        place-items: stretch;

        .checkbox-item {
            display: flex;
            align-items: center;
            text-align: center;
            background-color: #d9d9d9;

            min-width: 0;
            padding: 0 10rpx;
            height: 80rpx;
            background: #e8eaee;
            border-radius: 12rpx 12rpx 12rpx 12rpx;

            .option-label {
                font-size: 28rpx;
                width: 100%;
                white-space: nowrap;
                overflow: hidden;
            }
        }
        .checkedstyle {
            height: 76rpx;
            background: rgba(37, 107, 250, 0.06);
            border-radius: 12rpx 12rpx 12rpx 12rpx;
            border: 2rpx solid #256bfa;
            color: #256bfa;
        }
    }
}
</style>
<style scoped lang="stylus">
	.app-custom-root {
		position: fixed;
		z-index: 10;
		width: 100vw;
		height: calc(100% - var(--window-bottom));
		overflow: hidden;
	}

	.app-container {
		display: flex;
		flex-direction: column;
		height: 100%;
		width: 100%;
	}

	.app-container .container-header {
		// background: url("@/static/icon/background2.png") 0 0 no-repeat;
		background-size: 100% 400rpx;
	}

	.app-container .container-header .header-top {
		display: flex;
		line-height: calc(88rpx - 14rpx);
		padding: 16rpx 44rpx 14rpx 44rpx;
	}

	.app-container .container-header .header-top .header-btnLf {
		display: flex;
		white-space: nowrap;
		justify-content: flex-start;
		align-items: center;
		width: calc(60rpx * 3);
		font-weight: 500;
		font-size: 40rpx;
		color: #696969;
		margin-right: 44rpx;
		position: relative;
	}

	.app-container .container-header .header-top .header-btnLf .btns-wd {
		position: absolute;
		top: 2rpx;
		right: 2rpx;
		width: 16rpx;
		height: 16rpx;
		background: #f73636;
		border-radius: 50%;
		border: 4rpx solid #eeeeff;
	}

	.app-container .container-header .header-top .active {
		font-weight: 600;
		font-size: 40rpx;
		color: #000000;
	}

	.app-container .container-header .header-input {
		padding: 0 24rpx;
		width: calc(100% - 48rpx);
		position: relative;
		display: flex;
		align-items: center;
	}

	.app-container .container-header .header-input .iconsearch {
		position: absolute;
		left: 50rpx;
		top: 50%;
		transform: translate(0, -50%);
	}

	.app-container .container-header .header-input .input {
		padding: 0 30rpx 0 80rpx;
		height: 80rpx;
		background: #ffffff;
		border-radius: 75rpx;
		font-size: 28rpx;
		flex:1
	}

	.app-container .container-header .header-input .inputplace {
		font-weight: 400;
		font-size: 28rpx;
		color: #b5b5b5;
	}
	.app-container .container-header .header-input .btn-feel {
		font-weight: 400;
		font-size: 28rpx;
		text-align: center;
		color: #484444;
		width: 80rpx;
	}
	.app-container .container-header .header-date {
		padding: 28rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.app-container .container-header .header-date .data-week {
		flex: 1;
		display: flex;
		justify-content: space-between;
		flex-wrap: nowrap;
		overflow: hidden;
	}

	.app-container .container-header .header-date .data-week .weel-days {
		font-family: "PingFangSC-Medium", "PingFang SC", "Helvetica Neue", Helvetica,
			Arial, "Microsoft YaHei", sans-serif;
		display: flex;
		justify-content: center;
		flex-direction: column;
		text-align: center;
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		width: 96rpx;
		height: 88rpx;
	}

	.app-container .container-header .header-date .data-week .weel-days .day {
		font-weight: 500;
	}

	.app-container .container-header .header-date .data-week .active {
		background: rgba(37, 107, 250, 0.1);
		border-radius: 12rpx;
		color: #256bfa;
	}

	.app-container .container-header .header-date .data-all {
		width: 66rpx;
		height: 66rpx;
		margin-left: 18rpx;
	}

	.app-container .container-header .header-date .data-all .allimg {
		width: 100%;
		height: 100%;
	}

	.container-main {
		flex: 1;
		overflow: hidden;
		background-color: #f4f4f4;
	}

	.main-scroll {
		width: 100%;
		height: calc(100% - 150rpx);
	}
	.fullHeightScroll{
		height: 100% !important;
	}
	.cards {
		padding: 28rpx;
	}

	.cards .card {
		margin-top: 28rpx;
		padding: 45rpx 32rpx 32rpx 32rpx;
		background: linear-gradient(to bottom, #e3efff 0%, #fbfdff 100%);
		box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 20rpx;
		position: relative;
		.center-date {
			font-weight: 400;
			font-size: 24rpx;
			position: absolute;
			right: 0;
			top: 0;
			border: 1rpx solid;
			padding: 5rpx 10rpx;
			margin-left: 10rpx;
		}
	}

	.cards .card-title {
		font-family: "PingFangSC-Medium", "PingFang SC", "Helvetica Neue", Helvetica,
			Arial, "Microsoft YaHei", sans-serif;
		font-weight: 600;
		font-size: 34rpx;
		color: #005eb6;
		text-align: center;
		position relative;
		display: flex;
		align-items: center;
		justify-content: center;

		&::after {
			content: "";
			width: 120rpx;
			height: 4rpx;
			background: linear-gradient(to right, #015EEA 0%, #00C0FA 100%);
			position: absolute;
			left: 50%;
			bottom: -14rpx;
			transform: translate(-50%, -50%);
		}

		
	}

	.cards .card-row {
		display: flex;
		justify-content: center;
		font-size: 26rpx;
		color: #3e8ff3;
		margin-top: 23rpx;
	}

	.cards .card-times {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 24rpx;
	}

	.cards .card-times .time-left,
	.cards .card-times .time-right {
		text-align: center;
	}

	.cards .card-times .left-date {
		font-weight: 600;
		font-size: 48rpx;
		font-family: "PingFangSC-Medium", "PingFang SC", "Helvetica Neue", Helvetica,
			Arial, "Microsoft YaHei", sans-serif;
		background: linear-gradient(180deg, #015EEA 0%, #00C0FA 100%);
		-webkit-background-clip: text;
		-webkit-text-fill-color: transparent;
	}

	.cards .card-times .left-dateDay {
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		margin-top: 12rpx;
	}

	.cards .card-times .line {
		width: 40rpx;
		height: 2rpx;
		background: #7BB6FF;
		margin-top: 7rpx;
	}

	.cards .card-times .time-center {
		text-align: center;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}


	.cards .card-times .time-center .center-dateDay {
		font-weight: 400;
		font-size: 24rpx;
		color: #fff;
		margin-top: 6rpx;
		line-height: 48rpx;
		width: max-content;
		height: 48rpx;
		background: #71B1FF;
		border-radius: 8rpx;
		padding: 0 30rpx;
	}

	.cards .recommend-card-line {
		width: 100%;
		height: 0;
		border-radius: 0;
		border-bottom: 2rpx dashed rgba(0, 0, 0, 0.14);
		margin-top: 32rpx;
		position: relative;
	}

	.cards .recommend-card-line::before {
		content: "";
		position: absolute;
		left: 0;
		top: 0;
		transform: translate(-50%, -50%);
		width: 28rpx;
		height: 28rpx;
		background: #f4f4f4;
		border-radius: 50%;
	}

	.cards .recommend-card-line::after {
		content: "";
		position: absolute;
		right: 0;
		top: 0;
		transform: translate(50%, -50%);
		width: 28rpx;
		height: 28rpx;
		background: #f4f4f4;
		border-radius: 50%;
	}

	.cards .card-footer {
		margin-top: 32rpx;
		min-height: 50rpx;
		font-weight: 400;
		font-size: 28rpx;
		color: #6c7282;
		text-align: center;
	}

	.cards .card:first-child {
		margin-top: 0;
	}
</style>
