main.php
4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
use yii\helpers\Html;
use app\ht\assets\AppAsset;
AppAsset::register($this);
$baseUrl = Yii::$app->request->baseUrl;
$directoryAsset = Yii::$app->assetManager->getBundle('app\ht\assets\AppAsset')->baseUrl;
$appendTimestamp = Yii::$app->assetManager->appendTimestamp;
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<link rel="shortcut icon" href="<?=$baseUrl?>/favicon.ico" />
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<?= Html::csrfMetaTags() ?>
<title><?=Html::encode(Yii::$app->name)?></title>
<?php $this->head() ?>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="<?=$baseUrl?>/fits-ie/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="<?=$baseUrl?>/fits-ie/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<?=$this->render('_bootstrap-table-style')?>
</head>
<body class="hold-transition">
<?php $this->beginBody() ?>
<?=$this->render(
'_main-header',
['directoryAsset' => $directoryAsset]
)?>
<?=$this->render(
'_main-content',
['directoryAsset' => $directoryAsset]
)?>
<?=$this->render('_lte')?>
<?php $this->endBody() ?>
</body>
<script type="text/javascript">
var isMoblie = false;
var openList = false;
var navMenu = false;
function checkIsMoblie() {
var userAgentInfo = navigator.userAgent;
var agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
isMoblie = false;
for ( var v = 0; v < agents.length; v++ ) {
if (userAgentInfo.indexOf(agents[v]) > 0) {
isMoblie = true;
break;
}
}
console.log(isMoblie);
}
checkIsMoblie();
if (!isMoblie) {
$("#x-iframe").on("load",function() {
$(this).contents().find(".content").css('right', '228px');
});
}
$(function () {
// $(window).resize(function() {
// window.location.reload()
// });
//首次进来
if (isMoblie) {
$('.main-left').css('display', 'none');
$('.navbar-custom-menu').css('display', 'none');
$('.x-iframe').css('left', '0px');
$('#navMenu').css('display', 'block');
$("#x-iframe").on("load",function() {
$(this).contents().find(".content").css('right', '0px');
});
}
$("#navList").on('click', function () {
console.log(document.getElementById('main-left').style.display);
var listStyle = document.getElementById('main-left').style.display;
if (isMoblie) {
if (listStyle == 'none') {
openList = false;
}
if (!openList) {
$('.main-left').css('display', 'block');
$('.x-iframe').css('left', '228px');
$('#x-iframe').contents().find(".content").css('right', '228px');
openList = true;
return;
}
$('.main-left').css('display', 'none');
$('.x-iframe').css('left', '0px');
$('#x-iframe').contents().find(".content").css('right', '0px');
openList = false;
return;
}
})
$('#navMenu').on('click', function () {
if (isMoblie) {
if (!navMenu) {
var css = {
'background-color': '#00a0e9',
'margin-top': '35px',
}
$('.navbar-custom-menu').css('display', 'block');
$('.navbar-nav').css(css);
navMenu = true;
return;
}
$('.navbar-custom-menu').css('display', 'none');
navMenu = false;
return;
}
})
$('#main-right').on('click', function () {
})
})
</script>
</html>
<?php $this->endPage() ?>