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
<!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">
        <!--App自定义的css-->
        <link rel="stylesheet" type="text/css" href="css/app.css" />
        <style>
            .mui-card .mui-control-content {
                padding: 10px;
            }
            
            .mui-control-content {
                height: 800px;
            }
            .mui-bar{
                background-color:#1A1A1A;
            }
            .mui-title{
                color:#ffffff;
            }
        </style>
    </head>
 
    <body>
            <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#FFFFFF"></a>
            <h1 class="mui-title">消息通知</h1>
        </header>
        <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
        <script src="js/common.js" ></script>
        <script src="js/mui.min.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?reuri=notice&co="+ new Date().getTime() ;/*tpa=http://www.wolishi.com/safety/login.html*/
                        }
                    }
                });
 
        }
            mui.init({
                subpages:[{
                  url:'noticeList.html'/*tpa=http://www.wolishi.com/safety/noticeList.html*/,//子页面HTML地址,支持本地地址和网络地址
                  id:'noticeList',//子页面标志
                  styles:{
                    top:'45px',//子页面顶部位置
                    bottom:'0'//子页面底部位置
                  },
                  extras:{}//额外扩展参数
                }]
            });
    
        </script>
 
    </body>
 
</html>