<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
    <meta name="keywords" content="{$GetClassMetaKeyWords}">
    <meta name="description" content="{$GetClassMetaDescript}">
    <meta name="format-detection" content="telephone=no">
    <title id="pageTitle">{$GetSiteTitle}</title>
    <link rel="stylesheet" href="{$GetTemplateDir}/static/common/css/common.css?{$GetHash}">
    <link rel="stylesheet" href="{$GetTemplateDir}/static/index/css/app.css?{$GetHash}">
	<!-- Include stylesheet -->
	<link href="{$GetTemplateDir}/static/swiper/css/swiper.min.css?{$GetHash}" rel="stylesheet">
	<script>
		var templateDir = '{$GetTemplateDir}';
		var hash = '{$getHash}';
		var indexNavList = [
			{
				name:'讲师',
				url:'{=GetRewriteUrl(teacherlist)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_teacher.png'
			},
			{
				name:'学员作品',
				url:'{=Get3gClassUrl(1252)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_stuworks.png'
			}
			{module.mall}
			,{
				name:'教材',
				url:'{=GetRewriteUrl(mall)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_books.png'
			}
			{/module.mall}
			,{
				name:'新闻',
				url:'{=Get3gClassUrl(1104)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_news.png'
			}
			{module.school}
			,{
				name:'机构',
				url:'{=GetRewriteUrl(eplistindex)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_school.png'
			}
			{/module.school}
			{Plus.Ask}
			,{
				name:'问答',
				url:'{=GetReWriteUrl(askindex)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_QA.png'
			}
			{/Plus.Ask}
			,{
				name:'资料下载',
				url:'{=GetClassURL(1240)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_download.png'
			}
			{Plus.Job}
			,{
				name:'招聘',
				url:'{=GetRewriteUrl(jobindex)}',
				icon:'{$GetTemplateDir}/static/index/images/index_icon_recruit.png'
			}
			{/Plus.Job}
		]
	</script>
