<fh-function>
mysqli_query($conn, "update sl_product set P_view=P_view+1 where P_id=".$id);
$sql="select * from sl_product,sl_psort where P_sort=S_id and P_id=".$id;
  $result = mysqli_query($conn, $sql);
  $row = mysqli_fetch_assoc($result);
  if (mysqli_num_rows($result) > 0) {
    $S_id=$row["S_id"];
    $P_id=$row["P_id"];
    $P_pic=$row["P_pic"];
    $P_tag=$row["P_tag"];
    $P_mid=$row["P_mid"];
    $P_shuxing=$row["P_shuxing"];

    switch ($row["P_selltype"]) {
    case 0:
    $P_rest=1;
    break;

    case 1:
    $P_rest=getrs("select count(C_id) as C_count from sl_card where C_sort=".intval($row["P_sell"])." and C_use=0","C_count");
    break;

    case 2:
    $P_rest=$row["P_rest"];
    break;
  }
  }
</fh-function>
<!DOCTYPE html>
<html><head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-title" content="Modown">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>[P_title] - [fh_title]</title>
    <link href="media/[fh_ico]" rel="shortcut icon" />
    <meta name="description" content="[P_description]" />
    <meta name="keywords" content="[P_keywords]" />
    <link rel="stylesheet" href="template/t16/assets/web/styles/libs.css?1638005418">
    <link rel="stylesheet" href="template/t16/assets/web/styles/style.css?1638005418">
    <link rel="stylesheet" href="template/t16/assets/web/fonts/css/fontawesome-all.min.css">
    <link rel="stylesheet" href="template/t16/assets/styles/swiper.min.css">
    <script type="text/javascript" src="template/t16/assets/scripts/jquery.min.js"></script>
    <script type="text/javascript" src="template/t16/assets/scripts/swiper.min.js"></script>
    <script type="text/javascript" src="template/t16/assets/scripts/layer.js"></script>
    <link rel="stylesheet" href="template/t16/assets/scripts/theme/default/layer.css?v=3.3.0" id="layuicss-layer">
    <script type="text/javascript" src="template/t16/assets/scripts/bjplus.js"></script>
    <script type="text/javascript" src="template/t16/assets/scripts/tmodjs.js"></script>
    <script type="text/javascript" src="template/t16/assets/scripts/clipboard.min.js"></script> 
<style>
#collection_shop a{color: #fff;}
#collection_shop a span{color: #fff !important;}
.widget-postlist p{margin-bottom: 5px;font-size: 14px}

#buy .add{
  height:25px; width:25px; margin:0 5px 0 5px;line-height:100%;
  border: hidden;
  background-color: #f32196;
  color: #FFFFFF;
  font-size: 15px;
  line-height: 100%;
  cursor: pointer;
  border-radius:3px;
}

#buy .add:hover {
  border: #f32196 solid 1px;
  background-color: #FFFFFF;
  color: #f32196;
}

#amount{
  border-top:1px solid #ABADB3;
  border-left:1px solid #ABADB3;
  border-right:1px solid #ddd;
  border-bottom:1px solid #ddd;
  height:24px;
  width:50px;
  padding:0 5px;
  line-height:100%;
}
</style>
  </head>
<body>  

[fh_header]

