news_search.php 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. $news = \common\models\News::find()->andWhere(['del'=>1])->andWhere(['state'=>1])->limit(5)->orderBy(['create_at'=>SORT_DESC,'id'=>SORT_DESC])->asArray()->all();
  3. ?>
  4. <style>
  5. .news_search_box{position:fixed;top:0;left:0;width:100%;height:100%;background:#FFF;z-index:10000;display:none}
  6. .header_menu span{font-size:1.0625rem;color:#666;line-height:44px;display: block;}
  7. .news_search{margin-top:24px;}
  8. .news_search_title{padding:0 15px;}
  9. .news_search_title img{width:14px;height:14px;position:relative;top:-2px;}
  10. .news_search_title em{font-size:1rem;color:#333;font-weight:600;margin-left:3px;}
  11. .news_search ul{margin-top:15px;}
  12. .news_search ul li{padding:17px 15px;border-bottom:1px solid #F8F8F8;}
  13. .news_search ul li i{font-size:0.75rem;color:#666;font-weight:600;position:relative;top:3px;float:left;}
  14. .news_search ul li:nth-child(1) i ,.news_search ul li:nth-child(2) i , .news_search ul li:nth-child(3) i{color:#ED1505;}
  15. .news_search ul li span{font-size:1rem;color:#333;margin-left:6px;float:left;display:block;width:78%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}
  16. .search-header{ background: #fff; display: block; padding: 10px;border-bottom:1px solid #EEE;}
  17. .back-btn_maing{ float: left; width: 10%; display: block;}
  18. .back_search_m{ width: 88%; float: right; display: block;}
  19. .back_search_m .form input{ width: 85%; margin-bottom: 0px; display: block; float: left; border:none; border-radius:3px; height: 35px;font-size:0.75rem;padding:0 10px 0 36px;background:#EFEFEF;}
  20. .back_search_m .form{ position: relative;}
  21. .back_search_m .form .y_scriptm{ position: absolute; width:85%; left: 0px;top: 34px;z-index: 12;}
  22. .back_search_m .form .y_scriptm .select4_box{background:#fff; border: 1px solid #e1e1e1;width:100%;height:310px;overflow:auto;}
  23. .back_search_m .form .y_scriptm .select4_box ul li{width: 100%;padding:5px 0;}
  24. .back_search_m .form .y_scriptm .select4_box ul li a{ background:none; display: inline-block; width: 100%; text-align: left; padding: 0 10px;}
  25. .back_search_m .form .y_scriptm .select4_box ul li span:nth-child(1){display: block; float: left;}
  26. .back_search_m .form .y_scriptm .select4_box ul li span:nth-child(1){font-size: 1rem; color: #333;}
  27. .back_search_m .form .y_scriptm .select4_box ul li span:nth-child(1) i{font-size: 0.8rem;color: #666; display: inline-block; margin-left: 5px;}
  28. .back_search_m .form .y_scriptm .select4_box ul li span:nth-child(2){display: block; float: right; font-size: 0.8rem; color: #666;}
  29. .back_search_m .form .y_scriptm .select4_box ul li span:nth-child(2) em{font-size: 1rem;color: #f00;}
  30. .w_cls {position:absolute;top:6px;right:60px; display:none;}
  31. .w_sek {position:absolute;top:6px;left:10px;}
  32. .submit{ width: 15%; display: block; float: left; text-align: center; height: 35px; line-height: 35px;}
  33. .search-header .back-btn {position:absolute;left: 8px; top: 13px;width: 30px;height: 30px;background: url("/image/index/w_back.png") no-repeat;background-position: center;}
  34. </style>
  35. <body>
  36. <div class="news_search_box">
  37. <div class="search-header c">
  38. <div class="back-btn_maing">
  39. <a href="javascript:void(0);" class="back-btn"></a>
  40. </div>
  41. <div class="back_search_m">
  42. <div class="form">
  43. <form calss="index_form">
  44. <a class="w_sek" href="javascript:void(0);"><img src="/image/index/w_seek.png" alt=""></a>
  45. <input type="search" placeholder="搜索你感兴趣的内容" class="y_headerscr header_searchs">
  46. <a class="w_cls" href="javascript:void(0);"><img src="/image/index/w_cls.png" alt=""></a>
  47. <a class="submit" type="submit">
  48. <span>搜索</span>
  49. </a>
  50. <input type="submit" value="查找" style="display:none">
  51. </form>
  52. <div class="y_scriptm">
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="news_search">
  58. <div class="news_search_title">
  59. <img src="/image/v2/news1.png" alt="">
  60. <em>热门搜索</em>
  61. </div>
  62. <?php if (!empty($news)) { ?>
  63. <ul>
  64. <?php foreach ($news as $key=>$val) { ?>
  65. <li class="c"><i><?= $key+1 ?></i><span><?= $val['short_subject'] ?></span></li>
  66. <?php } ?>
  67. </ul>
  68. <?php } ?>
  69. </div>
  70. </div>
  71. </body>
  72. </html>