<template>
	<view class="container">
		<view class="homeHeader">
			<view class="top">
				<view class="one">
					<search
					   ref="searchRef"
						:isSearch="1" 
						:userId="userId"
						:initialQuery.sync="searchQuery"
						@send="getCourseList"
						v-if="showSearch"
					></search>
				</view>
				<view class="two">
					<text class="iconfont icon-gongsi" @click="getIntroduce('center')"></text> 
				</view>
			</view>
			<view class="bottom">
				<view class="content">
					<view class="featureContent">
						<!-- 顶部快捷菜单 -->
						<view class="nav_wrapper">
							<view class="nav_content" v-for="featureItem in featureLists" :key="featureItem.key"
								@click="featureSelect(featureItem)">
								<view class="imgbox">
									<view class="iconfont iconSize" :class="`${featureItem.icon}`"></view>
								</view>
								<view style="font-size: 26rpx;color: #fff;">{{featureItem.name}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="carouselBox">
			<view class="swiperBox">
				<swiper
					style="height:250rpx;"
					circular 
					:indicator-dots="true" 
					:autoplay="true" 
					:interval="3000"
					:duration="1000"
				>
					<swiper-item v-for="(bannerItem,index) in cffpUserInfo.fileUploadItemList" :key="index">
						<view class="swiperItemBox">
							<view class="swiperBtn" @click="jumpUrl(bannerItem.destinationAddress)">
								立即查看
							</view>
							<image class="swiperImg" :src="bannerItem.filePath" mode="widthFix" ></image>
						</view>
					</swiper-item>
				</swiper>
			</view>
			
		</view> -->
		<!-- 产品区域 -->
		<view class="productContainer">
	<!-- 		<view class="productTitle">
				<view class="titleTxt">
					<text style="font-size: 30rpx;font-weight: 500;">推荐产品</text>
					<text class="more" @click="goToCourselist()">更多 <text class="iconfont icon-youjiantou"></text> </text>
				</view>
			</view> -->
			<view class="productList" v-if="cffpCourseInfos.length>0">
			 <courselist :showFlag="false"></courselist>
			  <view class="productListBox">
				
			    <!-- <view class="productListItem" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)"> -->
			      <!-- <view class="top"> -->
					  <!-- <view class="shareBtn" @click.stop="shareProduct"> -->
						  <!-- 分享按钮 -->
						<!--  <text class="iconfont icon-zhuanfa"></text><text>分享赚钱</text>
					  </view> -->
			        <!-- <image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image>
			        <view class="productDesBox">
			          {{item.fileSynopsis}}
			        </view> -->
			      <!-- </view> -->
			 <!--     <view class="bottom" style="text-align: left !important;">
			        <view class="one">
			          {{item.fileTitle}}
			        </view>
			        <view class="two">
			          <text class="price" style="">￥{{item.coursePrice}}</text>
			          <text v-if="Number(item.salesNumber)>0" class="num" >已售{{item.salesNumber}}</text>
			        </view>
			      </view> -->
			    <!-- </view> -->
			  </view>
			</view>
			<view class="productEmpty" v-else>
				暂无数据
			</view>
		</view>
		<!-- 使用封装后的弹窗组件 -->
		    <join-popup 
		      ref="joinPopup"
		      @confirm="gotoApply"
		    ></join-popup>
		
		<!-- <tabBar :currentPage="currentPage"></tabBar> -->
	</view>
	<uni-popup ref="popup" type="top" background-color="#fff">
		<view class="descriptionBox">
			<view class="popupClose">
				<text class="iconfont icon-guanbi" @click="$refs.popup.close()"></text> 
			</view>
			<view class="imageBox">
				<image src="@/static/logo2.png" mode="widthFix" style="width: 120rpx !important;"></image>
			</view>
			<view class="description">
				{{cffpUserInfo.description}}
			</view>
		</view>
		
	</uni-popup>
	<uni-popup ref="applyPopup" type="center" background-color="#fff">
		<view class="applyBox">
			<view style="text-align: right;" @click="$refs.applyPopup.close()">
				<view class="iconfont icon-chahao" ></view>
			</view>
			<view class="applyCon">
				<view style="text-align: center;" >
					<view class="iconfont icon-dianzan" ></view>
				</view>
				
				<view class="title">
					您已加盟为银盾家办合伙人
				</view>
				<view class="applycontent">
					<view class="subtit">
						晋升下一级目标
					</view>
					<view class="" v-if="partnerStatistic.reachPeopleNum>0">
						<view class="">
							<text class="iconfont icon-a-tuandui3 leftIcon" ></text>
							<text>团队有效人数</text>
							
							<text 
								v-if="partnerStatistic.totalPeopleNum<partnerStatistic.reachPeopleNum" 
								class="iconfont icon-weiwancheng rightIcon" 
							></text>
							<text
								v-else
								class="iconfont icon-duihao2 rightIcon" 
							></text>
						</view>
						<view class="num">
							<text  >{{partnerStatistic.totalPeopleNum}} / {{partnerStatistic.reachPeopleNum}}</text>
							<text v-if="partnerStatistic.peopleNum>0">（相差{{partnerStatistic.peopleNum}}人）</text>
						</view>
					</view>
					<view class="" v-if="partnerStatistic.reachSingeSaleNum>0">
						<view class="" >
							<text class="iconfont icon-xiaoshoue leftIcon" ></text>
							<text>个人标准销售累计金额</text>
							<!-- <text class="iconfont icon-duihao2 rightIcon" ></text> -->
							<text
								v-if="partnerStatistic.totalSingeSaleNum<partnerStatistic.reachSingeSaleNum" 
								class="iconfont icon-weiwancheng rightIcon" 
							></text>
							<text
								v-else
								class="iconfont icon-duihao2 rightIcon" 
							></text>
						</view>
						<view class="num">
							<text  >{{partnerStatistic.totalSingeSaleNum.toFixed(2)}}元 / {{partnerStatistic.reachSingeSaleNum.toFixed(2)}}元</text>
						</view>
					</view>
					<view class="" v-if="partnerStatistic.reachSaleNum>0">
						<view class="">
							<text class="iconfont icon-ddailirenshu leftIcon" ></text>
							<text>团队标准销售累计金额</text>
							<!-- <text class="iconfont icon-weiwancheng rightIcon" ></text> -->
							
							<text 
								v-if="partnerStatistic.totalSaleNum<partnerStatistic.reachSaleNum" 
								class="iconfont icon-weiwancheng rightIcon" 
							></text>
							<text
								v-else
								class="iconfont icon-duihao2 rightIcon" 
							></text>
						</view>
						<view class="num">
							<text >{{partnerStatistic.totalSaleNum.toFixed(2)}}元 / {{partnerStatistic.reachSaleNum.toFixed(2)}}元</text>
							<text v-if="partnerStatistic.saleNum>0">（相差{{partnerStatistic.saleNum.toFixed(2)}}元）</text>
						</view>
					</view>
					
				</view>
				
			</view>
		</view>
	</uni-popup>
