123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832 |
- var postUrl = "doctor/sign/sign_info";
- var docType;
- var curType;
- var curTypeGroup2 = 3; //记录当前续签管理下选中的tab值
- var yqy_iscroll, dqy_iscroll, djf_iscroll;
- var xq_dcl_iscroll, xq_djf_iscroll, xq_yxq_iscroll; //续签相关tab页面的iscroll
- var date = new Date(),
- dateStr = date.format("yyyy-MM-dd");
- mui.plusReady(function() {
- docType = plus.storage.getItem("docType");
- $('.qy-barner').removeClass('c-hide');
-
- var self = plus.webview.currentWebview();
- var type = curType || self.type || 0;
- $(".sign-comonhd").find(".sanp-flex").eq(self.type).click();
-
- // 初始化签约管理增加签约统计功能,分别统计待审核、待缴费、已签约数量。在三个页切按钮下方增加统计数字
- getSignCount(handleSucc9);
-
- yqy_iscroll = $('#yqy_list').lscroll({id: "yqy_iscroll", top: 67, pullUpAction: function(g){
- loadMore("#yqy_list", 3, g.options.page);
- }, pullDownAction: function(g){
- g.options.page = 1;
- getData(3, 0, handleSucc3);
- }});
-
- djf_iscroll = $('#djf_list').lscroll({id: "djf_iscroll", top: 67, pullUpAction: function(g){
- loadMore("#djf_list", 5, g.options.page);
- }, pullDownAction: function(g){
- g.options.page = 1;
- getData(5, 0, handleSucc5);
- }});
-
- dqy_iscroll = $('#dqy_list').lscroll({id: "dqy_iscroll", top: 67, pullUpAction: function(g){
- loadMore("#dqy_list", 1, g.options.page);
- }, pullDownAction: function(g){
- g.options.page = 1;
- getData(1, 0, handleSucc1);
- }});
-
- //初始化续签管理页面的iscroll
- xq_dcl_iscroll = $("#xq_dcl_list").lscroll({
- id: "xq_dcl_iscroll",
- top: 67,
- pullUpAction: function(g){
- loadMore("#xq_dcl_list", 6, g.options.page);
- },
- pullDownAction: function(g){
- g.options.page = 1;
- getXqData(1, handleSucc6);
- }
- });
- xq_djf_iscroll = $("#xq_djf_list").lscroll({
- id: "xq_djf_iscroll",
- top: 67,
- pullUpAction: function(g){
- loadMore("#xq_djf_list", 7, g.options.page);
- },
- pullDownAction: function(g){
- g.options.page = 1;
- getXqData(2, handleSucc7);
- }
- });
- xq_yxq_iscroll = $("#xq_yxq_list").lscroll({
- id: "xq_yxq_iscroll",
- top: 67,
- pullUpAction: function(g){
- loadMore("#xq_yxq_list", 8, g.options.page);
- },
- pullDownAction: function(g){
- g.options.page = 1;
- getXqData(3, handleSucc8);
- }
- });
-
- //添加初始化续签中待处理的数据,有数据时,续签管理添加小红点
- // getXqData(1, handleSucc6);
-
- back2home();
- });
- function getData(type, id, handelSucc, page) {
- sendPost(postUrl, {
- doctorType: docType,
- status: type,
- page: page || 1,
- pageSize: 10
- }, null, handelSucc);
- };
- function getXqData(status, handelSucc, page) {
- //status 1-待签约, 2-代缴费, 3-已签约
- var url = "/doctor/sign/sign_info_renew";
- sendPost(url, {
- status: status,
- page: page || 1,
- pageSize: 10
- }, null, handelSucc);
- };
- //签约管理增加签约统计功能,分别统计待审核、待缴费、已签约数量。在三个页切按钮下方增加统计数字
- function getSignCount(handelSucc) {
- var url = "/doctor/sign/sign_info_count";
- sendPost(url, {}, null, handelSucc);
- };
- /*
- * 待签约
- */
- var dqyObj;
- function handleSucc1(res) {
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data.list.length == 0) {
- $('#dqy_iscroll').hide().prev().show();
- return;
- }
- $('#dqy_iscroll').prev().hide();
- dqyObjList = _.map(res.data.list, function(o){
- o.jsonStr = JSON.stringify(o);
- return o;
- });
- dqyObj = {list: dqyObjList} ;
- dealTmpl(dqyObj, "dqy_tmpl", "dqy_list");
- $('#dqy_iscroll').show();
- isShowMore(res, dqy_iscroll);
- } else {
- mui.toast(res.msg);
- }
- }
- /*
- * 已签约
- */
- var yqyObj;
- function handleSucc3(res) {
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data.list.length == 0) {
- $('#yqy_iscroll').hide().prev().show();
- return;
- }
- $('#yqy_iscroll').prev().hide();
- res.docType = docType;
- yqyObj = res.data;
- dealTmpl(yqyObj, "yqy_tmpl", "yqy_list");
- $('#yqy_iscroll').show();
- isShowMore(res, yqy_iscroll);
- } else {
- mui.toast(res.msg);
- }
- }
- /*
- * 待缴费
- */
- var djfObj;
- function handleSucc5(res) {
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data.list.length == 0) {
- $('#djf_iscroll').hide().prev().show();
- return;
- }
- $('#djf_iscroll').prev().hide();
- res.docType = docType;
- djfObj = res.data;
- dealTmpl(djfObj, "djf_tmpl", "djf_list");
- $('#djf_iscroll').show();
- isShowMore(res, djf_iscroll);
- hasDtx();
- } else {
- mui.toast(res.msg);
- }
- }
- /*
- * 续签管理 - 待处理
- */
- var xq_dclObj;
- function handleSucc6(res){
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data.list.length == 0) {
- $('#xq_dcl_iscroll').hide().prev().show();
- return;
- }
- //给“续签管理”添加小红点
- $("#sign2").next().addClass("red-dot");
-
- $('#xq_dcl_iscroll').prev().hide();
- res.docType = docType;
- var xq_dclObjList = _.map(res.data.list,function(o){
- o.jsonStr = JSON.stringify(o);
- return o;
- });
- xq_dclObj = {list: xq_dclObjList};
- dealTmpl(xq_dclObj, "dqy_tmpl", "xq_dcl_list");
- $('#xq_dcl_iscroll').show();
- isShowMore(res, xq_dcl_iscroll);
- } else {
- mui.toast(res.msg);
- }
- }
- /*
- * 续签管理 - 待缴费
- */
- var xq_djfObj;
- function handleSucc7(res){
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data.list.length == 0) {
- $('#xq_djf_iscroll').hide().prev().show();
- return;
- }
- $('#xq_djf_iscroll').prev().hide();
- res.docType = docType;
- xq_djfObj = res.data;
- dealTmpl(xq_djfObj, "xq_yxq_tmpl", "xq_djf_list");
- $('#xq_djf_iscroll').show();
- isShowMore(res, xq_djf_iscroll);
- } else {
- mui.toast(res.msg);
- }
- }
- /*
- * 续签管理 - 待处理
- */
- var xq_yxqObj;
- function handleSucc8(res){
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data.list.length == 0) {
- $('#xq_yxq_iscroll').hide().prev().show();
- return;
- }
- $('#xq_yxq_iscroll').prev().hide();
- res.docType = docType;
- xq_yxqObj = res.data;
- dealTmpl(xq_yxqObj, "xq_yxq_tmpl", "xq_yxq_list");
- $('#xq_yxq_iscroll').show();
- isShowMore(res, xq_yxq_iscroll);
- } else {
- mui.toast(res.msg);
- }
- }
- //签约管理增加签约统计功能,分别统计待审核、待缴费、已签约数量。在三个页切按钮下方增加统计数字 (处理函数))
- function handleSucc9(res){
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- var _signdata = res.data;
- $('#Pending_contract').html(_signdata.waitSignCount);
- $('#Pending_payment').html(_signdata.waitPayCount);
- $('#Signed').html(_signdata.signCount);
- }
- }
- function hasDtx(){
- sendPost("doctor/sign/is_remind_expenses_all", { }, null,
- function(res) {
- var $jfRemindAllBtn = $('#jf_all_tx');
- if (res.status == 200) {
- if(res.data == "1") { // 已经全部提醒缴费
- $jfRemindAllBtn.hide();
- } else {
- $jfRemindAllBtn.show();
- }
- } else {
- mui.toast(res.msg);
- }
- })
- }
- //判断要不要显示加载更多
- function isShowMore(res, curScroll){//res 数据moreObj 要显示或隐藏的加载更多按钮
- // var pageNow=res.data.page;//当前第几页
- // var pageAll=res.data.totalPage; //总共几页
- curScroll.refresh(res.data.list.length < 10);
- }
- /*
- * 拼接模板数据
- */
- function dealTmpl(res, tmplId, ulId) {
- document.getElementById(ulId).innerHTML = template(tmplId, res);
- }
- function isShowRemindAllBtn() {
- sendPost("doctor/sign/is_remind_focus_all", { }, null,
- function(res) {
- var $remindAllBtn = $('#weixin_all_tx');
- if (res.status == 200) {
- if(res.data == "1") { // 已经全部提醒关注
- $remindAllBtn.hide();
- } else {
- $remindAllBtn.show();
- }
- } else {
- mui.toast(res.msg);
- }
- })
- }
- $(function() {
- $(".sign-comonhd").find(".sanp-flex").click(function() {
- $(".sign-comonhd").find(".sanp-flex").removeClass("curr");
- $(this).addClass("curr");
- var type = $(this).index();
- if(type < 3){
- curType = type;
- }else{
- curTypeGroup2 = type;
- }
-
- plus.nativeUI.showWaiting("加载中,请稍候...");
- $(".posater-oper").hide().eq(type).show();
-
- switch (type) {
- case 0:
- if (dqyObj) {
- plus.nativeUI.closeWaiting();
- } else {
- getData(1, 0, handleSucc1);
- }
- break;
- case 1:
- if (djfObj) {
- plus.nativeUI.closeWaiting();
- } else {
- getData(5, 0, handleSucc5);
- }
- break;
- case 2:
- if (yqyObj) {
- plus.nativeUI.closeWaiting();
- } else {
- getData(3, 0, handleSucc3);
- isShowRemindAllBtn();
- }
- break;
- case 3:
- if (xq_dclObj){
- plus.nativeUI.closeWaiting();
- } else {
- getXqData(1, handleSucc6);
- }
- break;
- case 4:
- if (xq_djfObj){
- plus.nativeUI.closeWaiting();
- } else {
- getXqData(2, handleSucc7);
- }
- break;
- case 5:
- if (xq_yxqObj){
- plus.nativeUI.closeWaiting();
- }else{
- getXqData(3, handleSucc8);
- }
- break;
- }
- });
- });
- function toXiaoxiChuli(signStatus, jsonData){
- plus.nativeUI.showWaiting();
- var signStatus2 = 1;
- if(jsonData.renewFlag == "2"){
- signStatus2 = "9";
- }else if(jsonData.renewFlag == "1"){
- signStatus2 = "8";
- }
- sendPost("doctor/message/find", { sender: jsonData.patientCode, signStatus: signStatus2 }, null,
- function(res) {
- plus.nativeUI.closeWaiting();
- if (res.status == 200) {
- if (res.data) {
- if(jsonData.renewFlag){
- openWebview("xuqian_management.html", {
- patient: jsonData.patientCode,
- signCode: jsonData.code,
- renewFlag: jsonData.renewFlag,
- msgId: res.data.id,
- applyDate: jsonData.applyDate
- });
- return ;
- }
- if(docType==3){
- openWebviewExtras("xiaoxichuli_jg.html",
- { type: res.data.type,
- msgId: res.data.id,
- patiCode: res.data.sender,
- status: res.data.status,
- reason: res.data.reason,
- signStatus: res.data.signStatus,
- renewFlag: jsonData.renewFlag
- })
- }else{
- mui.openWindow('../html/xiaoxichuli.html', 'xiaoxichuli', {
- extras: {
- type: res.data.type,
- msgId: res.data.id,
- patiCode: res.data.sender,
- status: res.data.status,
- reason: res.data.reason,
- signStatus: res.data.signStatus,
- renewFlag: jsonData.renewFlag
- }
- });
- }
-
- } else {
- // mui.toast("未找到相关申请信息!");
- //屏蔽线上出现的消息已读的bug 17年6月和7月均出现过一次
- console.log("未找到相关的申请信息!");
- if(jsonData.renewFlag){
- openWebview("xuqian_management.html", {
- patient: jsonData.patientCode,
- signCode: jsonData.code,
- renewFlag: jsonData.renewFlag,
- msgId: '',
- applyDate: jsonData.applyDate
- });
- return ;
- }
- if(docType==3){
- openWebviewExtras("xiaoxichuli_jg.html",
- { type: '',
- msgId: '',
- patiCode: jsonData.patientCode,
- reason: '',
- signStatus: jsonData.status,
- renewFlag: jsonData.renewFlag
- })
- }else{
- mui.openWindow('../html/xiaoxichuli.html', 'xiaoxichuli', {
- extras: {
- type: '',
- msgId: '',
- patiCode: jsonData.patientCode,
- reason: '',
- signStatus: jsonData.status,
- renewFlag: jsonData.renewFlag
- }
- });
- }
- }
- } else {
- mui.toast(res.msg);
- }
- })
- }
- /*
- * 待缴费查看基本信息
- */
- mui("#djf_list").on("tap", ".c-list-info", function() {
- var patient = $(this).parent().attr("data-patient");
- plus.nativeUI.showWaiting();
- sendPost("/doctor/patient_label_info/patient", {patient: patient}, null, function(res){
- if(res.status==200){
- sendGet("/doctor/admin-teams/team/members/"+ patient, {}, null, function(res1){
- plus.nativeUI.closeWaiting();
- if(res1.status==200){
- openWebview("../../huanzhe/html/huanzhexinxi.html",{teamCode: res1.data.teamId, patiInfo: JSON.stringify(res.data), patiCode: res.data.code});
- } else
- mui.toast(res1.msg)
- })
- } else {
- plus.nativeUI.closeWaiting();
- mui.toast(res.msg);
- }
- })
- return false;
- });
- /*
- * 提醒
- */
- mui("#djf_list").on("tap", ".c-dtx-action", function() {
- var $li = $(this).parent();
- txjf($li.attr("data-patient"), $li.attr("data-name"), $(this));
- return false;
- });
- mui('#yqy_list').on("tap", ".c-to-remind-action", function() {
- var $li = $(this).parent();
- txWeixin($li.attr("data-patient"), $li.attr("data-name"), $(this));
- return false;
- });
- mui("#djf_list").on("tap", ".c-ytx-action", function() {
-
- return false;
- });
- /**
- * 全部提醒(缴费)
- */
- $('#jf_all_tx').on("tap", function(){
- mui.confirm("是否向所有未提醒过的未缴费居民发出缴费提醒?(如绑定手机号则短信提醒,如绑定微信则微信提醒)", "提示", ["立即提醒", "不了,谢谢"], function(e){
- if(e.index == 0){
- txjf("", "", "", 1);
- }
- })
- })
- $('#weixin_all_tx').on('tap',function() {
- mui.confirm("是否提醒所有未关注公众号的居民关注公众号?(居民如未绑定手机则无法提醒)", "提示", ["立即提醒", "不了,谢谢"], function(e){
- if(e.index == 0){
- txWeixin("", "", "", 1);
- }
- })
- })
- function txjf(patient, patientName, $dom, isAll){
- plus.nativeUI.showWaiting();
- sendPost("/doctor/family_contract/expenses_remind", {patient: patient || "", isAll: isAll || 0}, null, function(res){
- plus.nativeUI.closeWaiting();
- var $jfAllBtn = $('#jf_all_tx');
- if(res.status == 200){
- if(isAll==1){
- mui.toast("已向所有未缴费居民发出缴费提醒");
- $('.c-dtx-action').addClass("c-ytx-action").html("已提醒").removeClass("c-dtx-action");
- $jfAllBtn.hide();
- } else {
- $dom.removeClass("c-dtx-action").addClass("c-ytx-action");
- mui.toast(res.msg);
- }
- } else {
- mui.toast(res.msg);
- }
- })
- }
- function txWeixin(patient, patientName, $dom, isAll){
- plus.nativeUI.showWaiting();
- sendPost("doctor/family_contract/wechat_focus_remind", {patient: patient || "", isAll: isAll || 0}, null, function(res){
- plus.nativeUI.closeWaiting();
- var $wxAllBtn = $('#weixin_all_tx');
- if(res.status == 200){
- if(isAll==1){
- mui.toast("已向所有未关注公众号居民发出关注提醒");
- $('.c-to-remind-action').addClass("c-reminded-action").html("已提醒").removeClass("c-to-remind-action");
- $wxAllBtn.hide();
- } else {
- $dom.removeClass("c-to-remind-action").addClass("c-reminded-action");
- mui.toast(res.msg);
- isShowRemindAllBtn();
- }
- } else {
- $dom.removeClass("c-to-remind-action").addClass("c-reminded-action");
- mui.toast(res.msg);
- }
- })
- }
- ///doctor/family_contract/expenses_remind
- /*
- * 查看签约状态
- */
- mui("#yqy_list").on("tap", "li", function() {
- var patient = $(this).attr("data-patient");
-
- mui.openWindow({
- url: "patient-manage.html",
- id: "patient-manage.html",
- extras: {
- patientCode: patient,
- signStatus: "yqy"
- }
- })
- return false;
- });
- /*
- * 修改签约状态
- */
- mui("#dqy_list").on("tap", ".c-dqy-action", function() {
- var jsonStr = $(this).parent().attr("data-json");
- jsonStr = jsonStr && JSON.parse(jsonStr);
-
- toXiaoxiChuli(1, jsonStr);
- return false;
- });
- /*续签-待处理*/
- mui("#xq_dcl_list").on("tap", ".c-dqy-action", function(){
- var jsonStr = $(this).parent().attr("data-json");
- jsonStr = jsonStr && JSON.parse(jsonStr);
-
- var signStatus = (jsonStr.renewFlag == 1)?8:9;
- plus.nativeUI.showWaiting();
- sendPost("doctor/message/find", { sender: jsonStr.patientCode, signStatus: signStatus }, null,
- function(res){
- if(res.status == 200){
- if(res.data){
- openWebview("xuqian_management.html", {
- patient: jsonStr.patientCode,
- signCode: jsonStr.code,
- renewFlag: jsonStr.renewFlag,
- msgId: res.data.id,
- applyDate: jsonStr.applyDate
- });
- }else{
- mui.toast("未找到相关消息");
- }
- }else{
- mui.toast(res.msg);
- }
- plus.nativeUI.closeWaiting();
- });
- return false;
- });
- /*续签-待缴费*/
- mui("#xq_djf_list").on("tap", ".c-dqy-action", function(){
- var patient = $(this).parent().attr("data-patient");
- openWebview("../../huanzhe/html/huanzhexinxi.html", {patiCode: patient});
- return false;
- });
- /*续签-已续签*/
- mui("#xq_yxq_list").on("tap", ".c-dqy-action", function(){
- var patient = $(this).parent().attr("data-patient");
- openWebview("../../huanzhe/html/huanzhexinxi.html", {patiCode: patient});
- return false;
- });
- /*
- * 切换头部管理类型
- */
- /*关闭续签管理入口
- $(".header-select").on("tap", function(){
- $(".lin-mask").show();
- $(".lin-sel-group").show();
- });
- $(".lin-mask").on("click",function(){
- $(".lin-mask").hide();
- $(".lin-sel-group").hide();
- });
- */
- $(".icon-checkbox").on("change",function(e){
- e.preventDefault();
- var value = this.value;
- console.log(value);
- if(value == "2"){
- if(date.getFullYear() != 2017){
- $(".header-link").hide(); //2017年度后的提醒续签的按钮不显示
- }else{
- $(".header-link").show();
- }
-
- //添加小红点
- if($(this).next().hasClass("red-dot")){
- $(".header-select").find("span:eq(0)").addClass("red-dot");
- }
-
- $(".tab-group1").hide();
- $(".tab-group2").show();
- $(".sign-comonhd").find(".sanp-flex").eq(curTypeGroup2).click();
- }else{
- $(".header-link").hide();
- $(".tab-group2").hide();
- $(".tab-group1").show();
- $(".sign-comonhd").find(".sanp-flex").eq(curType).click();
- }
- $(".lin-mask").trigger("click");
- $("#Dtitle").html($(this).parent().find("label").html());
- //重新加载数据
- });
- /*提醒续签*/
- $(".header-link").on("tap", function(){
- var remindInfo = window.localStorage.getItem("remindXQ");
- //remindInfo = {date: '2017-05-07', remind: 1}
- var info = remindInfo && JSON.parse(remindInfo);
- if(remindInfo && (info.date == dateStr) && (info.remind == 1)){
- mui.toast("对不起,您今天已经全部提醒过,无法再次全部提醒");
- return;
- }
- var url = "/doctor/sign/sendRenewToPatients";
- dialog({
- content: "是否向所有未提醒过的待续签居民发出续签提醒?(如绑定手机号则短信提醒,如绑定微信则微信提醒)",
- okValue: "立即提醒",
- ok: function(){
- plus.nativeUI.showWaiting();
- sendPost(url, {}, null, function(res){
- if(res.status == 200){
- if(res.data == 0){
- mui.toast(res.msg);
- }else{
- mui.toast("已向所有待续签居民发出续签提醒");
- }
- var obj = {date: dateStr, remind: 1};
- localStorage.setItem("remindXQ", JSON.stringify(obj));
- // $(".header-link").hide();
- }else{
- mui.toast(res.msg);
- }
- plus.nativeUI.closeWaiting();
- }, "post", "", true);
- },
- cancelValue: "不了,谢谢",
- cancel: function(){}
- }).showModal();
-
- });
- /*
- * 加载更多
- */
- function loadMore(ulId, type, page) {
-
- plus.nativeUI.showWaiting("加载中,请稍候...");
- var id = $(ulId).children().last().attr("data-id");
-
- if(type == 1 || type == 3 || type == 5){
-
- getData(type, id, function(res) {
- if (res.status == 200) {
-
- var tmplId, domUl, curScroll;
- switch (type) {
- case 1:
- tmplId = "dqy_tmpl";
- domUl = $("#dqy_list");
- curScroll = dqy_iscroll;
- break;
-
- case 3:
- tmplId = "yqy_tmpl";
- domUl = $("#yqy_list");
- curScroll = yqy_iscroll;
- isShowRemindAllBtn();
- break;
-
- case 5:
- tmplId = "djf_tmpl";
- domUl = $("#djf_list");
- curScroll = djf_iscroll;
- break;
- }
- if (res.data.list.length == 0) {
- curScroll.refresh(true);
- plus.nativeUI.closeWaiting();
- return
- }
-
- if(type == 5){
- hasDtx();
- }
- var list = _.map(res.data.list, function(o){
- o.jsonStr = JSON.stringify(o);
- return o;
- })
- var obj = {list: list};
- domUl.append(template(tmplId, obj));
- isShowMore(res, curScroll);
- plus.nativeUI.closeWaiting();
- }
- }, page);
- }else{
- //续签的流程
- var tmplId, domUl, curScroll, status;
- switch (type) {
- case 6:
- tmplId = "dqy_tmpl";
- domUl = $("#xq_dcl_list");
- curScroll = xq_dcl_iscroll;
- status = 1;
- break;
-
- case 7:
- tmplId = "xq_yxq_tmpl";
- domUl = $("#xq_djf_list");
- curScroll = xq_djf_iscroll;
- isShowRemindAllBtn();
- status = 2;
- break;
-
- case 8:
- tmplId = "xq_yxq_tmpl";
- domUl = $("#xq_yxq_list");
- curScroll = xq_yxq_iscroll;
- status = 3;
- break;
- }
- getXqData(status, function(res){
- var list = _.map(res.data.list, function(o){
- o.jsonStr = JSON.stringify(o);
- return o;
- })
- var obj = {list: list};
- domUl.append(template(tmplId, obj));
- isShowMore(res, curScroll);
- 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);
- });
|