12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- $module = Yii::$app->controller->action->id;;
- if (!empty(Yii::$app->request->get('hid'))) {
- $name = \common\models\House::findOne(Yii::$app->request->get('hid'))['name'];
- $housenews = (new \common\models\News())->getHouseNews($name, 1);
- }
- ?>
- <!-- 导航 -->
- <div class="hu_nav" id="wdemo07">
- <div class="hu_nav_main scroller">
- <ul class="c clearfix">
- <li>
- <a href="/house/<?= $hid ?>">
- <span><?= \common\fm\Opencc::ConvertHn('楼盘首页') ?></span>
- <i></i>
- </a>
- </li>
- <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/details') > 0) echo 'class="on"' ?>>
- <a href="/house/details/<?= $hid ?>">
- <span><?= \common\fm\Opencc::ConvertHn('详情') ?></span>
- <i></i>
- </a>
- </li>
- <?php if (!empty($housenews)) { ?>
- <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/news') > 0) echo 'class="on"' ?>>
- <a href="/house/news/<?= $hid ?>">
- <span><?= \common\fm\Opencc::ConvertHn('动态') ?></span>
- <i></i>
- </a>
- </li>
- <?php } ?>
- <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/album') > 0) echo 'class="on"' ?>>
- <a href="/house/album/<?= $hid ?>">
- <span><?= \common\fm\Opencc::ConvertHn('相册') ?></span>
- <i></i>
- </a>
- </li>
- <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/type') > 0) echo 'class="on"' ?>>
- <a href="/house/type/<?= $hid ?>">
- <span><?= \common\fm\Opencc::ConvertHn('户型') ?></span>
- <i></i>
- </a>
- </li>
- </ul>
- </div>
- </div>
- <script>
- /**
- * 动态加载JS
- * url JS路径
- * callback 回调函数
- */
- function dynamicLoadJs(url, callback) {
- var head = document.getElementsByTagName('head')[0];
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.src = url;
- if (typeof (callback) == 'function') {
- script.onload = script.onreadystatechange = function () {
- if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
- callback();
- script.onload = script.onreadystatechange = null;
- }
- };
- }
- head.appendChild(script);
- }
- // 调用方法
- // dynamicLoadJs('/js/menu/lpnav.js',function(){});
- </script>
|