<!--{assign var="menu_id" value="shop"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<div class="oe_ntop">
  <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>商家详情</p>
</div>
<div class="oe_shop_top">
  <dl>
    <dt><img src="<!--{$shop.logourl}-->" alt="<!--{$shop.shopname}-->" /></dt>
    <dd>
      <h1><!--{$shop.shopname}--></h1>
      <p class="p_1">
	    <!--{if $shop.shoprz == "1"}--><span class="span_1">认</span><!--{/if}--></p>
    </dd>
    <div class="clear"></div>
  </dl>
  <div class="oe_shop_topsc" f='collectshop' data-id="<!--{$shop.shopid}-->">
    <i class="iconfont">&#xe610;</i> 收藏
  </div>
</div>
<div class="oe_shopnav">
  <ul>
    <li class="li_1" f="select_mod" data-mod="goods" data-url="<!--{$oefile}-->&c=shop&a=goods&shopid=<!--{$shop.shopid}-->&datatype=json"><i class="iconfont">&#xe602;</i>商品</li>
    <li class="li_2" f="select_mod" data-mod="activity" data-url="<!--{$oefile}-->&c=shop&a=activity&shopid=<!--{$shop.shopid}-->&datatype=json"><i class="iconfont">&#xe626;</i>活动</li>
    <li class="li_3" f="select_mod" data-mod="coupon" data-url="<!--{$oefile}-->&c=shop&a=coupon&shopid=<!--{$shop.shopid}-->&datatype=json"><i class="iconfont">&#xe605;</i>优惠券</li>
    <li class="li_4" f="select_mod" data-mod="gallery" data-url="<!--{$oefile}-->&c=shop&a=gallery&shopid=<!--{$shop.shopid}-->&datatype=json"><i class="iconfont">&#xe625;</i>作品集</li>
  </ul>
  <div class="clear"></div>
</div>
<div class="ge"></div>

<div id="detail_box" class="select_mod">
<div class="oe_shop_1">
  <div class="hd">最新活动</div>
  <div class="bd"> 
    <!--{assign var="newactivity" value=vo_list("mod={activity} num={4} where={v.shopid='<!--{$shop.shopid}-->'}")}--> 
    <!--{foreach $newactivity as $volist}-->
    <dl onclick="goUrl('<!--{$oefile}-->&c=activity&a=detail&id=<!--{$volist.actid}-->');">
      <dt><img src="<!--{$volist.thumbimg}-->" /></dt>
      <dd>
        <h3> <!--{$volist.title}--> </h3>
        <p>特惠价: <span>¥<!--{$volist.price}--> </span> <s>原价: ¥<!--{$volist.oldprice}--></s></p>
        <label class="iconfont">&#xe615;</label>
      </dd>
      <div class="clear"></div>
    </dl>
    <!--{/foreach}--> 
  </div>
</div>
<div class="ge"></div>

<div class="oe_shop_2">
  <div class="hd">推荐商品</div>
  <div class="bd"> 
    <!--{assign var="elitegoods" value=vo_list("mod={goods} num={4} where={v.elite='1' AND v.shopid='<!--{$shop.shopid}-->'}")}--> 
    <!--{if !empty($elitegoods)}--> 
    <!--{foreach $elitegoods as $volist}--> 
    <dl style="margin-left:5px;" onclick="goUrl('<!--{$oefile}-->&c=goods&a=detail&id=<!--{$volist.goodsid}-->');">
    <dt><img src="<!--{$volist.thumbimg}-->" /></dt>
    <dd>
      <h4> <!--{$volist.goodsname}--></h4>
      <p><i>¥<!--{doubleval($volist.price)}--></i>&nbsp;&nbsp;&nbsp;<span>人气:<!--{$volist.hits}--></span></p>
    </dd>
    </dl>
    <!--{/foreach}--> 
    <!--{/if}-->
    <div class="clear"></div>
  </div>
</div>
<div class="ge"></div>


<div class="oe_shop_3">
  <div class="hd">作品集</div>
  <div class="bd"> 
    <!--{assign var="newgallery" value=vo_list("mod={gallery} num={2} where={v.shopid='<!--{$shop.shopid}-->'}")}-->
    <!--{foreach $newgallery as $volist}-->
    <dl onclick="goUrl('<!--{$oefile}-->&c=gallery&a=detail&id=<!--{$volist.galleryid}-->');">
      <dt><img src="<!--{$volist.thumbimg}-->" /></dt>
      <dd><!--{$volist.name}--></dd>
    </dl>
    <!--{/foreach}--> 
  </div>
</div>
<div class="ge"></div>
</div>


<div id="goods_box" class="select_mod" style="display:none;">
<div class="oe_shopgoods_list">
  <div class="bd" id="goods_data">

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

<div id="activity_box" class="select_mod" style="display:none;">
<div class="oe_shop_activity_list" id="activity_data">
</div>
</div>

<div id="coupon_box" class="select_mod" style="display:none;">
<div class="oe_shop_coupon_list" id="coupon_data">
</div>
</div>

<div id="gallery_box" class="select_mod" style="display:none;">
<div class="oe_gallery_list" id="gallery_data">
</div>
</div>

<div class="oe_page" id="page_more_btn" style="display:none;">点击加载下一页</div>
<input type="hidden" name="page" id="page" value="2" />
<input type="hidden" name="reqs_url" id="reqs_url" value="" />
<input type="hidden" name="mod" id="mod" value="" />

<div class="kong"></div>
<div class="shop_bar">
  <span class="span_1" onclick="goUrl('<!--{$oefile}-->&c=dianping&a=list&shopid=<!--{$shop.shopid}-->');"><i class="iconfont">&#xe611;</i>点评</span>
  <span class="span_2" onclick="goUrl('<!--{$oefile}-->&c=words&a=list&shopid=<!--{$shop.shopid}-->');"><i class="iconfont">&#xe612;</i>留言</span>
  <span class="span_3" onclick="goUrl('<!--{$oefile}-->&c=shop&a=about&shopid=<!--{$shop.shopid}-->');"><i class="iconfont">&#xe60d;</i>介绍</span>
  <div class="clear"></div>
</div>
<script type="text/javascript">
$(function(){
	//宽度
	$max_width = (WIN_WIDTH-15)/2;
	$(".oe_shop_2 .bd dl").css({"width":$max_width});
	$(".oe_shop_2 .bd dt img").css({"width":$max_width});
	$(".oe_shop_2 .bd dt img").css({"height":$max_width});
	

	$("[f='select_mod']").bind("click", function(){
		$_mod = $(this).attr("data-mod");
		$_url = $(this).attr("data-url");
		$("#page").val(2);
		$("#page_more_btn").hide();

		$(".oe_shopnav ul li").removeClass("current");
		$(this).addClass("current");

		$(".select_mod").hide();
		$("#"+$_mod+"_box").show();
		$("#mod").val($_mod);
		$("#reqs_url").val($_url);

		_oeGetListData("", 1, $_mod+"_data");

	});

    $("[f='collectshop']").bind("click", function(){ //收藏店铺
        $shop_id = $(this).attr("data-id");
        $.ajax({
            type: "POST",
            url: WAP_APPFILE ,
            cache: false,
            data: {c:"collect", a:"collectshop", id:$shop_id, r:get_rndnum(8)},
            dataType: "json",
            success: function($data) {
                $json = eval($data);
                $response = $json.response;
                $result = $json.result;
                if ($response == "1") { //成功
                    ToastShow("收藏成功");
                }
                else {
                    if ($result.length > 0) {
                        ToastShow($result)
                    }
                    else {
                        ToastShow("收藏失败");
                    }
                }
            },
            error: function() {
                ToastShow("收藏失败，请检查网络！");
            }
        });
    });



    //加载下一页
	$("#page_more_btn").bind("click", function(){
		_oeGetListData("", $("#page").val(), $("#mod").val()+"_data");
	});

});
</script>
</body>
</html>