<!DOCTYPE html>
<html>
	{include file="head.html"}
	<body>
		<div class="header">
			<div url="/module.php?m=olprint" class="header-back"></div>
			<div class="header-title">选择打印店</div>
		</div>
		<div class="header-row"></div>
		 
		<div class="main-body" id="App">
			
			<div style="display: none;" :class="'flex-col'" :style="'display:flex'" v-if="pageLoad">
				
				<div v-if="Object.keys(list).length==0" class="emptyData">暂无打印店</div> 
				<div  v-for="(item,index) in list" :key="index" class="row-box mgb-5">
					<div class="flex">
					<img :src="item.imgurl+'.100x100.jpg'" class="flexlist-img bd-radius-50" />
					<div class="flex-1">
						<div class="flexlist-title">{{item.shopname}}</div>
						<sky-raty len="5" mod="2" readonly="1" :grade="item.raty_grade" label="评价"></sky-raty>
						<div class="flexlist-desc">{{item.address}}</div> 
					</div>

					<div v-if="item.distance" class="cl3 f12">距您{{item.distance}}</div>
					</div>
					<div class="flex">
						<div class="flex-1"></div>
						<div @click="choiceShop(item.shopid)" class="btn-mini mgr-10">选择</div>
						<div @click="goShop(item.shopid)" class="btn-mini mgr-10">查看</div>
					</div>
				</div>
			</div>
		</div>
		 
		{include file="footer.html"}
		<script src="/plugin/dt-ui/raty.vue.js"></script>
		<script>
			var catid = "{$catid}";
			$(document).on("click","#searchBtn",function(){
				var keyword=$("#keyword").val();
				window.location="/module.php?m=olprint_search&keyword="+encodeURIComponent(keyword);
			})
			
		</script>
		<script src="{$skins}olprint_shoplist/index.js?v2"></script>
		<script src="/plugin/dt-ui/gps.js"></script>
		<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={const.BDMAPKEY}"></script>
		<script>
			//地理位置
			var geolocation = new BMap.Geolocation();
			var latlng=GPS.get();
			var lat,lng;
			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
					});
					App.getList();
					
				}
				else {
					alert('获取GPS失败'+this.getStatus());
					App.getList();
				}        
				},{enableHighAccuracy: true})
			}else{
				lat=latlng.lat;
				lng=latlng.lng;
				
				App.getList();
			}
		</script>
	</body>
</html>
