liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!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>