<!DOCTYPE html>
<html>
	{include file="head.html"}
	<body>
		<link href="{$skins}b2b_shop/index/index.css" rel="stylesheet" />
		<div id="App" class="none" :class="'flex-col'">
			<div  v-if="pageLoad">
				<div class="header-back-fixed goBack"></div>
				 
				<div @click="favShopToggle(shop.shopid)" :class='shopFavClass' class="header-fav-btn iconfont icon-favor">收藏</div>
				
				<div class="modal-group" id="header-more-box">
					<div class="modal-mask"></div>
					<div class="header-fixtop-menu">
						<div class="row-item-text pointer"><div class="row-item-icon icon-share"></div>分享店铺</div>
						<div  class="row-item-text pointer"><div class="row-item-icon icon-warn_light"></div>举报商家</div>
					</div>
				</div>
				
				<div class="wshop-logo">
					<image model="widthFix" class="wshop-logo-img" :src="shop.imgurl+'.100x100.jpg'"></image>
				</div>
				<div class="wshop mgb-5">
					
					<div >
						<div class="wshop-shopname">{{shop.shopname}}</div>
						 
						 
					</div>
				
				</div>
				<div id="esDot"></div>
				<div :class="tabClass" class="tabs-border">
					<div @click="page='product'" :class="{'tabs-border-active':page=='product'}" class="tabs-border-item">商品</div>
					<div @click="page='raty'" :class="{'tabs-border-active':page=='raty'}" class="tabs-border-item">评价</div>
					<div @click="page='detail'" :class="{'tabs-border-active':page=='detail'}" class="tabs-border-item">商家</div>
				</div>
				<div :class="tabRowClass"></div> 
			</div>
			<div v-if="page=='product'">
				<div  v-if="pageLoad">
					<div class="">
						<div :class="sideClass"  class="side">
							<div @click="setCat(0)" :class="{'side-menu-active':catid==0}"  class="side-menu">推荐</div>
							<div @click="setCat(item.catid)" :class="{'side-menu-active':catid==item.catid}" v-for="(item,index) in catList" class="side-menu">
								{{item.title}}
							</div>
						</div>
						<div class="flex-1 main">
							<div class="tabs-border">
												<div @click="setOrder('')" :class="{'tabs-border-active':orderby==''}" class="tabs-border-item">综合</div>
												<div @click="setOrder('buy_num')"  :class="{'tabs-border-active':orderby=='buy_num'}" class="flex flex-center tabs-border-item">
													<span class="mgr-5">销量</span>
													<span class="iconfont icon-godown"></span>
												</div>
												<div @click="setOrder('price')"  :class="{'tabs-border-active':orderby=='price'}" class="tabs-border-item flex flex-center ">
													<span class="mgr-5">价格</span>
													<span class="iconfont icon-godown"></span>
												</div> 
							</div>
							<div class="flexlist">
								<div class="flexlist-item" v-for="(item,index) in list" :key="index">
									<img @click="goProduct(item.id)" class="flexlist-img" :src="item.imgurl+'.100x100.jpg'" />
									<div class="flex-1">
										<div @click="goProduct(item.id)" class="flexlist-title pointer">{{item.title}}</div> 
										<div class="flex flex-ai-center mgb-5">
											<div class="cl-money f12">￥</div>
											<div class="cl-money f14 mgr-5">{{item.price}}</div>
											<div class="flex-1"></div>
											<div class="cl3 f10">已售{{item.buy_num}}件</div>
											
																
										</div>
										<div class="flex">
											<div class="flex-1"></div>
											<div v-if="item.isksid>0">
												<div @click="ksBox(item.id)" class="btn-small btn-outline-success">选规格</div>
											</div>
											<div class="pdb-5" v-else>
																
												<div v-if="item.incart" class="numbox prolist-numbox">
													<div @click="minusCart(item.id,item.cart_amount)" class="numbox-minus">-</div>
													<input type="text" name="amount" :value="item.cart_amount" class="numbox-num" />
													<div @click="plusCart(item.id,item.cart_amount)" class="numbox-plus">+</div>
												</div>
												<div @click="addCart(item.id)" class="btn-buy   iconfont icon-cart" v-else></div>
											</div>
										</div>
									</div>
							
								</div>
							</div>
							<div class="loadMore" v-if="per_page>0" @click="getList()">加载更多</div>
							
						</div>
					</div> 
					<div class="footer-row"></div>
					<div class="footerBox pd-5">
						<div @click="goGuest" class=" w60 pointer flex-center mgr-5">
							<div class="iconfont icon-service cl-primary f18"></div>
							<div class="f12">客服</div>
						</div>
						<div v-if="cart.cart_total_num==0" class="flex-1 flex">
							<div class="cl2">暂无商品，快去选购吧</div>
						</div>
						<div class="flex-1" v-if="cart.cart_total_num>0">
							<div class="cl-money">￥{{cart.cart_total_money}}</div>
							<div>运费金额 ￥{{cart.express_money}}</div>
						</div>
						<div v-if="cart.cart_total_num>0" class="btn" @click="goOrder">去结算</div>
					</div>
					<!--规格-->
					<div v-if="ksShow">
						<div class="modal-mask" @click="ksHide"></div>
						<div class="modal">
							<div class="modal-header">
								<div class="modal-title">选择款式</div>
								<div class="modal-close icon-close" @click="ksHide"></div>
							</div>
							<div class="modal-body pdt-10">
								<div class="ksBox mgb-10">
									<div class="kslist mgb-10">
										<div class="kslist-label">{{ksproduct.ks_label_name}}</div>
										<div @click="ks1(item.id)" v-bind:class="{'kslist-active':item.id==ksid1}" class="kslist-item" v-for="(item,index) in ksList"
										 :key="index">{{item.title}}</div>
									</div>
									<div class="kslist">
										<div class="kslist-label">{{ksproduct.ks_label_size}}</div>
										<div class="kslist-item" @click="ks2(item.id)" v-bind:class="{'kslist-active':item.id==ksid}" v-for="(item,index) in ksList2"
										 :key="index">{{item.size}}</div>
									</div>
								</div>
								<div class="flex">
									<div class="cl2 mgr-10 mgl-10">价格</div>
									<div class="cl-money">￥{{ksproduct.price}}</div>
									<div class="flex-1"></div>
									<div v-if="ksproduct.incart" class="numbox prolist-numbox">
										<div @click="ksMinusCart(ksproduct.id,ksproduct.cart_amount)" class="numbox-minus">-</div>
										<input type="text" name="amount" :value="ksproduct.cart_amount" class="numbox-num" />
										<div @click="ksPlusCart(ksproduct.id,ksproduct.cart_amount)" class="numbox-plus">+</div>
									</div>
									<div @click="ksAddCart(ksproduct.id)" class="btn-buy" v-else>买</div>
								</div>
							</div>
						</div>
					</div>
								 
					
				</div>
				
			</div>
			
			<div v-else-if="page=='raty'">
				<shop-raty :shopid="shopid"></shop-raty>		
			</div>
			<div v-else>
				<shop-detail :shopid="shopid"></shop-detail>
			</div>	
			
			
			<div @click="backTop" class="back-top">
				<div class="back-top-icon"></div>
				<div class="back-top-text">顶</div>
			</div>
		</div>
		{include file="footer.html"}
		<script>
			var shopid = "{$shop.shopid}";
		</script>
		<script src="/plugin/dt-ui/dt-ui-touch.js"></script>
		<script src="/plugin/dt-ui/raty.vue.js"></script>
		<script src="{$skins}b2b_shop/index/raty.js"></script>
		<script src="{$skins}b2b_shop/index/detail.js"></script>
		<script src="{$skins}b2b_shop/index/index.js"></script>
	</body>
</html>
