<!DOCTYPE html>
<html>
	<?php echo $this->fetch('head.html'); ?>
	<link href="/plugin/swiper/css/swiper.min.css" rel="stylesheet" />
	<body>
		<div class="header">
			<a url="/" class="header-back"></a>
			<div class="header-title">买车</div>
			 
		</div>
		<div class="header-row"></div>
		<div class="main-body">
			<div class="swiper-container" style="width:100%;" id="indexFlash">
				<div class="swiper-wrapper">
					<?php $_from = $this->_var['flashList']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
					<div class="swiper-slide">
						<img gourl="<?php echo $this->_var['c']['link1']; ?>" class="wmax" src="<?php echo $this->_var['c']['imgurl']; ?>" />
					</div>
					<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
				</div>
			
				<div class="swiper-pagination"></div>
			
			</div>
			<?php if ($this->_var['navList']): ?>
			<div class="m-navPic mgb-5">
			    <?php $_from = $this->_var['navList']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
			    <a href="<?php echo $this->_var['c']['link1']; ?>" class="m-navPic-item">
					  <img class="m-navPic-img" src="<?php echo images_site($this->_var['c']['imgurl']); ?>" />
					  <div class="m-navPic-title"><?php echo $this->_var['c']['title']; ?></div>
					   
			    </a>
				
			    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
			</div>
			<?php endif; ?>
			<?php if ($this->_var['adList']): ?>
			<div class="adBox">
				<?php $_from = $this->_var['adList']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
				<div class="adBox-item">
					<img gourl="<?php echo $this->_var['c']['link1']; ?>" src="<?php echo $this->_var['c']['imgurl']; ?>" class="adBox-img" />
				</div>
				<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
						 
			</div>
			<?php endif; ?>
		</div>
		<div class="main-body" id="app">
			<div class="tabs-border mgb-5">
				<div @click="setType('recommend')" :class="{'tabs-border-active':type=='recommend'}" class="tabs-border-item">推荐</div>
				<div @click="setType('follow')" :class="{'tabs-border-active':type=='follow'}" class="tabs-border-item">关注</div>
				<div @click="setType('near')" :class="{'tabs-border-active':type=='near'}" class="tabs-border-item">附近</div>
				<div @click="setType('new')" :class="{'tabs-border-active':type=='new'}" class="tabs-border-item">最新</div>
				 
			</div>
			<div style="display: none;" :class="'flex-col'" class="sglist">
				<div class="emptyData" v-if="!list || Object.keys(list).length==0">暂无数据</div> 
				<div v-for="(item,index) in  list" :key="index" @click="goBlog(item.productid)" class="sglist-item pointer">
					<div class="mgb-5 flex flex-ai-center">
						<div class="btn-recommend">荐</div>
						<div>{{item.title}}</div>
					</div>
					<div class="sglist-imglist">
						 
						<img v-for="(img,imgIndex) in item.imgslist" :key="imgIndex" :src="img+'.100x100.jpg'" class="sglist-imglist-img" />
						
					</div>
					<div class="flex flex-ai-center mgb-10">
						<div class="mgr-5 cl2">售价</div>
						<div class="cl-money mgr-10">￥{{item.money}}</div>
						<div class="cl2 f12 mgr-10">{{item.brand_title}}</div>
						<div class="flex-1"></div> 
						<div class="cl2 f12 mgr-10">上牌：{{item.pai_date}}</div> 
						
					</div>
					<div class="sglist-ft">
						<div class="sglist-ft-love">{{item.love_num}}</div>
						<div class="sglist-ft-cm">{{item.comment_num}}</div>
						<div class="sglist-ft-view">{{item.view_num}}</div>
					</div> 
					  
				</div>
				<div class="loadMore" v-if="per_page>0" @click="getList">加载更多</div>
			</div>
			
		</div>
		<?php $this->assign('ftnav','car'); ?>
		<?php echo $this->fetch('ftnav.html'); ?>
		<?php echo $this->fetch('footer.html'); ?>
		<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=<?php echo BDMAPKEY; ?>"></script>
		<script src="/plugin/dt-ui/GPS.js"></script>
		<script src="/plugin/swiper/js/swiper.min.js"></script>
		<script>
			var lat=0,lng=0;
			var geolocation = new BMap.Geolocation();
			var latlng=GPS.get();
			 
			if(!latlng){
				
				geolocation.getCurrentPosition(function(r){
				if(this.getStatus() == BMAP_STATUS_SUCCESS){
					lat=r.point.lat;
					lng=r.point.lng;
					GPS.set({
						lat:lat,
						lng:lng
					});
				}
				else {			
				}        
				},{enableHighAccuracy: true})
			}else{
				lat=latlng.lat;
				lng=latlng.lng;
			}
			$(function(){
			 
				var flash=new Swiper("#indexFlash");
				 
			})
			
		</script>
		<script src="<?php echo $this->_var['skins']; ?>car/index.js"></script>
		<?php wx_jssdk();?>
		 
	</body>
</html>