</template>

<script>
	import dataHandling from "@/util/dataHandling";
	import courselist from '@/pages/courselist/courselist.vue';
	import api from "../../api/api";
	import tabBar from '../../components/tabBar/tabBar.vue';
	import carousel from '@/components/carousel/carousel.vue';
	import search from '@/components/search/search.vue';
	import courseItem from "@/components/courseItem/courseItem.vue";
	import {companyInfo} from "@/environments/environment";
	import JoinPopup from '@/components/commonPopup/JoinPopup.vue';
	export default {
		data() {
			return {
				partnerStatistic:{}, //申请加盟统计
				 showSearch: true,
				searchQuery: '',
				companyFullName : companyInfo.companyFullName,
				cffpCourseInfos: [],
				x: 0,
				y: 0,
				old: {
					x: 0,
					y: 0
				},
				featureLists: [
					{
						key: '02',
						name: '申请加盟',
						icon: 'icon-hezuo',
						link: '/myPackageA/applyFranchise/applyFranchise',
						isOpen: true,
						isApply:true
					},
					{
						key: '07',
						name: '分享产品',
						icon: 'icon-zhuanfa',
						link: '/pages/courselist/courselist',
						isOpen: true,
					},
					
					{
						key: '04',
						name: '邀请加盟',
						icon: 'icon-yaoqing',
						link: '/pages/inviteJoin/inviteJoin',
						isOpen: true,
						isJoin: true
					},
					
				],
				cffpUserInfo: {
					address: '',
					description: '',
					fileUploadItemList: [],
					logo: '',
					name: '',
					type: '' //类型1,区域中心，2工作室
				},
				announcementInfo: null,
				tagIds: 123,
				currentPage: 'index',
				carouselList: [],
				userId: uni.getStorageSync('cffp_userId'),
				shareId: null,
				kefu: '../../static/kefu.png',
				loginornot: true,
				queryName: '',
				loginType : uni.getStorageSync('loginType'),
				userInfo:{} //用户信息
			}
		},
		components: {
			courselist,
			tabBar,
			carousel,
			search,
			courseItem,
			JoinPopup
		},
		
		onShow() {
			this.loginType = uni.getStorageSync('loginType')
			this.init();
			this.showSearch = false;
			  this.$nextTick(() => {
			    this.showSearch = true;
			    this.searchQuery = '';
			  });
			  if(uni.getStorageSync('cffp_userInfo')){
			  	this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
			  }
			  if(uni.getStorageSync('cffp_userId')){
			  	this.userInfo = uni.getStorageSync('cffp_userId')
			  }
			
		},
		onLoad(options) {
			
			//如果用户在其他的地方快捷登录,没有返回到首页,执行此监听方法
			uni.$on('loginUpdate',()=>{
				this.queryAreaCenterInfo();
			})
			
			if (uni.getStorageSync('isLogin')) {
				this.announcementQuery();
				this.courseList();
			}
		},
		
		beforeDestroy() {
		  // 清除事件监听
		  uni.$off('loginUpdate', this.queryAreaCenterInfo);
		},
		methods: {
			queryInfo() {
				api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
					
					// 保存用户得个人信息
					if (res['success']) {
						const cffp_userInfo = {
							name: res['data']['realName'],
							mobile: res['data']['mobile'],
							partnerType:res['data']['partnerType'],
							nickName:res['data']['nickName'],
						}
						uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo));
						if(cffp_userInfo.partnerType){
							this.featureLists = [{key: '00',name: '成交订单',icon:'icon-dingdan',link: '/pages/saleCourseLists/saleCourseLists',isOpen: true,enName:'order'},
							{key: '01',name: '佣金',icon: 'icon-yongjin',link: '/pages/pointsExchange/pointsExchange',isOpen: true,isJoin: true},
							{key: '07',name: '分享产品',icon: 'icon-zhuanfa',link: '/pages/courselist/courselist',isOpen: true},
							{key: '04',name: '邀请加盟',icon: 'icon-yaoqing',link: '/pages/inviteJoin/inviteJoin',isOpen: true,isJoin: true}];
						}
					}
					
				})
			},
			getPartnerStatistic(){
				if(this.userId){
					api.partnerStatisticsGrade({userId:uni.getStorageSync('cffp_userId')}).then((res)=>{
						if(res['success']){
							this.partnerStatistic = res['data']
							for (let key in this.partnerStatistic) {
								if(key!='peopleNum' && key!='reachPeopleNum'&& key!='totalPeopleNum'){
									if(key){
										this.partnerStatistic[key] = Number(this.partnerStatistic[key].toFixed(2))
									}
								}
							}
							this.$refs.applyPopup.open()
						}else {
							uni.showToast({
								title: res['message'],
								duration: 2000,
								icon: 'none'					
							})
						}
					})
				}
			},
			gotoApply(){
				dataHandling.pocessTracking(
				  '点击',
				  `用户点击了首页“去加盟为合伙人”弹窗按钮`,
				  '点击',
				  2,
				  '首页',
				  'pages/index/index'
				)
				uni.navigateTo({ 
						url: '/myPackageA/applyFranchise/applyFranchise'
					})
				this.$refs.joinPopup.close()
				
			},
			 jumpUrl(url) {
			 	if (!url) {
			 		return false
			 	} else {
			 		const match = url.match(/fileId=([^&]*)/);
			 		const fileId = match ? match[1] : null;
			 		uni.navigateTo({
			 				url: `/pages/courseDetail/courseDetail?fileId=${fileId}`
			 			})
			 	}
			 },
			init() {
				let loginType = uni.getStorageSync('loginType')
				if(loginType == 'codelogin'){
					 this.querySystemMessage()
					 this.queryInfo()
				}else {
					uni.removeTabBarBadge({ index: 3 });
				}
				if (uni.getStorageSync('isLogin')) {
					
					if (loginType == "visitor") {
						this.loginornot = false
					}else{
						this.loginornot = true;
					}
					this.queryAreaCenterInfo();
				} else {
					api.loginVerification({
						"loginType": 1
					}).then((res) => {
						if (res['success']) {
							this.userId = String(res['data']['userId']);
							uni.setStorageSync('isLogin', '1');
							uni.setStorageSync('cffp_userId', this.userId);
							uni.setStorageSync('loginType', 'visitor');
							uni.setStorageSync('uni-token', res.data['token']);
							this.loginornot = false;
							this.queryAreaCenterInfo();
							this.announcementQuery();
							this.courseList();
						} else {
							uni.showToast({
								title: res['message'],
								duration: 2000,
								icon: 'none'
							})
						}
					})
				}
			},
			querySystemMessage() {
			   api.querySystemMessage({systemType:1,userId:uni.getStorageSync('cffp_userId')}).then(res => {
			     if (res['success']&& res['data']['dataList'].length>0) {
			       
				 let total =  res['data']['dataList'].filter(item=>{
					 
					  return item.isRead == 0
				   })
				   if(total.length>0){
					  uni.setTabBarBadge({
					         index: 3,
					         text: total.length.toString()
					       }); 
				   }else {
					uni.removeTabBarBadge({ index: 3 });
				  }
				   
			     }else {
					 uni.removeTabBarBadge({ index: 3 });
				 }
			   });
			},
			goDetail(item) {
				dataHandling.pocessTracking(
				  '点击',
				  `用户查看首页产品详情`,
				  '点击',
				  2,
				  '首页',
				  'pages/index/index'
				)
				uni.navigateTo({
					url: `/pages/courseDetail/courseDetail?fileId=${item.fileId}&partnerType=${this.cffpUserInfo.partnerType}`
				});
			},
			getCourseList(res){
				 this.queryName = res.trim();
				 this.courseList()
				 dataHandling.pocessTracking(
				   '搜索',
				   `用户搜索产品`,
				   '点击',
				   2,
				   '首页',
				   'pages/index/index'
				 )
			},
			courseList() {
				const param = {
					queryName: this.queryName
				}
				api.courseList(param).then(res => {
					if (res['success']) {
						this.cffpCourseInfos = res['data']['data'];
						if(this.cffpCourseInfos.length>0){
							this.cffpCourseInfos.forEach(item=>{
								item.coursePrice =Number(item.coursePrice).toFixed(2) || '0.00'
							})
						}
					}
				})
			},
			tokefu() {
				let url = 'http://q.url.cn/abkzV9?_type=wpa&qidian=true' // URL是要跳转的外部地址 作为参数
				// #ifdef APP-PLUS
				uni.navigateTo({
					url: '/components/webview?url=' + url
					// page.json定义的路径 传url 到webview界面去接收 实现跳转
				})
				// #endif
				// #ifdef H5
				window.location.href = url;
				// #endif
			},
			// 顶部菜单跳转
			featureSelect(featureItem) {
				if(uni.getStorageSync('cffp_userInfo')){
					this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
				}
				if(featureItem.isApply && (!this.loginType||this.loginType=='visitor')){
					dataHandling.pocessTracking(
					  '点击',
					  `用户未登录状态下在首页点击申请加盟`,
					  '点击',
					  2,
					  '首页',
					  'pages/index/index'
					)
					uni.navigateTo({url: `${featureItem.link}`});
					
					return
				}
				
				if(featureItem.isApply&& this.userInfo.partnerType){
					dataHandling.pocessTracking(
					  '点击',
					  `用户在首页点击申请加盟查看团队等级差`,
					  '点击',
					  2,
					  '首页',
					  'pages/index/index'
					)
					this.getPartnerStatistic()
					return
				}
				
				if (this.loginornot == false && featureItem.name != "学习认证" && featureItem.name != "更多功能") {
					dataHandling.pocessTracking(
					  '点击',
					  `用户在首页未登录时点击${featureItem.name}`,
					  '点击',
					  2,
					  '首页',
					  'pages/index/index'
					)
					uni.clearStorageSync();
					uni.setStorageSync('loginType','visitor');
					uni.redirectTo({
						url: '/myPackageA/login/login?from=index'
					})
					return 
				}
				if (featureItem.key == '02') {
					if (this.cffpUserInfo.levelCode == 'C1' || this.cffpUserInfo.levelCode == 'C2' || this.cffpUserInfo
						.levelCode == 'C3') {
						uni.showToast({
							title: "您已是区域服务中心，无需申请加盟",
							duration: 2000,
							icon: 'none'
						});
						return false
					}
				}
				if ( this.userInfo.partnerType == null && featureItem.isJoin) {
					dataHandling.pocessTracking(
					  '点击',
					  `用户在首页未加盟时点击${featureItem.name}`,
					  '点击',
					  2,
					  '首页',
					  'pages/index/index'
					)
					this.$refs.joinPopup.open()
					return false
				} else if (featureItem.isOpen && featureItem.link) {
					if (featureItem.key == '07') {
						uni.switchTab({
							url: featureItem.link
						})
					} else {
						const urlObj = JSON.parse(JSON.stringify(featureItem))
						urlObj.link =urlObj.enName=='order'? `${urlObj.link}?partnerType=${this.cffpUserInfo.partnerType}`:urlObj.link
						uni.navigateTo({
							url: urlObj.link
						})
					}
				} else {
					uni.showToast({
						title: '此功能暂未开放，敬请期待。',
						duration: 2000,
						icon: 'none'
					})
				}
			},
			queryAreaCenterInfo() {
				api.queryAreaCenterInfo({
					userId: uni.getStorageSync('cffp_userId'),
					companyType: `${companyInfo.companyType}`
				}).then((res) => {
					if (res['success']) {
						this.cffpUserInfo = res['data'];
						uni.setStorageSync('fileUploadItemCFFPList', this.cffpUserInfo['fileUploadItemCFFPList'])
						
					}
				})
			},
			announcementQuery() {
				api.announcementQuery({
					announcementTypeId: 686
				}).then((res) => {
					this.announcementInfo = res['data']['announcementInfoList'] ? res['data'][
						'announcementInfoList'
					][0]['title'] : `${companyInfo.companyFullName}`+'公告'
				})
			},
			getIntroduce(type) {
				this.type = type;
				// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
				this.$refs.popup.open(type)
				dataHandling.pocessTracking(
				  '查看',
				  `用户查看了公司简介`,
				  '点击',
				  2,
				  '首页',
				  'pages/index/index'
				)
			},
			jumpToAnnouncement() {
				uni.navigateTo({
					url: `../announcement/announcement`
				})
			},
			goToCourselist() {
				dataHandling.pocessTracking(
				  '点击',
				  `用户查看更多产品`,
				  '点击',
				  2,
				  '首页',
				  'pages/index/index'
				)
				uni.switchTab({
					url: '../../pages/courselist/courselist'
				})
			},
			onChange: function(e) {
				this.old.x = e.detail.x
				this.old.y = e.detail.y
			}
		},
		mounted() {}
	}
