device-data.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. var self,
  2. initLevel,
  3. type,
  4. level,
  5. area,
  6. title,
  7. startDate = '',
  8. endDate = '',
  9. lowLevel,
  10. lowCode = '',
  11. deviceCode = "", // kong所有设备,1血压计,2血糖仪
  12. dateType = 1, //折线图坐标值1-日,2-周,3-月
  13. areaType; //标记底部区域选中的tab的值, 4 - 各区, 3 - 社区, 2 - 团队
  14. var userRole;
  15. var CITY_CODE = "350200";//默认厦门市
  16. var reqParam = []; //请求参数
  17. var reqList = []; //请求的链接数据,根据这些信息后退的时候使用
  18. //定义年份
  19. var chooseYear;
  20. var now = new Date();
  21. if(now.getMonth() >= 6){
  22. chooseYear = now.getFullYear();
  23. }else{
  24. chooseYear = now.getFullYear() - 1;
  25. }
  26. mui.plusReady(function(){
  27. var self = plus.webview.currentWebview();
  28. userRole = plus!=null ? JSON.parse(plus.storage.getItem("selectedRole")) : {};
  29. initLevel = userRole.code == CITY_CODE ? 4 : userRole.code.length==6 ? 3 : 2;
  30. level = initLevel;
  31. area = userRole.code;
  32. title = userRole.name;
  33. startDate = getStartDate();
  34. endDate = getEndDate();
  35. //初始默认选中的时间和类型
  36. $("#areaTitle").text(title);
  37. //控制底部各区等tab的显示
  38. showTabs();
  39. initReqParams(); //现获得页面请求的接口参数
  40. //记录返回链接信息
  41. reqList.push({
  42. level: level,
  43. lowLevel: lowLevel,
  44. area: area,
  45. title: title,
  46. lowCode: lowCode,
  47. req: reqParam
  48. });
  49. loadData([0,1]); //现获得页面请求的接口参数
  50. initScroller();
  51. shaixuanInit(self);
  52. bindEvents();
  53. });
  54. //获得页面请求的接口参数
  55. function initReqParams(){
  56. var topIndex = {"4": "29", "3": "44", "2": "43"}, //顶部区域对应的level : index
  57. bottomIndex = {"4": "44", "3": "43", "2": "42"}; //与选中的当前底部区域tab的值有关 areaType
  58. if(lowCode && lowCode != "0"){
  59. var topIndex = {"4": "51", "3": "54", "2": "53"}, //顶部区域对应的level : index
  60. bottomIndex = {"4": "54", "3": "53", "2": "52"}; //与选中的当前底部区域tab的值有关 areaType
  61. }
  62. var index = "85,86",
  63. bIndex = bottomIndex[areaType];
  64. reqParam = [{
  65. url: "/statistics/lowlevel_device",
  66. reqType: 'get',
  67. data: {level: level, area: area, sort: 1, deviceType: deviceCode}
  68. },{
  69. url: "/statistics/interval_total",
  70. reqType: 'get',
  71. data: {level: level, area: area, startDate: startDate, endDate: endDate, interval: dateType, index: index, lowCode: deviceCode}
  72. }];
  73. if(lowLevel){
  74. reqParam[0].data.lowLevel = lowLevel;
  75. }
  76. }
  77. /*
  78. * 加载页面数据
  79. * @param loadArr array 记录需要请求的区域0-顶部,1-中间,2-底部
  80. */
  81. function loadData(loadArr){
  82. plus.nativeUI.showWaiting();
  83. getJieZhiTime();
  84. var reqPromise = [];
  85. for(var i=0; i<loadArr.length; i++){
  86. var j = loadArr[i];
  87. reqPromise.push(reqParam[j]);
  88. }
  89. getReqPromises(reqPromise, true).then(function(ress){
  90. var res1, res2;
  91. for(var i=0; i<loadArr.length; i++){
  92. var j = loadArr[i] + 1;
  93. if(j == 1){
  94. res1 = ress[i];
  95. }
  96. if(j == 2){
  97. res2 = ress[i];
  98. }
  99. }
  100. if(res1 && res1.status == 200){
  101. handleTopData(res1.data);
  102. listHandle(res1.data.list)
  103. }
  104. if(res2 && res2.status == 200){
  105. handleSecondPanelData(res2.data);
  106. }
  107. plus.nativeUI.closeWaiting();
  108. });
  109. }
  110. /*
  111. * 加载数据截止时间
  112. */
  113. function getJieZhiTime(){
  114. sendPost("/statistics/time",null,function(res){
  115. },function(res){
  116. if(res.status=="200"){
  117. var date = (res.data && res.data.substring(11,16)) || "";
  118. $(".jiezhi-time").html("("+date+")");
  119. }
  120. });
  121. }
  122. /*
  123. * 圆饼图
  124. */
  125. var roundCharts = echarts.init(document.getElementById('roundChart')),
  126. roundCharts1 = echarts.init(document.getElementById('roundChart1')),
  127. roundCharts2 = echarts.init(document.getElementById('roundChart2')),
  128. roundCharts3 = echarts.init(document.getElementById('roundChart3'));
  129. function handleTopData(res){
  130. $(".device-buy").html(res.totalAll);
  131. $(".device-push").html(res.totalGrant);
  132. $(".device-bind").html(res.totalBinding);
  133. $(".device-use").html(res.totalUse);
  134. $(".device-dif").html(res.totalAnomaly);
  135. $(".device-del").html(res.totalIntervene);
  136. var labelTop = {
  137. normal : {
  138. label : {
  139. show : true,
  140. position : 'center',
  141. formatter : '{b}',
  142. textStyle: {
  143. baseline : 'bottom',
  144. fontSize: "16",
  145. color: "#8f8f94"
  146. }
  147. },
  148. labelLine : {
  149. show : false
  150. }
  151. }
  152. };
  153. var labelFromatter = {
  154. normal : {
  155. label : {
  156. formatter : function (params){
  157. return res.totalGrantRange
  158. },
  159. textStyle: {
  160. baseline : 'top',
  161. fontSize: "18",
  162. color: "#39f"
  163. }
  164. }
  165. },
  166. },
  167. labelFromatter1 = {
  168. normal : {
  169. label : {
  170. formatter : function (params){
  171. return res.totalBindingRange
  172. },
  173. textStyle: {
  174. baseline : 'top',
  175. fontSize: "18",
  176. color: "#39f"
  177. }
  178. }
  179. },
  180. },
  181. labelFromatter2 = {
  182. normal : {
  183. label : {
  184. formatter : function (params){
  185. return res.totalUseRange
  186. },
  187. textStyle: {
  188. baseline : 'top',
  189. fontSize: "24",
  190. color: "#39f"
  191. }
  192. }
  193. },
  194. },
  195. labelFromatter3 = {
  196. normal : {
  197. label : {
  198. formatter : function (params){
  199. return res.totalInterveneRange
  200. },
  201. textStyle: {
  202. baseline : 'top',
  203. fontSize: "24",
  204. color: "#39f"
  205. }
  206. }
  207. },
  208. }
  209. var labelBottom = {
  210. normal : {
  211. color: '#ccc',
  212. label : {
  213. show : true,
  214. position : 'center'
  215. },
  216. labelLine : {
  217. show : false
  218. }
  219. }
  220. };
  221. var radius = [45, 55],
  222. radius2 = [60, 70];
  223. var options = {
  224. legend: {
  225. x : 'center',
  226. y : 'center'
  227. },
  228. series : [
  229. {
  230. type : 'pie',
  231. radius : radius,
  232. x: '0%', // for funnel
  233. itemStyle : labelFromatter,
  234. data : [
  235. {value: res.totalAll - res.totalGrant, itemStyle: labelBottom},
  236. {name:'设备发放率', value: res.totalGrant, itemStyle: labelTop}
  237. ]
  238. }
  239. ],
  240. color: ["#39f", "#ddd"]
  241. },
  242. options1 = {
  243. legend: {
  244. x : 'center',
  245. y : 'center'
  246. },
  247. series : [
  248. {
  249. type : 'pie',
  250. radius : radius,
  251. x: '0%', // for funnel
  252. itemStyle : labelFromatter1,
  253. data : [
  254. {value: res.totalGrant - res.totalBinding, itemStyle: labelBottom},
  255. {name:'设备绑定率', value: res.totalBinding, itemStyle: labelTop}
  256. ]
  257. }
  258. ],
  259. color: ["#39f", "#ddd"]
  260. },
  261. options2 = {
  262. legend: {
  263. x : 'center',
  264. y : 'center'
  265. },
  266. series : [
  267. {
  268. type : 'pie',
  269. radius : radius2,
  270. x: '0%', // for funnel
  271. itemStyle : labelFromatter2,
  272. data : [
  273. {value: res.totalGrant - res.totalUse, itemStyle: labelBottom},
  274. {name:'每周使用率', value: res.totalUse, itemStyle: labelTop}
  275. ]
  276. }
  277. ],
  278. color: ["#39f", "#ddd"]
  279. },
  280. options3 = {
  281. legend: {
  282. x : 'center',
  283. y : 'center'
  284. },
  285. series : [
  286. {
  287. type : 'pie',
  288. radius : radius2,
  289. x: '0%', // for funnel
  290. itemStyle : labelFromatter3,
  291. data : [
  292. {value: res.totalAnomaly - res.totalIntervene, itemStyle: labelBottom},
  293. {name:'体征异常24h\n干预指导率', value: res.totalIntervene, itemStyle: labelTop}
  294. ]
  295. }
  296. ],
  297. color: ["#39f", "#ddd"]
  298. };
  299. roundCharts.setOption(options);
  300. roundCharts1.setOption(options1);
  301. roundCharts2.setOption(options2);
  302. roundCharts3.setOption(options3);
  303. }
  304. /*
  305. * 处理中间折线图数据
  306. */
  307. function handleSecondPanelData(data){
  308. var xData = _.map(data.index_85.data, function(o){
  309. return o.range;
  310. });
  311. var yData = _.map(data.index_85.data, function(o){
  312. return o.amount;
  313. });
  314. var yData2 = _.map(data.index_86.data, function(o){
  315. return o.amount
  316. });
  317. var lastIndex = yData.length % 10;
  318. if(yData.length >10 ){
  319. var dataZoom_end = 100-(9/yData.length)*100;
  320. }else{
  321. var dataZoom_end = 0;
  322. }
  323. //初始给定第一版页面中时间区间
  324. var d1 = xData[yData.length - lastIndex],
  325. d2 = xData[yData.length -1];
  326. if(!d1 || !d2) {
  327. $("#startValue").text("暂无");
  328. // $("#startValue").hide()
  329. $("#endValue").text("暂无");
  330. }else if(dateType == 3){
  331. $("#startValue").text(d1.substr(0,4)+"年"+d1.substr(5,2)+"月");
  332. $("#endValue").text(d2.substr(0,4)+"年"+d2.substr(5,2)+"月");
  333. } else {
  334. $("#startValue").text(d1);
  335. $("#endValue").text(d2);
  336. }
  337. var lineCharts = echarts.init(document.getElementById('lineChart'));
  338. var options = {
  339. tooltip: {
  340. trigger: 'axis'
  341. },
  342. legend: {
  343. top: 'bottom',
  344. data:['设备发放量','设备绑定量']
  345. },
  346. grid: {
  347. left: '10px',
  348. right: '10px',
  349. bottom: '30px',
  350. top: '10px',
  351. containLabel: true
  352. },
  353. xAxis: {
  354. type: 'category',
  355. boundaryGap: false,
  356. data: xData,
  357. axisLabel: {
  358. interval:0,//横轴信息全部显示
  359. formatter: function (value, index) {
  360. if(dateType == 1 || dateType == 2){
  361. if(index == 0){
  362. $("#startValue").text(value ? value : "暂无");
  363. return value.substr(5,2)+"月"+value.substr(8,2);
  364. }else{
  365. if(index == 10){
  366. $("#endValue").text(value ? value : "暂无");
  367. }
  368. return value.substr(8,2);
  369. }
  370. }else if(dateType == 3){
  371. var val = value.substr(5,2)+"月"
  372. if(index == 0){
  373. $("#startValue").text(value.substr(0,4)+"年"+val);
  374. }else{
  375. if(index == 9){
  376. $("#endValue").text(value.substr(0,4)+"年"+val);
  377. }
  378. }
  379. return val;
  380. }
  381. }
  382. }
  383. },
  384. yAxis: {
  385. type: 'value',
  386. axisPointer: {
  387. snap: true
  388. },
  389. scale: true,
  390. minInterval: 1,
  391. min: 0,
  392. boundaryGap: ['0%', '30%']
  393. },
  394. dataZoom: [{//给x轴设置滚动条
  395. show: false,
  396. start: dataZoom_end,
  397. end: 100,
  398. type: 'slider',
  399. zoomLock: true,
  400. },{ //下面这个属性是内容区域配置
  401. start: dataZoom_end,
  402. end: 100,
  403. type: 'inside',
  404. zoomLock: true,
  405. }],
  406. series: [{
  407. name: '设备发放量',
  408. type: 'line',
  409. smooth: true,
  410. data: yData,
  411. lineStyle:{
  412. normal: {
  413. color: 'rgba(66, 188, 254, 1)'
  414. }
  415. },
  416. itemStyle:{
  417. normal: {
  418. areaStyle: {
  419. type: 'default'
  420. },
  421. color: 'rgba(66, 188, 254, 1)'
  422. }
  423. }
  424. },
  425. {
  426. name: '设备绑定量',
  427. type: 'line',
  428. smooth: true,
  429. data: yData2,
  430. lineStyle:{
  431. normal: {
  432. color: 'rgba(120, 150, 254, 1)'
  433. }
  434. },
  435. itemStyle:{
  436. normal: {
  437. areaStyle: {
  438. type: 'default'
  439. },
  440. color: 'rgba(120, 150, 254, 1)'
  441. }
  442. }
  443. }]
  444. };
  445. lineCharts.clear();
  446. lineCharts.setOption(options);
  447. }
  448. /*
  449. * 处理底部区域数据
  450. */
  451. function listHandle(res){
  452. var list = res;
  453. var topArr = soreRank(amountArr(list));
  454. list = _.map(list, function(o, index){
  455. o.top = topArr[index];
  456. o.rate = parseFloat(o.rate).toFixed(2);
  457. return o;
  458. })
  459. var html = template("data-list", {list: list, level: level, lowLevel: lowLevel});
  460. $("#listTable").empty().append(html);
  461. }
  462. /*
  463. * 控制底部各区等tab的显示,根据level来控制
  464. */
  465. function showTabs(){
  466. $(".area-tab").removeClass("active");
  467. switch(level){
  468. case 4:
  469. $(".area-tab").show();
  470. $(".area-tab").eq(0).addClass("active");
  471. areaType = "4";
  472. break;
  473. case 3:
  474. $(".area-tab").eq(0).hide();
  475. $(".area-tab").eq(1).show();
  476. $(".area-tab").eq(1).addClass("active");
  477. areaType = "3";
  478. break;
  479. case 2:
  480. $(".area-tab").eq(0).hide();
  481. $(".area-tab").eq(1).hide();
  482. $(".area-tab").eq(2).addClass("active");
  483. areaType = "2";
  484. break;
  485. }
  486. }
  487. /*
  488. * 初始化scroller
  489. */
  490. function initScroller(){
  491. //阻尼系数
  492. var deceleration = mui.os.ios?0.003:0.0009;
  493. mui('.mui-scroll-wrapper').scroll({
  494. bounce: false,
  495. indicators: true, //是否显示滚动条
  496. deceleration:deceleration
  497. });
  498. mui('.mui-scroll-wrapper').pullRefresh({
  499. down: {
  500. callback: function() {
  501. var self = this;
  502. setTimeout(function() {
  503. initReqParams();
  504. loadData([0,1]);
  505. self.endPulldownToRefresh();
  506. }, 1000);
  507. }
  508. }
  509. });
  510. }
  511. /**
  512. * 初始化筛选事件
  513. */
  514. function shaixuanInit(main){
  515. var shaixuan = plus.webview.getWebviewById('shaixuan.html');
  516. if(!shaixuan){
  517. shaixuan = mui.createWindow({
  518. id: 'shaixuan.html',
  519. url: 'shaixuan.html',
  520. styles: {
  521. top: 0,
  522. bottom: 0,
  523. left: '20%',
  524. width: '80%',
  525. scorllIndicator: "none"
  526. },
  527. show:{
  528. aniShow: "slide-in-right",
  529. duration: "400"
  530. },
  531. extras:{
  532. }
  533. });
  534. }
  535. window.addEventListener("hideShaiXuan",function(){
  536. main.setStyle({mask:"none"});
  537. shaixuan.hide();
  538. }, false);
  539. window.addEventListener("showShaiXuan", function() {
  540. shaixuan.show();
  541. main.setStyle({mask:"rgba(0,0,0,0.5)"});
  542. main.addEventListener("maskClick",function(){
  543. main.setStyle({mask:"none"});
  544. shaixuan.hide();
  545. }, false);
  546. });
  547. }
  548. function bindEvents(){
  549. $(".header-link").on("tap", function() {
  550. // 跳转
  551. openWebview("../../wdsb/html/scan2.html", {isManage: 1});
  552. })
  553. //左滑筛选区域的数据
  554. $('.select-label-btn').on("tap", function(){
  555. var self = plus.webview.currentWebview();
  556. mui.fire(self, "showShaiXuan", {deviceCode: deviceCode});
  557. })
  558. //日、周、月按钮切换
  559. $(".date-tag").on("tap",function(){
  560. dateType = $(this).attr("data-type");
  561. $(".date-tag").removeClass("active");
  562. $(this).addClass("active");
  563. initReqParams();
  564. loadData([1]); //只加载中间区域的数据
  565. });
  566. //底部各区等区域的tab切换
  567. $(".area-tab").on('tap', function(){
  568. var $this = $(this),
  569. type = $this.attr("data-val"); //4 - 各区, 3 - 社区, 2 - 团队
  570. if($this.hasClass("active")){
  571. return false;
  572. }
  573. $(".area-tab").removeClass("active");
  574. $this.addClass("active");
  575. if(type == "4"){
  576. lowLevel = 0;
  577. }else if(type == "3"){
  578. lowLevel = 2;
  579. }else{
  580. lowLevel = 1;
  581. }
  582. initReqParams();
  583. loadData([0]);
  584. });
  585. //底部每条记录的点击事件
  586. $("#listTable").on('tap', ".data-row", function(){
  587. var $this = $(this),
  588. name = $this.attr("data-name"),
  589. code = $this.attr("data-code"),
  590. $selectTab = $(".area-tab.active");
  591. if($selectTab.attr("data-val") == "2"){ //获得团队信息,弹框显示数据
  592. showTeamInfo(code);
  593. return false;
  594. }
  595. title = name;
  596. area = code;
  597. var newlevel = level - 1;
  598. //如果是市级管理员,先点击“社区”tab后再往下看下一级的数据,需要将level再-1
  599. if(newlevel == 3 && lowLevel == 2){
  600. newlevel -- ;
  601. }
  602. lowLevel = '';
  603. level = newlevel;
  604. $("#areaTitle").text(title);
  605. //判断当前tab的位置
  606. var top = $(".area-tab-panel").offset().top;
  607. if(top < 0){
  608. mui(".mui-scroll-wrapper").scroll().scrollTo(0, -(parseInt(initTabOffsetTop)/2), 500);
  609. }
  610. showTabs();
  611. initReqParams();
  612. //记录返回链接信息
  613. reqList.push({
  614. level: level,
  615. lowLevel: lowLevel,
  616. area: area,
  617. title: title,
  618. lowCode: lowCode,
  619. req: reqParam
  620. });
  621. loadData([0,1]);
  622. });
  623. //弹出遮罩
  624. $(".icon-remark").on("click", function(e) {
  625. $(".modal-overlay").addClass("modal-overlay-visible");
  626. setTimeout(function(){
  627. $(".modal-content").show();
  628. },50)
  629. });
  630. $(".div-close,.modal-overlay").on("click",function(){
  631. $(".modal-overlay").removeClass("modal-overlay-visible");
  632. $(".modal-content").hide();
  633. });
  634. //添加页面监听
  635. window.addEventListener("refresh", function(e){
  636. lowCode = e.detail.lowCode || lowCode;
  637. deviceCode = e.detail.deviceCode;
  638. var name = e.detail.name;
  639. if (deviceCode == 2) {
  640. $(".select-label").html("血糖仪")
  641. } else if (deviceCode == 1) {
  642. $(".select-label").html("血压计")
  643. } else {
  644. $(".select-label").html("所有设备")
  645. }
  646. //重置变量值
  647. level = level;
  648. area = area;
  649. title = title;
  650. lowLevel = lowLevel;
  651. startDate = getStartDate();
  652. endDate = getEndDate();
  653. $("#areaTitle").text(title);
  654. $(".choose-label").text(name);
  655. initReqParams();
  656. //清空请求数组
  657. if(reqList.length == 2) {
  658. reqList.splice(1, 1);
  659. } else {
  660. reqList.splice(0, reqList.length)
  661. }
  662. //记录返回链接信息
  663. reqList.push({
  664. level: level,
  665. lowLevel: lowLevel,
  666. area: area,
  667. title: title,
  668. lowCode: lowCode,
  669. req: reqParam
  670. });
  671. loadData([0,1]);
  672. });
  673. }
  674. function getStartDate(){
  675. return chooseYear+'-07-01';
  676. }
  677. //获取结束时间
  678. function getEndDate(){
  679. var nowdate = new Date();
  680. var year = nowdate.getFullYear();
  681. var month = nowdate.getMonth() + 1;
  682. var day = nowdate.getDate();
  683. var endDate = new Date((parseInt(chooseYear)+1) + '-06-30');
  684. var now = new Date();
  685. if(now <= endDate){
  686. return now.format("yyyy-MM-dd");
  687. }else{
  688. return (parseInt(chooseYear)+1) + '-06-30';
  689. }
  690. }
  691. //续签量数据集合
  692. function amountArr(list){
  693. var amountArr = [];
  694. for(var k in list){
  695. amountArr.push(list[k].rate);
  696. }
  697. return amountArr;
  698. }
  699. //排名方法
  700. function soreRank(arr){
  701. var temp = [];
  702. var lis = [];
  703. for(var i=0;i<arr.length;i++){
  704. lis.push(arr[i]);
  705. }
  706. lis = _.uniq(lis);
  707. for(var i=0;i<arr.length;i++){
  708. temp[i] = lis.indexOf(arr[i])+1;
  709. }
  710. return temp;
  711. }
  712. /*
  713. * 获得团队信息
  714. */
  715. function showTeamInfo(teamId){
  716. var url = "/doctor/admin-teams/teams/info",
  717. params = {
  718. teamId: teamId
  719. };
  720. plus.nativeUI.showWaiting();
  721. sendGet(url, params, null, function(res){
  722. if(res.status == 200){
  723. var data = res.data;
  724. data.memberLength = data.members.length;
  725. var html = template("teamInfo", data);
  726. $("#teamInfoBox").empty().append(html);
  727. $(".modal-overlay").addClass("modal-overlay-visible");
  728. setTimeout(function(){
  729. $(".modal-content").show();
  730. },50)
  731. }else{
  732. mui.toast(res.msg);
  733. }
  734. plus.nativeUI.closeWaiting();
  735. }, true);
  736. }
  737. //返回事件
  738. var old_back = mui.back;
  739. mui.back = function(){
  740. if(reqList.length == 1){
  741. old_back();
  742. }
  743. else{
  744. var preInfo = reqList[reqList.length - 1];
  745. if(preInfo.level == level && preInfo.lowLevel == lowLevel){
  746. reqList.pop();
  747. var info = reqList[reqList.length - 1];
  748. }else{
  749. info = preInfo;
  750. }
  751. level = info.level;
  752. area = info.area;
  753. title = info.title;
  754. lowLevel = info.lowLevel;
  755. sumType = info.sumType;
  756. tagCode = info.tagCode;
  757. $("#areaTitle").html(title);
  758. showTabs();
  759. initReqParams();
  760. loadData([0,1]);
  761. }
  762. }