<!DOCTYPE html>
<html>
<?php echo $this->fetch('head.html'); ?>
<style>
	.follow-btn{
		color: #666;
		border: 1px solid #ccc;
		border-radius: 5px;
		padding: 5px 10px;
		font-size: 12px; 
	}
	.follow-btn-active{
		color: #f30;
		border: 1px solid #f30;
	}
</style> 
<body>
<div class="fixtop">
	<div class="header-back-fixed goBack"></div>
</div>
<div class="main-body">
	<div class="row-box mgb-5">
		<div class="flex flex-ai-center">
			<img gourl="/module.php?m=exue_shop&a=show&shopid=<?php echo $this->_var['shop']['shopid']; ?>" class="d-userbox-head" src="<?php echo $this->_var['shop']['imgurl']; ?>.100x100.jpg">
			<div class="flex-1">
				<div gourl="/module.php?m=exue_shop&a=show&shopid=<?php echo $this->_var['shop']['shopid']; ?>" class="f14 cl1 mgb-5"><?php echo $this->_var['shop']['title']; ?></div>
				<div class="flex mgb-5 flex-ai-center">
					<div class="cl2 f12 mgr-5">粉丝</div>
					<div class="f12 cl-num mgr-5 "><?php echo $this->_var['shop']['follow_num']; ?></div>
				 
				</div>
				<div class="cl3 f12"><?php echo $this->_var['shop']['description']; ?></div>
			</div>
			<div class="follow-btn <?php if ($this->_var['shop']['isFollow']): ?>follow-btn-active<?php endif; ?> js-sfollow-toggle" shopid="<?php echo $this->_var['shop']['shopid']; ?>"><?php if ($this->_var['shop']['isFollow']): ?>已关注<?php else: ?>+关注<?php endif; ?></div>
		</div>
		
	</div>
    <img class="d-img" src="<?php echo $this->_var['data']['imgurl']; ?>.middle.jpg" />
	<div class="rdBox">
		<div class="d-title"><?php echo $this->_var['data']['title']; ?></div>
		<div class="flex mgb-5">
			<div class="mgr-20 cl2">时间</div>
			<div class="cl2"><?php echo $this->_var['data']['createtime']; ?></div>
		</div>
		<div class="flex mgb-5">
			<div class="mgr-20 cl2">学校</div>
			<div gourl="/module.php?m=exue_shop&a=show&shopid=<?php echo $this->_var['shop']['shopid']; ?>" class="cl2"><?php echo $this->_var['shop']['title']; ?></div>
		</div>
		<div class="flex">
			<div class="mgr-20 cl2">地址</div>
			<div class="cl2"><?php echo $this->_var['shop']['address']; ?></div>
		</div> 
	</div>
	<div class="rdBox">
		<div class="tabs-border-group">
			<div class="tabs-border mgb-5">
				<div class="tabs-border-item js-tabs-border-item tabs-border-active">课程简介</div>			
				<!--<div class="tabs-border-item js-tabs-border-item">动态</div>-->
				<div class="tabs-border-item js-tabs-border-item">相关老师</div>
				<div class="tabs-border-item js-tabs-border-item">学员评价</div>
			</div>
			<div class="tabs-border-box tabs-border-box-active">
				<div class="d-content">
					<?php echo $this->_var['data']['content']; ?>
				</div>
			</div>
			<!--
			<div class="tabs-border-box">
				<?php $_from = $this->_var['blogList']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
				<div gourl="/module.php?m=exue_blog&a=show&id=<?php echo $this->_var['c']['id']; ?>" class="sglist-item">
					
					<div class="sglist-title"><?php echo $this->_var['c']['content']; ?></div>
					<?php if ($this->_var['c']['imgslist']): ?>
					<div class="sglist-imglist">
						<?php $_from = $this->_var['c']['imgslist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'p');if (count($_from)):
    foreach ($_from AS $this->_var['p']):
?> 
						<img  src="<?php echo $this->_var['p']; ?>.100x100.jpg" class="sglist-imglist-img" />
						<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
					</div>
					<?php endif; ?>
					<div class="sglist-ft">
						<div class="sglist-ft-love"><?php echo $this->_var['c']['love_num']; ?></div>
						<div class="sglist-ft-cm"><?php echo $this->_var['c']['comment_num']; ?></div>
						<div class="sglist-ft-view"><?php echo $this->_var['c']['view_num']; ?></div>
					</div> 
				</div>
				<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
			</div>
			-->
			<div class="tabs-border-box">
				<?php $_from = $this->_var['tcList']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
				<div gourl="/module.php?m=exue_teacher&a=show&tcid=<?php echo $this->_var['c']['tcid']; ?>" class="flexlist-item">
					<img gourl="/module.php?m=exue_teacher&a=show&tcid=<?php echo $this->_var['c']['tcid']; ?>" src="<?php echo $this->_var['c']['imgurl']; ?>.100x100.jpg" class="flexlist-img" />
					<div class="flex-1">
						<div gourl="/module.php?m=exue_teacher&a=show&tcid=<?php echo $this->_var['c']['tcid']; ?>" class="flexlist-title"><?php echo $this->_var['c']['nickname']; ?></div>
						<div class="flexlist-desc"><?php echo $this->_var['c']['description']; ?></div>
						 
					</div>
				</div>
				<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
			</div>
			<div class="tabs-border-box">
				<?php $_from = $this->_var['ratyList']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
				<div class="item">
					<div class="flex flex-ai-center">
						<div class="mgr-10"><?php echo $this->_var['c']['nickname']; ?></div>
						 
						<div class="zm-raty" mod="1" grade="<?php echo $this->_var['c']['raty_grade']; ?>" len="10"></div>
					</div>
					<div class="cl3 f14 mgb-5">
						<?php echo $this->_var['c']['raty_content']; ?>
					</div>
					<div class="flex">
						<div class="cl3 f12"><?php echo $this->_var['c']['raty_time']; ?></div>
					</div>
					
				</div>
				<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
			</div>
		</div>
	</div>	
</div>
<div class="footer-row"></div>
<div class="footerFix  ">
	<div class="row-box flex flex-ai-center">
		<div class="mgr-10">限时优惠</div>
		<div class="cl-money f16">￥<?php echo $this->_var['data']['price']; ?></div>
		<div class="flex-1"></div>
		<div id="bm-btn" class="btn">立即报名</div>
	</div>
	
</div>
<div class="modal-group" id="bm-box">
	<div class="modal-mask"></div>
	<div class="modal">
		<div class="modal-header">
			<div class="modal-title">报名</div>
			<div class="modal-close iconfont icon-close"></div>
		</div>
		<div class="modal-body">
			<form>
				<div class="input-flex">
					<div class="input-flex-label">联系人</div>
					<input id="bm-nickname" type="text" name="nickname" value="<?php echo $this->_var['addr']['nickname']; ?>" class="input-flex-text" />
				</div>
				<div class="input-flex">
					<div class="input-flex-label">电话</div>
					<input id="bm-telephone" type="text" name="telephone" value="<?php echo $this->_var['addr']['telephone']; ?>" class="input-flex-text" />
				</div>
				
				<div id="bm-submit" class="btn-row-submit">确认报名</div>
			</form>
		</div>
	</div>
</div>
<?php echo $this->fetch('footer.html'); ?>
<script>
	var courseid="<?php echo $this->_var['data']['courseid']; ?>"
	$(function(){
		$(document).on("click","#bm-btn",function(){
			$("#bm-box").show();
		})
		$(document).on("click","#bm-close",function(){
			$("#bm-box").hide();
		})
		$(document).on("click",".js-sfollow-toggle",function(){
			var that=$(this);
			$.ajax({
				url:"/module.php?m=exue_shop&a=toggleFollow&ajax=1",
				dataType:"json",
				data:{
					shopid:that.attr("shopid")
				},
				success:function(res){
					if(res.error){
						skyToast(res.message);
						return false;
					}
					if(res.data.isFollow==1){
						that.addClass("follow-btn-active");
						that.html("已关注")
					}else{
						that.removeClass("follow-btn-active");
						that.html("+关注")
					}
				}
			})
		})
		$(document).on("click","#bm-submit",function(){
			var nickname=$("#bm-nickname").val();
			var telephone=$("#bm-telephone").val();
			$.ajax({
				url:"/module.php?m=exue_order&a=order&ajax=1",
				dataType:"json",
				type:"POST",
				data:{
					courseid:courseid,
					nickname:nickname,
					telephone:telephone
				},
				success:function(res){
					if(res.error){
						skyToast(res.message);
						if(res.error==11){
							$("#bm-box").hide();
						}
						return false;
					}
					window.location=res.data.payurl;
				}
			})
		})
	})
</script>
<script src="/plugin/dt-ui/dt-ui-raty.js"></script>
		<script>
			skyRaty(".zm-raty")
		</script>
<?php wx_jssdk();?>
		<script type="text/javascript">
			wxshare_title = "<?php echo $this->_var['seo']['title']; ?>"; 
			 
			wxshare_imgUrl = "<?php echo $this->_var['data']['imgurl']; ?>.100x100.jpg"; 
		 
		</script>
</body>
</html>