| 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">
- <!--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-weight: 500;
- font-size: 20px;
- }
-
- .mui-table .oa-icon {
- position: absolute;
- right: 0;
- bottom: 0;
- }
-
- .mui-table .oa-icon-star-filled {
- color: #f14e41;
- }
-
- .mui-bar-nav {
- background-color: #00a1cb;
- }
- #title{
- color: #fff;
- }
- .mui-table-view-cell{
- padding: 5px 15px;
- }
- h4{
- color: inherit;
- font-weight: 500;
- }
- </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: #fff;"></a>
- <h1 id="title" class="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">
-
- </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"); //获取本地存储
- 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 + 'FAQ/GetAllList', {
- 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) {
- total = data.total;
- console.log(total);
- var a = "";
- console.log(data.rows.length)
- for(var i=0;i<data.rows.length;i++){
- console.log(data.rows[0].F_Id);
- a = '<li class="mui-table-view-cell" index-i="'+data.rows[i].F_Id+'">'+
-
- '<h4 class="mui-navigate-right">'+data.rows[i].F_QuestionTitle+' <i class="mui-pull-right "></i></h4>'+
- '<h5 class="mui-ellipsis">' + data.rows[i].F_QuestionContent + '</h5>' +
- '</li>'
- $(a).appendTo($("#order_list"));
- }
-
- De();
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }, 1000);
- }
- //初次加载
- function Ajax() {
- mui.ajax(huayi.config.callcenter_url + 'FAQ/GetAllList', {
- 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 = "";
- console.log(data.rows.length)
- for(var i=0;i<data.rows.length;i++){
- console.log(data.rows[0].F_Id);
- a = '<li class="mui-table-view-cell" index-i="'+data.rows[i].F_Id+'">'+
-
- '<h4 class="mui-navigate-right" style="font-size:16px;">'+data.rows[i].F_QuestionTitle+' <i class="mui-pull-right "></i></h4>'+
- '<h5 class="mui-ellipsis"style="font-size:14px;">' + data.rows[i].F_QuestionContent + '</h5>' +
- '</li>'
- $(a).appendTo($("#order_list"));
- }
-
- De();
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
- ////详情
- function De(){
- $(".mui-table-view-cell").on("tap",function(){
- var index=$(this).attr("index-i");
- mui.openWindow({
- id: 'WTlist',
- url: 'WTlist.html',
- show: {
- aniShow: 'pop-in'
- },
- styles: {
- popGesture: 'hide'
- },
- waiting: {
- autoShow: false
- },extras: {
- name: index,
- token: token
- }
- });
- })
- }
-
- });
- </script>
- </html>
|