<div class="single">
   <div class="main">
      <div class="container clearfix">
        <div class="breadcrumbs">当前位置：<span><a href="./"><span>首页</span></a></span>
          <span class="sep"><i class="fa fa-angle-right"></i></span> 
        <span><a href="?type=product&id=[S_id]"> <span>[S_title]</span></a></span> 
        <span class="sep"><i class="fa fa-angle-right"></i></span> 
        <span><a href="?type=productinfo&id=[P_id]"><span>[P_title]</span></a></span> 
      </div>
        <div class="content-wrap">
          <div class="content">
            <article class="single-content">
                <header class="article-header"> <h1 class="article-title">[P_title]</h1>
                          <div class="article-meta">
                            <span class="item post-sign">推荐</span>    
                <span class="item"><i class="icon icon-time"></i> [P_time]</span>   
                <span class="item"><i class="icon icon-eye"></i> [P_view]</span>

              </div>
                        </header>        


                        <div class="m-lg">
     
     <div class="row">

        <div class="col-md-5" style="width: 40%;display: inline-block;vertical-align: top;">
          <div class='met-showproduct-list fngallery text-center slick-dotted' id="met-imgs-carousel">
            <div class='slick-slide lg-item-box' data-src="[P_pic]" data-exthumbimage='[P_pic]'> 
              <span> <img src='[P_pic]' data-src='[P_pic]' class="img-responsive" alt="[P_title]" style="width:100%;max-width: 350px;"/> </span>

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


        <div class="col-md-7 product-intro" style="width: calc(60% - 30px);display: inline-block;vertical-align: top;margin-left: 20px">

          <div class="shop-product-intro grey-500">
            <div class="padding-20 bg-grey-100 price" style="margin-bottom: 20px;"> 价格：￥<span id="price" class="red-600" style="font-weight: bold;font-size: 25px;color: #ff6600;">[P_price]</span>[P_vip]</div>
            <div style="margin-top: -10px">[P_quan]</div>
            <div style="margin-top: -10px;margin-bottom: 5px;">[P_limit]</div>
            <div class="form-group inline-block margin-top-30">
              <form id="buy" method="post" action="buy.php?type=productinfo&id=[P_id]">
                <p style="margin-bottom: 10px"><b>购买数量：</b>
              <input type='button' class='add' value='-' onClick='javascript:if(this.form.amount.value>=2){this.form.amount.value--;}'>
              <input type='text' name='no' value='1' id='amount'>
              <input type='button' class='add' value='+' id='plus' onClick='javascript:if(this.form.amount.value<[P_rest]){this.form.amount.value++;}'>
              （库存：<span id="gg_rest">[P_resttitle]</span>）</p>
              [P_gg]
              [fh_address]
              <fh-function>
              $api=$api."<input type=\"submit\" name=\"button\" class=\"btn btn-lg btn-squared btn-primary margin-right-20\" value=\"立即购买\" /> ";
              $api=$api.unlogin_product("btn btn-lg btn-squared btn-primary margin-right-20",$id);
              </fh-function>
              </form>
              <div id="collection_product" pid="[P_id]"></div>
            </div>
          </div>
        </div>
      </div>
    </div>

<div style="border-top: solid 1px #DDD;margin: 20px 0"></div>
            <div class="article-content">
                  [P_content]                                               
              
                                                    </div>              

                        
            <div class="article-shares">
                <a href="javascript:;" class="share-weixin" title="分享到微信">
                  <i class="icon icon-weixin"></i>
              <span class="share-popover"><span class="share-popover-inner" id="weixin-qrcode"></span></span></a>
              <a data-share="qzone" class="share-qzone" title="分享到QQ空间">
                 <i class="icon icon-qzone"></i>
              </a>
              <a data-share="weibo" class="share-tsina" title="分享到新浪微博">
                  <i class="icon icon-weibo"></i>
              </a>
              <a data-share="qq" class="share-sqq" title="分享到QQ好友">
                <i class="icon icon-qq"></i>
              </a>
              <a data-share="douban" class="share-douban" title="分享到豆瓣网">
                  <i class="icon icon-douban"></i>
              </a>
              <a href="javascript:;" class="article-cover right share" title="分享卡片">
                  <i class="icon icon-cover"></i> 封面图
              </a>
            </div>
          </article>                    
          
          <nav class="article-nav">
                          <span class="article-nav-prev">上一个<br>
                <a href="[P_Purl]" rel="prev">[P_Ptitle]</a>
            </span>
                                    <span class="article-nav-next">下一个<br>
                <a href="[P_Nurl]" rel="next">[P_Ntitle]</a>
            </span>
                      </nav>
          </div>
        </div>
    
        <aside class="sidebar">
          <div class="theiaStickySidebar">
              <div class="widget widget-postlist">
              <fh-function>