</script>

<style lang="scss" scoped>
	::v-deep .uni-popup .uni-popup__wrapper{
		 margin: 0 !important;
		 border-radius: 30rpx;
	 }
	.container {
		height: auto;
		overflow-y: auto; /* 关键属性 */
		-webkit-overflow-scrolling: touch; /* 优化移动端滚动 */
		background-color: rgba(235, 239, 247, 1);
		
		.homeHeader{
			box-sizing: border-box;
			width: 100%;
			background: linear-gradient(225deg, rgba(65, 69, 188, 1) 0%, rgba(29, 30, 125, 1) 100%);
			padding: 15rpx 30rpx;
			.top{
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.one{
					width: 80%;
				}
				.two{
					.icon-gongsi{
						font-size: 40rpx;
						color: #fff;
					}
				}
			}
			.bottom{
				.content {
					
					overflow: hidden;
					position: relative;
					.featureContent {
						box-sizing: border-box;
						padding: 30rpx 0;
						.nav_wrapper {
							display: flex;
							align-items: center;
							justify-content: space-around;
							flex-wrap: wrap;
							width: 100%;
							box-sizing: border-box;
							.nav_content {
								display: flex;
								flex-direction: column;
								align-items: center;
								justify-content: center;
								flex: 0 0 20%;
								font-size: 14px;
								color: rgba(51, 51, 51, 1);
								image {
									max-width: 80%;
								}
								.imgbox{
									margin-bottom: 10rpx;
									.iconSize{
										font-size: 40rpx;
										color: #fff;
									}
								}
							}
						}
					}
				}
			}
		}
		.carouselBox{
			width: 100%;
			background-color: #fff;
			padding: 15rpx;
			box-sizing: border-box;
			overflow: hidden;
			.swiperBox{
				.swiperItemBox{
					position: relative;
					.swiperBtn{
						position: absolute;
						left: 10%;
						bottom: 20%;
						padding: 15rpx 30rpx;
						border-radius: 50rpx;
						z-index: 2;
						color: #fff;
						font-size: 26rpx;
						background: linear-gradient(180deg, rgba(111, 156, 255, 1) 0%, rgba(34, 96, 251, 1) 100%);
					}
					.swiperImg{
						width: 100%;
						height: 100%;
						border-radius: 50rpx;
					}
				}
				
			}
		}
		.productContainer {
		  background-color: #fff;
		  margin-top: 15rpx;
		  box-sizing: border-box;
		  margin-bottom: 100rpx;
		  
		  .productTitle {
		    border-bottom: 1rpx solid rgba(238, 238, 238, 1);
		    padding-bottom: 10rpx;
		    
		    .titleTxt {
		      padding: 15rpx 30rpx;
		      display: flex;
		      justify-content: space-between;
		      align-items: center;		
		    }
		    
		    .more {
		      font-size: 26rpx;
		      color: rgba(84, 84, 84, 1);
		      
		      .icon-youjiantou {
		        font-size: 26rpx;
		      }
		    }
		  }
		  
		  .productList {
		    width: 100%;
		    box-sizing: border-box;
		    
		    .productListBox {
		      padding: 30rpx;
		      display: grid;
		      /* 默认两列，固定宽度 */
		      grid-template-columns: repeat(auto-fill, minmax(300rpx, 1fr));
		      gap: 30rpx;
		      justify-content: center;
		      
		      .productListItem {
		        width: 100%;
		        max-width: 350rpx; /* 设置最大宽度 */
		        display: flex;
		        flex-direction: column;
		        overflow: hidden;
		        box-sizing: border-box;
		        margin: 0 auto; /* 居中显示 */
		        
		        .top {
		          width: 100%;
		          position: relative;
		          border-radius: 20rpx;
		          overflow: hidden;
		          
		          /* 确保图片容器有固定宽高比 */
		          &::before {
		            content: "";
		            display: block;
		            padding-top: 100%; /* 1:1 宽高比 */
		          }
		          
		          .productImg {
		            position: absolute;
		            top: 0;
		            left: 0;
		            width: 100%;
		            height: 100%;
		            object-fit: cover;
		            display: block;
		          }
		          .shareBtn{
		          	position: absolute;
		          	right: 0;
		          	top: 0;
		          	height: 50rpx;
					color: red;
					z-index: 1;
					background-color: #F43530;
					border-radius: 6rpx;
					padding: 0 10rpx;
					color: #fff;
					display: flex;
					flex-direction: row;
					align-items: center;
					justify-content: center;
		          }
		          .productDesBox {
					  box-sizing: border-box;
		            position: absolute;
		            left: 0;
		            bottom: 0;
		            width: 100%;
		            padding: 0  15rpx;
		            box-sizing: border-box;
		            background: rgba(0, 0, 0, 0.1);
		            border-radius: 0 0 20rpx 20rpx;
		            font-size: 24rpx;
		            color: #fff;
		            display: -webkit-box;
		            -webkit-line-clamp: 2;
		            -webkit-box-orient: vertical;
		            overflow: hidden;
		            text-overflow: ellipsis;
		            /* 关键修改：添加精确的高度计算 */
		            max-height: calc(2 * 1.4 * 24rpx); /* 2行 × 行高 × 字体大小 */
		            line-height: 1.5;
		            /* 确保在Firefox等浏览器也有效 */
		            display: -moz-box;
		            -moz-box-orient: vertical;
		            -moz-line-clamp: 2;
		          }
		        }
		        
		        .bottom {
		          width: 100%;
		          box-sizing: border-box;
		          padding: 10rpx 0;
		          
		          .one {
		            font-size: 27rpx;
		            margin-bottom: 5rpx;
		            display: -webkit-box;
		            -webkit-line-clamp: 1;
		            -webkit-box-orient: vertical;
		            overflow: hidden;
		            text-overflow: ellipsis;
		            white-space: nowrap;
		          }
		          
		          .two {
		            display: flex;
		            justify-content: space-between;
		            align-items: center;
		            
		            .price {
		              font-size: 28rpx;
		              color: rgba(32, 39, 155, 1);
		            }
		            
		            .num {
		              font-size: 24rpx;
		              color: rgba(166, 166, 166, 1);
		            }
		          }
		        }
		      }
		    }
		  }
		  
		  /* iPad竖屏和小屏幕平板 */
		  @media (min-width: 768px) and (max-width: 1023px) {
		    .productList .productListBox {
		      grid-template-columns: repeat(auto-fill, minmax(300rpx, 1fr));
		      gap: 30rpx;
		    }
		  }
		  
		  /* iPad横屏和大屏幕平板 */
		  @media (min-width: 1024px) and (max-width: 1279px) {
		    .productList .productListBox {
		      grid-template-columns: repeat(auto-fill, minmax(300rpx, 1fr));
		      gap: 30rpx;
		    }
		  }
		  
		  /* 电脑端 */
		  @media (min-width: 1280px) {
		    .productList .productListBox {
		      grid-template-columns: repeat(auto-fill, minmax(300rpx, 1fr));
		      gap: 30rpx;
		    }
		  }
		  
		  .productEmpty {
		    color: rgba(166, 166, 166, 1);
		    width: 100%;
		    display: flex;
		    align-items: center;
		    justify-content: center;
		    padding: 30rpx 0;
		    font-size: 28rpx;
		  }
		}
		.joinContent{
			width: 500rpx;
			// height: 300rpx;
			border-radius: 30rpx;
			background-color: #ffff;
			padding: 30rpx;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			flex-direction: column;
			.joinHeader{
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				background: rgba(54, 57, 169, 1);
				display: flex;
				align-items: center;
				justify-content: center;
				margin-bottom: 20rpx;
			}
			.joinCon{
				// padding: 20rpx 0;
				.one{
					font-size: 30rpx;
					color: rgba(38, 41, 44, 1);
					font-weight: 600;
					text-align: center;
				}
				.two{
					color: rgba(145, 144, 148, 1);
					font-size: 26rpx;
					text-align: center;
					margin-top: 10rpx;
					margin-bottom: 20rpx;
				}
			}
			.joinFotter{
				width: 100%;
				color: #fff;
				display: flex;
				align-items: center;
				justify-content: center;
				box-sizing: border-box;
				padding: 10rpx 0;
				background: rgba(54, 57, 169, 1);
				border-radius: 60rpx;
				font-size: 28rpx;
			}
		}
		

		.message {
			display: flex;
			align-items: center;
			margin: 20rpx 0;
			background-color: #fff;
			padding: 20rpx;
			justify-content: space-between;
			box-sizing: border-box;
			border-radius: 10rpx;
			.icon-gonggao {
				font-size: 60rpx;
				color: #20279b;
				margin-right: 20rpx;
			}

			.msg {
				color: red;
			}
		}

		// .content {
		// 	margin-bottom: 20rpx;
		// 	overflow: hidden;
		// 	background: #fff;
		// 	position: relative;

		// 	.featureContent {
		// 		box-sizing: border-box;
		// 		padding: 30rpx 0;
		// 		.nav_wrapper {
		// 			display: flex;
		// 			align-items: center;
		// 			justify-content: space-around;
		// 			flex-wrap: wrap;
		// 			width: 100%;
		// 			box-sizing: border-box;
		// 			// padding: 10rpx;
		// 			.nav_content {
		// 				display: flex;
		// 				flex-direction: column;
		// 				align-items: center;
		// 				justify-content: center;
		// 				flex: 0 0 20%;
		// 				font-size: 14px;
		// 				color: rgba(51, 51, 51, 1);
		// 				// margin: 10px 2%;

		// 				image {
		// 					max-width: 80%;
		// 				}
		// 				.imgbox{
		// 					margin-bottom: 10rpx;
		// 					.iconSize{
		// 						font-size: 40rpx;
		// 					}
		// 				}
		// 			}
		// 		}
		// 	}
		// }

		.course_content {
			position: relative;
			padding-bottom: 30rpx;
			// background-color: pink;
			.tag {
				box-sizing: border-box;
				padding: 20rpx;
				display: flex;
				justify-content: space-between;
				position: relative;
				background: #fff;
				margin-bottom: 20rpx;
				border-radius: 10rpx;
				h4 {
					margin-left: 20rpx;
					font-size: 32rpx;
				}
			}

			.tag:before {
				position: absolute;
				left: 20rpx;
				top: 50%;
				transform: translateY(-50%);
				display: inline-block;
				content: '';
				width: 2px;
				height: 32rpx;
				background-color:  #20279b;
				border-radius: 2px;
			}
		}
	}
	.applyBox{
		width: 500rpx;
		border-radius: 30rpx;
		background-color: #ffff;
		padding: 30rpx;
		box-sizing: border-box;
		
		.icon-chahao{
			color: #272536;
			font-size: 28rpx;
		}
		.applyCon{
			display: flex;
			// align-items: center;
			flex-direction: column;
			.icon-dianzan{
				color: #FF8D1A;
				font-size: 60rpx;
			}
			.title{
				font-size: 35rpx;
				font-weight: 600;
				margin: 20rpx 0;
			}
			.applycontent{
				color: #20269B;
				font-size: 28rpx;
				.subtit{
					font-size: 30rpx;
					margin-bottom: 10rpx;
				}
				.num{
					font-size: 26rpx;
					color: #333333;
					margin: 10rpx 0;
				}
				.leftIcon{
					color: #20269B;
					font-size: 26rpx;
					margin-right: 5rpx;
				}
				.rightIcon{
					margin-left: 5rpx;
					font-size: 26rpx;
					color: #F43530;
				}
				.icon-duihao2{
					color: #41C740;
				}
			}
			
		}
	}
	.descriptionBox {
		width: 550rpx;
		padding: 40rpx;
		.popupClose{
			display: flex;
			align-items: center;
			justify-content: flex-end;
			.icon-guanbi{
				font-size: 28rpx;
				
			}
		}
		.imageBox{
			display: flex;
			align-items: center;
			justify-content: center;
			margin-bottom: 20rpx;
		}
		.description{
			color: rgba(56, 56, 56, 1);
			font-size: 26rpx;
			line-height: 1.5;
		}
	}
	.ulBox {
		flex-direction: column;
		width: 100%;
		box-sizing: border-box;
	}

	.liBox {
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		padding: 10rpx;
		width: 100%;
	}

	
</style>