<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<title>新闻首页</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<!--标准mui.css-->
|
<link rel="stylesheet" href="css/mui.min.css">
|
<link rel="stylesheet" href="css/common.css" />
|
<link rel="stylesheet" href="css/swipe-menu.css" />
|
<link rel="stylesheet" href="css/swiper-3.3.1.min.css">
|
<link rel="stylesheet" type="text/css" href="css/custom.css"/>
|
<!--App自定义的css-->
|
<style>
|
.mui-card .mui-control-content {
|
padding: 10px;
|
}
|
|
body{
|
width:100%;
|
height:100%;
|
background-image: url("images/news/bg.png");
|
|
}
|
.mui-content{
|
width:100%;
|
padding:0 0;
|
background-color:#277DDB;
|
filter: Alpha(Opacity=50) /* for IE */
|
background-color: rgba(0, 0, 0, 0.5); /*for FF*/
|
}
|
|
.mui-segmented-control{
|
border:none;
|
}
|
.custom-mui-control-item{
|
height:45px;
|
border-left:none;
|
color:#fff;
|
|
}
|
|
|
|
</style>
|
</head>
|
|
<body >
|
|
|
|
<div class="mui-content">
|
|
<div id="segmentedControl" class="mui-segmented-control">
|
<a class="custom-mui-control-item mui-active" href="#item1" data-url="news.html">
|
全部
|
</a>
|
<a class="custom-mui-control-item" href="#item2" data-url="news_school.html">
|
校园新闻
|
</a>
|
<a class="custom-mui-control-item" href="#item3" data-url="news_jw.html">
|
教委动态
|
</a>
|
<a class="custom-mui-control-item" href="#item4" data-url="news_dynamic.html">
|
动态公告
|
</a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
</body>
|
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
|
<script src="js/mui.min.js"></script>
|
<script src="js/update.js" charset="utf-8"></script>
|
<script src="js/common.js"></script>
|
<script src="js/swiper-3.3.1.min.js"></script>
|
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"> </script>
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"> </script>
|
<script>
|
if(sessionCache.getSessionCashe("userToken")== null){
|
var code = getUrlParam("code");
|
mui.ajax({
|
type: "get",
|
url: serverUrl + 'login/getwxuserinfo.json',
|
data: {
|
CODE: code
|
},
|
async: false,
|
success: function(data) {
|
if(data.errcode == undefined) {
|
sessionCache.setSessionCashe("weixin_user", data, sessionCache.json_value);
|
} else {
|
WeixinJSBridge.call('closeWindow');
|
}
|
}
|
});
|
|
var openObj = sessionCache.getSessionCashe("weixin_user", sessionCache.json_value);
|
var openId;
|
if(openObj.UserId != undefined) {
|
openId = openObj.UserId;
|
} else if(openObj.OpenId != undefined) {
|
openId = openObj.OpenId;
|
}
|
mui.ajax({
|
type: "get",
|
url: serverUrl + 'login/loginWithOpenId.json',
|
data: {
|
openId: openId
|
},
|
async: false,
|
success: function(data) {
|
|
if(data.code == 000) {
|
sessionCache.setSessionCashe("userToken", data.data.token);
|
sessionCache.setSessionCashe("tiemTree", data.data.functionItemTree, sessionCache.json_value);
|
sessionCache.setSessionCashe("organizationTree", data.data.organizationTree, sessionCache.json_value);
|
sessionCache.setSessionCashe("userPosts", data.data.posts, sessionCache.json_value);
|
sessionCache.setSessionCashe("userInfo", data.data.sysUser, sessionCache.json_value);
|
} else {
|
location.href = "login.html"/*tpa=http://www.wolishi.com/safety/login.html*/;
|
}
|
}
|
});
|
|
}
|
var swiper = new Swiper('.swiper-container', {
|
pagination: '.swiper-pagination',
|
paginationClickable: '.swiper-pagination',
|
nextButton: '.swiper-button-next',
|
prevButton: '.swiper-button-prev',
|
spaceBetween: 30
|
});
|
mui.init({
|
swipeBack: true, //启用右滑关闭功能
|
subpages: [{
|
url: 'news.html'/*tpa=http://www.wolishi.com/safety/workCalendar.html*/, //子页面HTML地址,支持本地地址和网络地址
|
id: 'item', //子页面标志
|
styles: {
|
top: '45px', //子页面顶部位置
|
bottom: '0' //子页面底部位置
|
},
|
extras: {} //额外扩展参数
|
}]
|
});
|
//首页返回键处理
|
//1、若侧滑菜单显示,则关闭侧滑菜单
|
//2、否则,执行mui框架默认的关闭首页功能
|
var _back = mui.back;
|
mui.back = function() {
|
if(showMenu) {
|
closeMenu();
|
} else {
|
_back();
|
}
|
};
|
mui.ready(function() {
|
$("#segmentedControl a").bind("click", function() {
|
$(this).addClass("mui-active").siblings().removeClass("mui-active");
|
$("#item").attr("src", $(this).attr("data-url"));
|
});
|
});
|
</script>
|
|
</html>
|