123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- var postUrl = "doctor/sign/sign_info";
- var docType;
- var curType;
- var pageTotal = 999999999999; //分页最大次数
- var pageSize = 15; //一次加载几条数据
- var date = new Date(),
- dateStr = date.format("yyyy-MM-dd");
- mui.plusReady(function() {
- var self = plus.webview.currentWebview();
-
- // 初始化关注数,总关注数
- getSignCount(handleSucc99);
-
- //初始化续签管理页面的iscroll
- mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {
- style:'circle',
- callback: pulldownRefresh
- },
- up: {
- auto:true,
- contentrefresh: '正在加载...',
- callback: pullupRefresh
- }
- }
- });
-
- var count = 0;
- function pullupRefresh() {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > pageTotal)); //参数为true代表没有更多数据了。
- var table = document.body.querySelector('.mui-table-view');
- var cells = document.body.querySelectorAll('.mui-table-view-cell');
- var newCount = $(".mui-table-view").children()&&$(".mui-table-view").children().length;
- var page=newCount/pageSize | 0;
- loadMore(".mui-table-view", 99, page);
- }
- /**
- * 下拉刷新具体业务实现
- */
- function pulldownRefresh() {
- var table = document.body.querySelector('.mui-table-view');
- var cells = document.body.querySelectorAll('.mui-table-view-cell');
- loadMore(".mui-table-view", 99, 0);
- mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
- mui.toast("刷新成功");
- }
- mui('.gzgl-list').on('tap','.c-gzgl-action',function(){
- var concernCode = $(this).parent().attr("data-concernCode");
- var code = $(this).parent().attr("data-code");
- mui.openWindow('../html/guanzhuxinxi.html', {
- extras: {
- concernCode:concernCode,
- code:code,
- }
- })
- })
- });
- function getXqDataNew(handelSucc, page) {
- var url = "/doctor/concern/getConcernPatients";
- sendGet(url, {
- page: page || 0,
- pageSize: 15
- }, null, handelSucc);
- };
- //签约管理增加签约统计功能,分别统计待审核、待缴费、已签约数量。在三个页切按钮下方增加统计数字
- function getSignCount(handelSucc) {
- var url = "/doctor/concern/getConcernCounts";
- sendGet(url, {}, null, handelSucc);
- };
- //签约管理增加签约统计功能,分别统计待审核、待缴费、已签约数量。在三个页切按钮下方增加统计数字 (处理函数))
- function handleSucc99(res){
- plus.nativeUI.closeWaiting();
- $('#already_paid').html(res.data&&res.data.countPatientStatus1||0);
- $('#general_concern').html(res.data&&res.data.countPatientAll||0);
- $('.qy-barner').removeClass('c-hide');
- }
- //判断要不要显示加载更多
- function isShowMore(res,page){//res 数据moreObj 要显示或隐藏的加载更多按钮
- // var pageNow=res.data.page;//当前第几页
- // var pageAll=res.data.totalPage; //总共几页
- if(res&&res.data.length<pageSize)pageTotal=page
- }
- /*
- * 拼接模板数据
- */
- function dealTmpl(res, tmplId, ulId) {
- document.getElementById(ulId).innerHTML = template(tmplId, res);
- }
- /*
- * 加载更多
- */
- function loadMore(ulId, type, page) {
-
- plus.nativeUI.showWaiting("加载中,请稍候...");
- var id = $(ulId).children().last().attr("data-id");
- getXqDataNew(function(res){
- // var list = _.map(res.data, function(o){
- // o.jsonStr = JSON.stringify(o);
- // return o;
- // })
- var tmplId = "gzgl_tmpl";
- var obj = {list:res.data};
- if(!obj.list.length) $(".no_result_wrap").removeClass('c-hide');
- domUl = $("#dqy_list");
- if(page===0)$(".gzgl-list").empty();
- $(".gzgl-list").append(template(tmplId, obj));
- isShowMore(res,page);
- plus.nativeUI.closeWaiting();
- }, page);
- }
- window.addEventListener("updata", function() {
- plus.webview.currentWebview().reload(false);
- });
- window.addEventListener('reloadTab', function(e){
- var index = e.detail.tab;
- if(index > 2){
- curTypeGroup2 = index;
- xq_dclObj = null;
- xq_djfObj = null;
- }else{
- curType = index;
- }
- if(curType == 0 && dqyObj) {
- //需要重新刷新页面
- dqyObj = "";
- }else if(curType == 1 && djfObj){
- djfObj = "";
- }else if(curType == 2 && yqyObj){
- yqyObj = "";
- }
-
- $(".sign-comonhd").find(".sanp-flex:eq("+index+")").trigger("click")
- });
- template.helper("formatShowTime",function(str){
- if(str){
- return str.substr(0,16);
- }else{
- return "";
- }
- });
- template.helper("setPhoto", function(p) {
- return getImgUrl(p);
- });
|