home.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/4/20
  6. * Time: 上午12:44
  7. */
  8. use mobile\assets\AppAsset;
  9. use yii\helpers\Html;
  10. use yii\helpers\Url;
  11. AppAsset::addCss($this,Yii::$app->request->baseUrl."/overseas/js/index/swiper-3.4.2.min.css");
  12. AppAsset::addScript($this,Yii::$app->request->baseUrl.'/overseas/js/index/swiper-3.4.2.min.js');
  13. AppAsset::addScript($this,Yii::$app->request->baseUrl.'/overseas/js/news/js.js');
  14. AppAsset::addCss($this,Yii::$app->request->baseUrl."/overseas/css/news.css");
  15. AppAsset::addScript($this,Yii::$app->request->baseUrl."/overseas/js/news/home.js");
  16. AppAsset::addScript($this,Yii::$app->request->baseUrl."/overseas/js/homelist/dropload.min.js");
  17. AppAsset::addScript($this,Yii::$app->request->baseUrl.'/overseas/js/search_public.js');
  18. $this->title = '资讯首页';
  19. ?>
  20. <div id="serachBox2">
  21. <?php $this->beginContent('@app/views/public/nav.php'); ?>
  22. <?php $this->endContent(); ?>
  23. <!-- 轮播图 -->
  24. <div class="news_banner swiper-container2">
  25. <ul class="y_lphomepc_swip_main swiper-wrapper">
  26. <?php if(!empty($top)){
  27. foreach ($top as $val){
  28. ?>
  29. <li class="y_neirongpc swiper-slide">
  30. <a href="/news/details/<?= $val['id'] ?>">
  31. <div class="baner">
  32. <img src="<?= Yii::$app->params['httpImg']['host'],Yii::$app->params['httpImg']['pushnews'],$val['img'] ?>" alt="">
  33. <div class="font_box"><?= $val['subject'] ?></div>
  34. </div>
  35. </a>
  36. </li>
  37. <?php } } ?>
  38. </ul>
  39. <div class="y_longhr">
  40. <div class="swiper-pagination"></div>
  41. </div>
  42. </div>
  43. <!-- 导航 -->
  44. <div class="news_nav find_nav">
  45. <div class="find_nav_left">
  46. <div class="find_nav_list">
  47. <ul>
  48. <li class="find_nav_cur"><a data-id="0" class="on" href="javascript:;">全部</a></li>
  49. <?php foreach ($lei as $val){
  50. ?>
  51. <li class="find_nav_cur"><a href="javascript:;" <?php
  52. $a = Yii::$app->request->get('cid');
  53. if(isset($a) && $a == $val['id'] )
  54. {
  55. echo 'class="on"';
  56. }
  57. ?> data-id="<?= $val['id'] ?>"><?= $val['news_name'] ?></a></li>
  58. <?php } ?>
  59. </ul>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- 列表 -->
  64. <div class="news_list">
  65. </div>
  66. </div>