if($P_mid==0){
  $api=$api."<div>
  <div style=\"margin-bottom:10px\"><img src=\"media/".getrs("select C_ico from sl_config","C_ico")."\" style=\"border:solid 1px #DDDDDD;padding:5px;width:40px;height:40px;\">
  <h4 style=\"display: inline-block;margin-bottom:-45px;\">官方自营店</h4></div>
  <p>信誉：<img title=\"信用值10000\" src=\"template/t12/img/dj/s-crown-5.gif\" /></p>
  <p>掌柜：官方卖家</p>
  <p>宝贝：".getrs("select count(P_id) as P_count from sl_product where P_mid=0 and P_del=0 ".$M_pinfo." ","P_count")."件</p>
  <p>创店：".date("Y-m-d",filemtime("conn/conn.php"))."</p>
  <p>联系：<a href=\"./?type=contact\">点击联系客服</a></p>

  </div>";
}else{
$sql="Select * from sl_member where M_id=$P_mid";
  $result = mysqli_query($conn, $sql);
  if (mysqli_num_rows($result) > 0) {
    $row = mysqli_fetch_assoc($result);
    $M_head=$row["M_head"];
    $M_login=$row["M_login"];
    $M_shop=$row["M_shop"];
    $M_qq=$row["M_qq"];
    $M_sellertime=$row["M_sellertime"];
  }

  $api=$api."<div>
  <div style=\"margin-bottom:10px\"><img src=\"media/".$M_head."\" style=\"border:solid 1px #DDDDDD;padding:3px;width:40px;height:40px;\">
  <h4 style=\"display: inline-block;margin-bottom:-45px;\">".$M_shop."</h4></div>
  <p>信誉：<img title=\"信用值10000\" src=\"template/t12/img/dj/s-crown-5.gif\" /></p>
  <p>掌柜：".$M_login."</p>
  <p>宝贝：".getrs("select count(P_id) as P_count from sl_product where P_mid=$P_mid and P_del=0 ".$M_pinfo." ","P_count")."件</p>
  <p>创店：".date("Y-m-d",strtotime($M_sellertime))."</p>
  <p>QQ：<a href=\"http://wpa.qq.com/msgrd?v=3&uin=".$M_qq."&site=qq&menu=yes\">".$M_qq."</a></p>
  <p><a class=\"btn btn-sm btn-default\" href=\"./shop.php?M_id=".$P_mid."\" target=\"_blank\">进入店铺</a> <button class=\"btn btn-sm btn-default\"><span id=\"collection_shop\" mid=\"".$P_mid."\"></span></button></p>
  </div>";
}

</fh-function>

            </div>
          </div>
      
            <div class="widget widget-postlist">
              <h3><i class="icon icon-posts"></i> 最新发布</h3>
              <ul class="clearfix hasimg">


                    <fh-function>
      $i=1;
 $sql="select * from sl_product,sl_psort where S_id=P_sort and S_del=0 and P_del=0 ".$M_pinfo."  order by P_time desc limit 8";
          s[[


      $api=$api."<li onclick=\"location.href='?type=productinfo&id=".$row["P_id"]."'\">
              <a href=\"?type=productinfo&id=".$row["P_id"]."\" target=\"_blank\" title=\"".$row["P_title"]."\" class=\"img\">
                <img src=\"".pic($row["P_pic"])."\" class=\"thumb\" alt=\"".$row["P_title"]."\">
              </a>
              <h4><a href=\"?type=productinfo&id=".$row["P_id"]."\" target=\"_blank\" title=\"".$row["P_title"]."\">".$row["P_title"]."</a></h4>
              <p class=\"meta\">
                <span class=\"time\"><i class=\"icon icon-time\"></i> ".date("Y-m-d",strtotime($row["P_time"]))."</span> 
                <span class=\"views\"><i class=\"icon icon-eye\"></i> ".$row["P_view"]."</span> 
                <span class=\"comments\"><i class=\"icon icon-posts\"></i> ￥".p($row["P_price"])."</span>
              </p>
            </li>";


     $i=$i+1;
     ]]
</fh-function>



                           
                
                    </ul>
                </div>
          

          <div class="widget widget-postlist">
              <h3><i class="icon icon-posts"></i> 最多浏览</h3>
              <ul class="clearfix hasimg">


                    <fh-function>
      $i=1;
 $sql="select * from sl_product,sl_psort where S_id=P_sort and S_del=0 and P_del=0 ".$M_pinfo."  order by P_view desc limit 8";
          s[[


      $api=$api."<li onclick=\"location.href='?type=productinfo&id=".$row["P_id"]."'\">
              <a href=\"?type=productinfo&id=".$row["P_id"]."\" target=\"_blank\" title=\"".$row["P_title"]."\" class=\"img\">
                <img src=\"".pic($row["P_pic"])."\" class=\"thumb\" alt=\"".$row["P_title"]."\">
              </a>
              <h4><a href=\"?type=productinfo&id=".$row["P_id"]."\" target=\"_blank\" title=\"".$row["P_title"]."\">".$row["P_title"]."</a></h4>
              <p class=\"meta\">
                <span class=\"time\"><i class=\"icon icon-time\"></i> ".date("Y-m-d",strtotime($row["P_time"]))."</span> 
                <span class=\"views\"><i class=\"icon icon-eye\"></i> ".$row["P_view"]."</span> 
                <span class=\"comments\"><i class=\"icon icon-posts\"></i> ￥".p($row["P_price"])."</span>
              </p>
            </li>";


     $i=$i+1;
     ]]
