sidebar.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <style>
  2. .sidebar_box {position:fixed;top:0;right:-100%;width:100%;z-index:10002;padding-bottom:20px; background:#fff;/*box-shadow:1px 4px 15px 1px #efefef;*/}
  3. .sidebar_img {width:18px;height:15px;margin-right:17px;margin-top:20px;float:right;}
  4. .sidebar_img img {display:block;width:100%;height:100%;}
  5. .sidebar_list_box{ height: 320px;overflow-y: auto; width: 100%;}
  6. .sidebar_list {margin-top:20px;padding:0 25px 20px;}
  7. .sidebar_list ul li {display:inline-block;text-align:center;width:23.5%;}
  8. .sidebar_list ul li a div {display:inline-block;width:45px;height:45px;}
  9. .sidebar_list ul li a div img {display:inline-block;width:100%;height:100%;}
  10. .sidebar_list ul li a p {font-size:0.8125rem;text-align:center;color:#444;margin-top:10px;width:100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
  11. .sidebar_list ul li.on a{color:#F3983D;}
  12. .sidebar_list ul li a {display:block;padding:10px 0;}
  13. .sidebar_list p.title_m img{ width: 26%; height: auto;}
  14. .ground {width:100%;background:rgba(0,0,0,0.2);position:fixed;left:0;top:0;z-index:10000;}
  15. .m_language{position:absolute;top:16px;left:15px;}
  16. .m_language em{font-size:0.8rem;color:#333;}
  17. .m_language img{width:6px;height:6px;position:relative;top:2px;left:2px;}
  18. .m_language_text{display:none;padding:0 10px;position:absolute;top:30px;background:#FFF;border-radius: 5px;box-shadow:0px 0px 11px 0px rgba(198, 198, 198, 0.75);}
  19. .m_language_text span{border-bottom:1px solid #EEE;font-size:0.8rem;color:#333;padding:10px 0;display:block;width:65px;text-align:center;}
  20. .m_language_text span:last-child{border-bottom:0;}
  21. .m_language_text#none{display:none;}
  22. @media screen and (min-width: 300px) and (max-width: 374px) {
  23. .sidebar_list {padding:0 15px 15px;}
  24. /*.sidebar_list ul li {width:68px;}*/
  25. }
  26. </style>
  27. <!--侧边栏-->
  28. <div class="sidebar_box">
  29. <div class="sidebar_img"><img src="/image/index/menu_1.png" alt=""></div>
  30. <div class="m_language">
  31. <em>
  32. <?php
  33. switch (Yii::$app->language)
  34. {
  35. case 'ft':
  36. echo '繁体中文';
  37. break;
  38. case 'cn':
  39. echo '简体中文';
  40. break;
  41. }
  42. ?>
  43. </em>
  44. <img src="/image/menu_001.png" alt="">
  45. <div class="m_language_text">
  46. <a href="/index/language?language=cn"><span>简体中文</span><a>
  47. <a href="/index/language?language=ft"><span>繁体中文</span><a>
  48. </div>
  49. </div>
  50. <div class="sidebar_list_box">
  51. <div class="sidebar_list">
  52. <ul class="c">
  53. <?php
  54. $sysmenu = new \common\models\Frontend();
  55. $sysmenu->pid = 44;
  56. $sysmenu = $sysmenu->SonList(15,['name','url','icon','function']);
  57. ?>
  58. <?php if(!empty($sysmenu)){ \common\fm\Opencc::ArrayConvert($sysmenu,'name'); foreach ($sysmenu as $val){ ?>
  59. <li <?php if($_SERVER['REQUEST_URI'] == $val['url']) echo 'class="on"' ?>>
  60. <a href="<?= $val['url'] ?>">
  61. <div class=""><img src="<?= Yii::$app->params['httpImg']['host'],Yii::$app->params['httpImg']['city'],$val['icon'] ?>" alt=""></div>
  62. <p><?= $val['name'] ?></p>
  63. </a>
  64. </li>
  65. <?php } } ?>
  66. </ul>
  67. </div>
  68. <div class="sidebar_list" >
  69. <p class="title_m"><img src="/image/xqdz3.png" alt=""></p>
  70. <ul class="c" style="margin-top:20px;">
  71. <?php
  72. $sysmenu = new \common\models\Frontend();
  73. $sysmenu->pid = 82;
  74. $sysmenu = $sysmenu->SonList(15,['name','url','icon','function']);
  75. ?>
  76. <?php if(!empty($sysmenu)){ \common\fm\Opencc::ArrayConvert($sysmenu,'name'); foreach ($sysmenu as $val){ ?>
  77. <li <?php if($_SERVER['REQUEST_URI'] == $val['url']) echo 'class="on"' ?>>
  78. <a href="<?= $val['url'] ?>">
  79. <div class=""><img src="<?= Yii::$app->params['httpImg']['host'],Yii::$app->params['httpImg']['city'],$val['icon'] ?>" alt=""></div>
  80. <p><?= $val['name'] ?></p>
  81. </a>
  82. </li>
  83. <?php } } ?>
  84. </ul>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="ground"></div>
  89. <input type="hidden" value="<?php echo $_SERVER['SERVER_NAME'];?>">