</head>
<body id="body">
	<div id="loading" class="loading"></div>
	<div id="app" v-cloak>	
		<keep-alive><router-view></router-view></keep-alive>
		<div class="footer-tabbar-blank"></div>
		<div class="footer-tabbar line line-top">
			<ul>
				<router-link :class="$route.path === '/' && 'on'" to="/" tag="li"><div class="icon icon-index"></div>首页</router-link>
				<router-link :class="$route.path === '/find' && 'on'" to="/find" tag="li"><div class="icon icon-find"></div>发现</router-link>
				{Plus.Group}
				<router-link :class="$route.path === '/community' && 'on'" to="/community" tag="li"><div class="icon icon-community"></div>社区</router-link>
				{/Plus.Group}
				<li @click="open('{=GetRewriteUrl(examindex)}')"><div class="icon icon-exercise"></div>练习</li>
				<li @click="goUser('{=GetRewriteUrl(user)}')"><div class="icon icon-me"></div>我的</li>
			</ul>
		</div>
	</div>
	
	<template id="index">
		<div class="page-index">
			<div class="index-header">
				<div class="logo"><img src="{$GetTemplateDir}/static/index/images/icon_logo.png" /></div>
				<div class="search">
					<input type="hidden" id="URL_search" value="{=GetRewriteUrl(search,type-course)}" >
					<input type="text" @keyup="gosearch" v-model="searchText" class="search-text" placeholder="输入课程/内容名称">
				</div>
			</div>
			
			<swiper class="index-swiper" :style="{height:bodyWidth*0.56+'px'}" :options="swiperOptionA">
				<!-- slides -->
				<swiper-slide style="background-image:url({$GetTemplateDir}/static/index/images/banner3.jpg)"></swiper-slide>
				<swiper-slide style="background-image:url({$GetTemplateDir}/static/index/images/banner2.jpg)"></swiper-slide>
				<!-- Optional controls -->
				<div class="swiper-pagination"  slot="pagination"></div>
			</swiper>
			<div class="index-menu">
				<div class="clearfix" v-if="nav.length === 8">
					<div class="item" v-for="(item,i) in nav" :key="i">
						<a :href="item.url">
							<div class="icon"><img :src="item.icon" /></div>
							{{item.name}}
						</a>
					</div>
				</div>
				<swiper v-else :options="swiperOptionD">
					<swiper-slide class="item" v-for="(item,i) in nav" :key="i">
						<a :href="item.url">
							<div class="icon"><img :src="item.icon" /></div>
							{{item.name}}
						</a>
					</swiper-slide>
				</swiper>
			</div>
			<div class="index-live index-box">
				<div class="common-title"><a href="/#/find?teachway=5" class="more">查看全部</a>直播课程</div>
				<swiper class="item-wrap" :options="swiperOptionB">
					{KS_首页直播列表}
				</swiper>
			</div>
			<div class="index-fight-group index-box">
				<div class="common-title"><a href="/#/find?teachway=101" class="more">查看全部</a>课程活动</div>
				<div class="item-wrap">
					{KS_课程活动}
				</div>
			</div>
			
		
			<div class="index-course index-box">
				<div class="common-tab">
					<ul>
						<li :class="courseTab == 0 && 'on'" @click="courseTab = 0">精选好课</li>
						<li :class="courseTab == 1 && 'on'" @click="courseTab = 1">新课推荐</li>
						<li :class="courseTab == 2 && 'on'" @click="courseTab = 2">免费好课</li>
					</ul>
				</div>
				<div class="index-list" v-if="courseTab == 0">
					{KS_精选好课}
				</div>
				<div class="index-list" v-else-if="courseTab == 1">
					{KS_新课推荐}
				</div>
				<div class="index-list" v-else-if="courseTab == 2">
					{KS_免费好课}
				</div>
			</div>
			<div class="index-class index-box">
				<div class="common-title"><a href="{=GetRewriteUrl(roomlist)}" class="more">查看全部</a>热门班级</div>
				<div class="index-list">
					{KS_首页热门班级}
				</div>
			</div>

			<div class="index-teacher index-box">
				<div class="common-title"><a href="{=GetRewriteUrl(teacherlist)}" class="more">查看全部</a>资深讲师</div>
				<swiper class="item-wrap" :options="swiperOptionC">
					{KS_首页教师列表}
				</swiper>
			</div>
			<div class="index-club index-box">
				<div class="common-title"><a href="/#/community?tab=1" class="more">查看全部</a>热门话题</div>
				<div class="item-wrap">
					{KS_热门话题}
				</div>
			</div>
			
			<div class="index_footer">
				<div class="index_menu_top">
					{KS_index_footer_menu}
				</div>
			
				<p class="name">
					Powered By KesionEdu V6 正式版
				</p>
				<p>
					www.kesion.com inc.
				</p>
						
			</div>

		</div>
	</template>

	<template id="find">
		<div>
			<div class="loading" v-show="loading"></div>
			<div class="mask-bg" v-show="filterTab.sort || filterTab.category || filterTab.other" @click="maskTrigger"></div>
			<div class="find-header-wrap">	
				<div class="find-header">
					<div class="tab">
						<ul>
							<li :class="tab == 0 && 'on'" @click="go('tab',0)">课程</li>
							<li :class="tab == 1 && 'on'" @click="go('tab',1)">面授</li>
							<li :class="tab == 2 && 'on'" @click="go('tab',2)">班级</li>
						</ul>
					</div>
				</div>
				<div class="find-filter line" :class="'find-filter'+tab">
					<ul>
						<li :class="filterTab.sort && 'on'" @click="openFilterBox('sort')" v-if="tab==0 || tab == 1">{{sortList[sort] && sortList[sort].name}}<i class="icon-arrow"></i></li>
						<li :class="filterTab.sort && 'on'" @click="openFilterBox('sort')" v-if="tab == 2">{{classroom.list[classroom.current] && classroom.list[classroom.current].name}}<i class="icon-arrow"></i></li>
						<li :class="filterTab.category && 'on'" @click="openFilterBox('category')">{{className}}<i class="icon-arrow"></i></li>
						<li v-if="tab != 2" :class="filterTab.other && 'on'" @click="openFilterBox('other')">筛选<i class="icon-filter"></i></li>
					</ul>
					
				</div>
				
				<div class="relative">
					
					<!--排序-->
					<div class="find-filter-sort" v-show="filterTab.sort" v-if="tab == 0 || tab == 1">
						<ul>
							<li :class="sort == item.key && 'on'" class="line" v-for="(item,i) in sortList" :key="i" @click="go('sort',item.key)">{{item.name}}</li>
						</ul>
					</div>
					<div class="find-filter-sort" v-show="filterTab.sort" v-else-if="tab == 2">
						<ul>
							<li :class="classroom.orderfield == item.key && 'on'" class="line" v-for="(item,i) in classroom.list" :key="i" @click="go('orderfield',item.key)">
								{{item.name}}
							</li>
							
						</ul>
					</div>
					
					<!--分类-->
					<div class="find-filter-category clearfix" v-show="filterTab.category">
						<div class="category-grid">
							<ul>
								<li :class="firstid == 0 && 'on'" @click="filterClass(1,{classId:0,className:'分类'})">全部</li>
								<li :class="item.classId == firstid && 'on'" v-for="(item,i) in firstCategory" :key="i" @click="filterClass(1,item)">{{item.className}}</li>
							</ul>
						</div>
						<div class="category-grid">
							<ul v-show="secondCategory.length">
								<li :class="(secondid !== null && secondid == firstid) && 'on'" @click="filterClass(2,{classId:firstid,className:firstName})">全部</li>
								<li :class="secondid == item.classId && 'on'" v-for="(item,i) in secondCategory" :key="i" @click="filterClass(2,item)">{{item.className}}</li>
							</ul>
						</div>
						<div class="category-grid">
							<ul v-show="thirdCategory.length">
								<li :class="(thirdid !== null && thirdid == secondid) && 'on'" @click="filterClass(3,{classId:secondid,className:secondName})">全部</li>
								<li :class="thirdid == item.classId && 'on'" v-for="(item,i) in thirdCategory" :key="i" @click="filterClass(3,item)">{{item.className}}</li>
							</ul>
						</div>
					</div>
					<!--筛选-->
					<div class="find-filter-other" v-show="filterTab.other">
						
						<!--该筛选仅对课程-->
						<div class="name" v-if="tab == 0">课程类型</div>
						<div class="option-list" v-if="tab == 0">
							<span @click="selectOption('teachway',item.key)" :class="item.key == course.teachway && 'on'" v-for="(item,i) in course.teachwayList" :key="i">{{item.name}}</span>
						</div>

						<div class="name">价格筛选</div>
						<div class="option-list">
							<span @click="selectOption('price',item.key)" :class="item.key == price && 'on'" v-for="(item,i) in priceList" :key="i">{{item.name}}</span>
						</div>
						<div class="button" @click="price = 0;course.teachway = 0;">重置筛选</div>
						<div class="button main-button" @click="filterDetermine">确定</div>
					</div>
				</div>
			</div>
			<div class="find-header-wrap-blank"></div>
			
			<!--网授课程列表-->
			<div class="find-list" v-if="tab == 0">
				<ul v-if="list.length">
					<li v-for="(item,i) in list" :key="'item'+i" @click="open(item.getViewUrl)">
						<div class="default-bg"><div class="images-bg" :style="{backgroundImage:'url('+item.courseImg+')'}"></div></div>
						<div class="name">
							<span v-if="item.teachWay == 1">点播</span>
							<span v-else-if="item.teachWay == 5">直播</span>
							<span v-else-if="item.teachWay == 101">抢购</span>
							<span v-else-if="item.teachWay == 102">团购</span>
							<span v-else-if="item.teachWay == 103">积分</span>
							<span v-else-if="item.teachWay == 3">套餐</span>
							{{item.courseName}}
						</div>
						<div class="study-num">{{item.learnCount}}人正在学习</div>
						<div class="price"><span v-if="item.countPid != 0 && item.teachWay != 3">{{item.countPid}}课时</span>{{item.price}}</div>
					</li>
				</ul>
				<div class="empty" v-else-if="!loading">没有找到课程～</div>
				<div class="load-completed" v-if="list.length && page >= pageCount">已全部加载完成～</div>
			</div>
			<!--网授课程结束-->

			<!--面授课程列表-->
			<div class="find-list" v-if="tab == 1">
				<ul v-if="list.length">
					<li v-for="(item,i) in list" :key="'item'+i" @click="open(item.getViewUrl)">
						<div class="default-bg"><div class="images-bg" :style="{backgroundImage:'url('+item.courseImg+')'}"></div></div>
						<div class="name">
							{{item.courseName}}
						</div>
						<div class="study-num">{{item.learnCount}}人正在学习</div>
						<div class="price"><span v-if="item.courseType != 0">{{item.courseType}}</span>{{item.price}}</div>
					</li>
				</ul>
				<div class="empty" v-else-if="!loading">没有找到课程～</div>
				<div class="load-completed" v-if="list.length && page >= pageCount">已全部加载完成～</div>
			</div>
			<!--面授课程结束-->

			<!--班级列表-->
			<div class="find-class-list" v-else-if="tab == 2">
				<ul v-if="list.length">
					<li v-for="(item,i) in list" :key="i" @click="open(item.getViewUrl)">
						<div class="default-bg" :style="{height:classImageHeight+'px'}"><div class="images-bg" :style="{backgroundImage:'url('+item.DefaultPic+')'}"></div></div>
						<div class="name">{{item.Title}}</div>
						<div class="price">
							班主任：{{item.Teacher}}<span>{{item.Price_Member}}</span>
						</div>
						<div class="common-icon-state common-icon-state-mid">
							<span><i class="icon-course"></i>{{item.CourseCount}}</span>
							<span><i class="icon-student"></i>{{item.BuyCount}}</span>
							<span><i class="icon-evaluate"></i>{{item.pfnum}}</span>
						</div>
					</li>
				</ul>
				<div class="empty" v-else-if="!loading">没有找到班级～</div>
				<div class="load-completed" v-if="list.length && page >= pageCount">已全部加载完成～</div>
			</div>
			<!--班级结束-->
		</div>
	</template>
	

	<!--社区-->
	<template id="community">
		<div>
			<div class="loading" v-show="loading"></div>
			
			<div class="index-live community-hot index-box">
				<div class="common-title"><a href="{=GetRewriteUrl(clublist)}" class="more">查看全部</a>热门小组</div>
				<swiper class="item-wrap" :options="swiperOption">
					{KS_热门小组}
				</swiper>
			</div>
			<div class="community-list">
				<div class="common-tab line">
					<ul>
						<li :class="tab == 0 && 'on'" @click="go('tab',0)">全部话题</li>
						<li :class="tab == 1 && 'on'" @click="go('tab',1)">热门话题</li>
					</ul>
				</div>
				<div class="item-wrap" v-if="list.length">
					<div class="item" v-for="item in list" :key="item.TopicId" @click="open(item.getClubthreadUrl)">
						<div class="from-user">
							<div class="default-avatar"><div class="images-bg" :style="{backgroundImage:'url(/UploadFiles/avatar/'+item.UserId+'.jpg)'}"></div></div>
							<div class="name">{{item.UserName}}</div>
							<div class="time">{{item.AddDate}}</div>
						</div>
						<div class="topic-title" v-html="item.Content"></div>
						<div class="topic-big-img" v-if="item.Annex.length === 1">
							<img :src="item.Annex[0]" />
						</div>
						<div class="topic-img-list" v-else-if="item.Annex.length > 1">
							<div  class="default-bg" v-for="(img,i) in item.Annex" :key="img" v-if="i<9">
								<div class="images-bg" :style="{backgroundImage:'url('+img+')'}"></div>
							</div>
						</div>
						<div class="common-icon-state">
							<span><i class="icon-zan"></i>{{item.Digg}}</span>
							<span><i class="icon-evaluate"></i>{{item.PostNum}}</span>
							<span><i class="icon-browse"></i>{{item.Hits}}</span>
						</div>
					</div>
					<div class="load-completed" v-if="page >= pageCount && loaded">已全部加载完成～</div>
				</div>
				<div v-else-if="loaded">
					暂无话题
				</div>	

			</div>
			
		</div>
	</template>

	<script src="{$GetTemplateDir}/static/index/js/app.js?{$GetHash}"></script>

</body>
</html>