</fh-function>



                           
                
                    </ul>

                </div>

          </div>
        </aside>
      </div>
    </div>
</div>
<div class="zcs">
    <div class="sign">      
      <div class="sign-mask"></div>     
      <div class="sign-box">          
        <div class="sign-in">  
            <div class="form-item title">输入邮箱</div>
          <div class="form-item"><input type="email" name="email" value="" class="form-control" placeholder="请输入转存的邮箱"><i class="icon icon-mail"></i></div>       
          <div class="btn signinsubmit-loader email">提 交</div>
        </div>
        <div class="sign-wrap">
            <div class="sign-close">×</div>
        </div>
      </div>    
    </div>
</div>
  


<div class="wppay-custom-modal-box paytype">
  <div class="wppay-modal">
    <div class="layui-layer-title">请选择支付方式</div>
    <div class="layui-layer-setwin">
        <a href="javascript:;" class="layui-layer-ico layui-layer-close1"></a>
    </div>
    <input type="hidden" id="gid" value="">
        <input type="hidden" id="gtype" value="">   
    <div class="erphp-wppay-qrcode mobantu-wppay">
          <div class="savepay erphpdown-type-link bg-phone" data-code="xunhupay"><i class="icon icon-xunhupay-color"></i> 微信支付</div>
        </div>
    <div class="wppay-desc">虚拟产品，一经支付，概不退款！</div>
  </div>
</div>
<script language="javascript">
  $('.group').unbind('click').click(function() {  
    $(".groups").show();
  });
    $('.vips').unbind('click').click(function() {
    var gid = $(this).data('gid');
      $('#gid').val(gid);
    $('#gtype').val(4);
    $(".paytype").show();
  });
  
    $('.kid').unbind('click').click(function() {
      $('#gid').val("8774");
    $('#gtype').val(3);
    $(".paytype").show();
  });
  
    $('.cid').unbind('click').click(function() {
      $('#gid').val("8774");
    $('#gtype').val(2);
    $(".paytype").show();
  });
  
  $('.aid').unbind('click').click(function() {
      $('#gid').val("130842");
    $('#gtype').val(1);
    $(".paytype").show();
  });

  $('.layui-layer-ico').unbind('click').click(function() {
    $(".paytype").hide();
    $(".groups").hide();
  }); 

  $('.savepay').click(function () {
    var gid = $('#gid').val();
    var gtype = $('#gtype').val();
    var ptype = $(this).data('code');
    if (gid == '' || ptype == '' || gtype == '') {
      layer.msg('请刷新重试!');
      return false;
    }
    var loads = layer.load(2);
    core_json("/index.php?mod=mobile&act=confirm&do=order&op=confirm&m=eshop&beid=10", {ptype:ptype,gid:gid,gtype:gtype}, function (pjson) {
      layer.close(loads);
      if (pjson.status == 0){
        layer.msg(pjson.result);
        return false;
      }
      if (pjson.status == 2){
        $(".paytype").hide();
        layer.msg('请先登录');        
        setTimeout(function() {
              $('.signin-loader').click();
            }, 1000);       
        return false;
      }
      if (pjson.status == 1){
        if (ptype == 'xunhupay'){
          layer.msg(pjson.result.msg,{
                        time: 1000, 
                    }, function(){
              location.href = pjson.result.url;
                    });
          return false;
          }
        if (ptype == 'credit'){
          layer.msg(pjson.result.msg,{
                        time: 1000, 
                    }, function(){
              location.href = pjson.result.url;
                    });
          return false;
          }
        layer.msg(pjson.result.msg,{
                    time: 1000, 
                }, function(){
            layer.open({
                        type: 2,
                        area: ['330px', '480px'],
                        title: false,
                        resize:false,
                        scrollbar: false,
                        content: pjson.result.url + '&type=1'
                    });
        });
                return false;              
      }
      layer.msg('请刷新重试!');        
    }, true);
  });
</script>

