人人商城

_header.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {php global $_W;}
  2. {php $setting = $_W['setting'];}
  3. <!DOCTYPE html>
  4. <html lang="zh-CN">
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>{$title}</title>
  8. <meta name="keywords" content="{$basicset['keywords']}" />
  9. <meta name="description" content="{$basicset['description']}" />
  10. <!-- 新 Bootstrap 核心 CSS 文件 -->
  11. <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
  12. <link rel="stylesheet" href="./static/css/style.css">
  13. <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
  14. <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  15. <script type="text/javascript" src="./static/js/slick.js"></script>
  16. </head>
  17. <body>
  18. <header id="header">
  19. <div class="lynn-head">
  20. <h1 id="lynn-logo"><a href="{php echo webUrl()}"><img src="{php echo pctomedia($basicset['logo'])}" width="300" height="100" alt="logo"></a></h1>
  21. <nav id="lynn-nav">
  22. <ul class="lynn-nav-ul">
  23. <li><a href="{php echo webUrl()}" class="active">首页</a></li>
  24. <li><a href="{php echo webUrl('case/index')}">案例展示</a></li>
  25. <li><a href="{php echo webUrl('news/index')}">新闻中心</a></li>
  26. <li><a href="{php echo webUrl('article/index')}">最新文章</a></li>
  27. <li><a href="{php echo webUrl('contact/index')}">联系我们</a></li>
  28. </ul>
  29. </nav>
  30. {if isset($_GET['c']) && ($_GET['c']=='register' || $_GPC['c']=='login')}
  31. {else}
  32. <div id="lynn-login">
  33. |
  34. {if !isset($_GET['c']) || $_GET['c']=='home'}
  35. <a href="javascript:void(0);" id="lynn-login-header">登录</a>
  36. {else}
  37. <a href="{php echo webUrl('login/index')}" id="lynn-login-header">登录</a>
  38. {/if}
  39. {if !empty($setting['register']['open'])}<a href="{php echo webUrl('register/index')}" class="active">注册</a>{/if}
  40. </div>
  41. {/if}
  42. <div style="clear:both;"></div>
  43. {if !isset($_GET['c']) || $_GET['c']=='home'}
  44. <div class="index-login">
  45. <i class="index-login-top"></i>
  46. <a href="javascript:void(0);" class="index-login-close close glyphicon glyphicon-remove"></a>
  47. <h3 class="index-login-title">登录</h3>
  48. <div class="index-login-main">
  49. <form action="">
  50. <ul class="index-login-main-ul">
  51. <li><i class="glyphicon glyphicon-user"></i><input type="text" name="username" class="index-login-input" placeholder="邮箱/手机号/用户名" value=""></li>
  52. <li><i class="glyphicon glyphicon-lock"></i><input type="password" name="password" class="index-login-input" placeholder="请输入密码" value=""></li>
  53. <li style="display: none;"><input type="checkbox" class="index-login-checkbox">记住用户名</li>
  54. <li><input type="button" id="index-login-submit" class="index-login-submit" value="立即登录"></li>
  55. <li class="index-register">没有帐号?<a href="{php echo webUrl('register/index')}">立即注册</a></li>
  56. </ul>
  57. </form>
  58. </div>
  59. </div>
  60. <script type="text/javascript">
  61. $(function(){
  62. $(":input[name='username'],:input[name='password']").keydown(function(e){
  63. var e = e || event,
  64. keycode = e.which || e.keyCode;
  65. if (keycode==13) {
  66. $("#index-login-submit").trigger("click");
  67. }
  68. });
  69. $("#lynn-login-header").on("click",function(){
  70. /*if($(".index-login").css("display")=="block"){
  71. $(".index-login").fadeOut()
  72. }*/
  73. $(".index-login").fadeToggle()
  74. })
  75. $(".index-login-close").on("click",function(){
  76. $(".index-login").fadeOut()
  77. })
  78. $("#index-login-submit").on("click",function(){
  79. var username = $("input[name='username']").val();
  80. var password = $("input[name='password']").val();
  81. if(username == ''){
  82. alert("用户名不能为空!");
  83. }
  84. if(password == ''){
  85. alert("密码不能为空!");
  86. }
  87. if(username != '' && password != ''){
  88. $.ajax({
  89. url:"{php echo webUrl('login/check')}",// 跳转到 action
  90. data:{
  91. username : username,
  92. password : password
  93. },
  94. type:'post',
  95. cache:false,
  96. dataType:'json',
  97. success:function(data) {
  98. if(data.msg =="true" ){
  99. window.location.href=data.url;
  100. }else{
  101. alert(data.msg);
  102. }
  103. },
  104. error : function() {
  105. alert("异常!");
  106. }
  107. });
  108. }
  109. })
  110. })
  111. </script>
  112. {/if}
  113. </div>
  114. </header>