| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- var token = localStorage.getItem("token");
- var page = 1; //页数
- var pageSize = 10; //每页显示条目
- var keyw = "";
- var total;
- Ajax();
- $('.go_search').on('input focus', function() {
- keyw = $(this).val();
- page = 1;
- Ajax(keyw);
- });
- mui.init({
- swipeBack: false,
- pullRefresh: {
- container: '#pullrefresh',
- up: {
- contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
- contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
- callback: pullupRefresh
- }
- },
- beforeback: function() {
- var list = plus.webview.currentWebview().opener();
- //refresh是A页面自定义事件
- mui.fire(list, 'refreshPer');
- //返回true,继续页面关闭逻辑
- return true;
- }
- });
- function pullupRefresh() {
- setTimeout(function() {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
- mui.ajax(huayi.config.callcenter_url + '/AddressBook/GetAppModelList', {
- data: {
- token: token,
- keywords: keyw,
- pageindex: 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) {
- if (data.state = "success") {
- var html = "";
- //$(".orderLi").remove();
- //alert(JSON.stringify(data))
- if (data.length > 0) {
- for (var i = 0; i < data.length; i++) {
- html = '<li data-group="' + data[i].code + '" data-value="' + data[i].NameOneCode + '" data-tags="' +
- data[i].NameOneCode +
- '" class="mui-table-view-cell mui-indexed-list-item orderLi">' +
- '<div class="mui-slider-cell">' +
- '<a href="tel:' + data[i].F_Mobile + '">' +
- '<div class="oa-contact-cell mui-table">' +
- '<div class="oa-contact-avatar mui-table-cell">' +
- '<img src="img/2.png"/>' +
- '</div>' +
- '<div class="oa-contact-content mui-table-cell">' +
- '<h4 class="oa-contact-name size-14">' + data[i].F_Name +
- '<span class="oa-contact-position mui-h6">' + data[i].F_Area + "-" + data[i].F_Offce + "-" + data[i].F_Position +
- '</span></h4>' +
- '<h4 class="oa-contact-email mui-h5">' + data[i].F_Mobile + '</h4>' +
- '</div>' +
- '</div>' +
- '</a>' +
- '</div>' +
- '</li>';
- $(html).appendTo($(".tabalList"));
- }
- }
- }
- },
- error: function(xhr, type, errorThrown) {}
- })
- }, 1000);
- }
- function Ajax() {
-
- $(".tabli").remove()
- page = 1;
- pageSize = 10;
- mui.ajax(huayi.config.callcenter_url + '/AddressBook/GetAppModelList', {
- data: {
- token: localStorage.getItem('token'),
- keywords: keyw,
- pageindex: 1,
- pagesize: 10
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- if (data.state = "success") {
- var html = "";
- if (data.length == 0) {
- $(".noWork").show();
- }
- if (data.length > 0) {
- for (var i = 0; i < data.length; i++) {
- html = '<li data-group="' + data[i].code + '" data-value="' + data[i].NameOneCode + '" data-tags="' + data[
- i].NameOneCode +
- '" class="mui-table-view-cell mui-indexed-list-item tabli">' +
- '<div class="mui-slider-cell">' +
- '<a href="tel:' + data[i].F_Mobile + '">' +
- '<div class="oa-contact-cell mui-table">' +
- '<div class="oa-contact-avatar mui-table-cell">' +
- '<img src="img/2.png"/>' +
- '</div>' +
- '<div class="oa-contact-content mui-table-cell">' +
- '<h4 class="oa-contact-name size-14">' + data[i].F_Name +
- '<span class="oa-contact-position mui-h6">' + data[i].F_Area + "-" + data[i].F_Offce + "-" + data[i].F_Position +
- '</span></h4>' +
- '<h4 class="oa-contact-email mui-h5">' + data[i].F_Mobile + '</h4>' +
- '</div>' +
- '</div>' +
- '</a>' +
- '</div>' +
- '</li>';
- $(html).appendTo($(".tabalList"));
- }
- }
- }
- },
- error: function(xhr, type, errorThrown) {}
- });
- }
|