| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Hello MUI</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/iconfont.css" />
- <!--App自定义的css-->
- <!--<link rel="stylesheet" type="text/css" href="css/app.css" />-->
- <style>
- .mui-table h4,
- .mui-table h5,
- .mui-table .mui-h5,
- .mui-table .mui-h6,
- .mui-table p {
- margin-top: 0;
- }
-
- .mui-table h4 {
- line-height: 21px;
- font-size: 16px;
- font-weight: 500;
- }
-
- .mui-table .oa-icon {
- position: absolute;
- right: 0;
- bottom: 0;
- }
-
- .mui-table .oa-icon-star-filled {
- color: #f14e41;
- }
-
- .mui-bar-nav {
- background-color: #00a1cb;
- }
- .mui-action-back {
- color: #fff;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav" style="padding-right: 15px;color: #fff;">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-center mui-title">公告列表</h1>
- </header>
- <div class="mui-content" id="pullrefresh">
- <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed" id="order_list">
- <!--<li class="mui-table-view-cell">
- <div class="mui-input-row mui-search ">
- <input type="search" class="mui-input-clear go_search Width" placeholder="请输入关键字" style="margin-bottom: 0;">
-
- </div>
- </li>-->
- </ul>
- <span></span>
- </div>
- </body>
- <script src="../js/mui.min.js"></script>
- <script src="../js/zepto.js"></script>
- <script src="../js/huayi.config.js"></script>
- <script>
- mui.plusReady(function() {
- var page = 1; //页数
- var pageSize = 10; //每页显示条目
- var total; //数据总条数
- var token =localStorage.getItem("token"); //获取本地存储
- console.log(token);
- Ajax();
- mui.init({
- swipeBack: false,
- pullRefresh: {
- container: '#pullrefresh',
- up: {
- contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
- contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
- callback: pullupRefresh
- }
- }
- });
- //下拉刷新
- function pullupRefresh() {
- setTimeout(function() {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
- mui.ajax(huayi.config.callcenter_url + 'Notice/GetList', {
- data: {
- token: token,
- page: page,
- pagesize: pageSize
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- var a = "";
- $(data.rows).each(function(i, n) {
- var T = n.F_CreateOn.substring(0, n.F_CreateOn.indexOf(' '));
- a = '<li class="mui-table-view-cell" index=' + n.F_NoticeId + '>' +
- '<div class="mui-table">' +
- '<div class="mui-table-cell mui-col-xs-8">' +
-
- '<h4 class="mui-ellipsis">' + n.F_Title + '</h4>' +
- '<h5> 有效日期:'+ n.F_EndDate + '</h5>' +
- '</div>' +
- '</div>' +
- '</li>'
- $(a).appendTo($("#order_list"));
- })
- De();
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }, 1000);
- }
- //初次加载
- function Ajax() {
- mui.ajax(huayi.config.callcenter_url + 'Notice/GetList', {
- data: {
- token: token,
- page: 1,
- pagesize: 10
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- total = data.total;
- console.log(total );
- var a = "";
- $(data.rows).each(function(i, n) {
- var T = n.F_CreateOn.substring(0, n.F_CreateOn.indexOf(' '));
- a = '<li class="mui-table-view-cell" index=' + n.F_NoticeId + '>' +
- '<div class="mui-table">' +
- '<div class="mui-table-cell mui-col-xs-8">' +
-
- '<h4 class="mui-ellipsis">' + n.F_Title + '</h4>' +
- '<h5>有效日期:' + n.F_EndDate + '</h5>' +
- '</div>' +
- '</div>' +
- '</li>'
- $(a).appendTo($("#order_list"));
- })
- De();
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
- ////详情
- function De() {
- $(".mui-table-view-cell").on("tap", function() {
- var a = $(this).attr('index');
- mui.openWindow({
- id: 'Managment',
- url: 'Managment-detail.html',
- show: {
- aniShow: 'pop-in'
- },
- styles: {
- popGesture: 'hide'
- },
- waiting: {
- autoShow: false
- },
- extras: {
- name: a,
- token: token
- }
- });
- })
- }
- });
- </script>
- </html>
|