<script language="javascript">




  $('.share-weixin').each(function(){
    if( !$(this).find('.share-popover').length){
      $(this).append('<span class="share-popover"><span class="share-popover-inner" id="weixin-qrcode"></span></span>');
      
    }
  })
    $(".article-shares a").on('click', function(){
    var to = $(this).data('share'); 
    var title = "";
    var desc = "";
    var pic = "";
    var url = "<fh-function>$api=$api.gethttp().$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['REQUEST_URI'];</fh-function>";
    switch(to){
        case 'qq':
            url = 'http://connect.qq.com/widget/shareqq/index.html?url='+url+'&desc='+desc+'&summary='+title+'&site=zeshlife&pics='+pic;
            window.open(url);
        break;
        case 'weibo':
            url = 'http://service.weibo.com/share/share.php?title='+title+'&url='+url+'&source=bookmark&pic='+pic;
            window.open(url);
        break;
        case 'douban':
            url = 'http://www.douban.com/share/service?image='+pic+'&href='+url+'&name='+title+'&text='+desc;
            window.open(url);
        break;
        case 'qzone':
            url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+url+'&title='+title+'&desc='+desc;
            window.open(url);
        break;
        case 'tqq':
            url = 'http://share.v.t.qq.com/index.php?c=share&a=index&url='+url+'&title='+title;
            window.open(url);
        break;
        case 'renren':
            url = 'http://widget.renren.com/dialog/share?srcUrl='+pic+'&resourceUrl='+url+'&title='+title+'&description='+desc;
            window.open(url);
          break;  
    }     
  });
  var clipboard = new Clipboard('.btns');
  clipboard.on('success', function(e) {
    layer.msg('提取密码复制成功');
    setTimeout(function() {
      window.location = e.trigger.dataset.clipboardUrl;
    }, 1000);
  });
  clipboard.on('error', function(e) {
    layer.msg('提取密码复制失败');
  });
    $('.zhuancun').click(function () {
     $(".zcs").addClass("sign-show");
  });
  $('.sign-close').click(function () {
     $(".zcs").removeClass("sign-show");
  });
    $('.nozc').click(function () {
     layer.msg('权限不足,请开通VIP会员或单独购买！');
  });
  $('.email').click(function () {
    var email = $('input[name="email"]').val();
    if (email == '') {
      layer.msg('请输入转存的邮箱!');
      return;
    }
    if (!email.match(/^\w+@\w+\.\w+$/i)){
      layer.msg('邮箱格式不正确!');
      return;
        }
    var loads = layer.load(2);
    core_json("/index.php?mod=mobile&act=article&do=article&op=email&m=eshop&id=130842&beid=10", {email:email}, function (pjson) {
      layer.close(loads);
      if (pjson.status == 0){
        layer.msg(pjson.result);
        return;
      }
      if (pjson.status == 2){
        layer.msg('请先登录');        
        setTimeout(function() {
              $('.signin-loader').click();
            }, 1000);       
        return false;
      }
      if (pjson.status == 1){
        $(".zcs").removeClass("sign-show");
        layer.msg('转存成功，发送大约需3-5分钟，请注意查收！');        
        return;                 
      }
      layer.msg('请刷新重试!');        
    }, true);
  });
  
  $('.article-collect').click(function () {
    var gid = $(this).data('id');
    var ctype = $('#ctype').val();
    if (gid == '') {
      layer.msg('请刷新重试!');
      return;
    }
    var loads = layer.load(2);
    core_json("/index.php?mod=mobile&act=utility&do=saves&op=collect&beid=10", {gid:gid,gtype:1,ctype:ctype}, function (pjson) {
      layer.close(loads);
      if (pjson.status == 2){
        layer.msg('请先登录');        
        setTimeout(function() {
              $('.signin-loader').click();
            }, 1000);       
        return false;
      }
      if (pjson.status == 1){
        layer.msg(pjson.result);
        var ctype = $('#ctype').val(1);
        $(".article-collect").addClass("active");
        $(".article-collect span").html('已收藏');     
      }
      if (pjson.status == 0){
        layer.msg(pjson.result);
        var ctype = $('#ctype').val(0);
        $(".article-collect").removeClass("active");
        $(".article-collect span").html('收藏');        
      }
    }, true);
  }); 

</script>


[fh_footer]
<script>
  var qrcodey = new QRCode('weixin-qrcode', {width: 80,height: 80,colorDark: '#000000',colorLight: '#ffffff',correctLevel: QRCode.CorrectLevel.H});
qrcodey.makeCode("<fh-function>$api=$api.gethttp().$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['REQUEST_URI'];</fh-function>");
</script>
</body></html>