123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657 |
- <!DOCTYPE html>
- <html lang="zh-cn">
- <head>
- <meta charset="UTF-8">
- <meta name="format-detection" content="telephone=no"/>
- <meta name="format-detection" content="email=no"/>
- <title>home</title>
- <link rel="stylesheet" href="../css/reset.css">
- <link rel="stylesheet" href="../css/style.css">
- <script src="../script/flexible.js"></script>
- <style>
- html,body{
- height: 100%;
- }
- .homeHead{
- width: 100%;
- height: 5.1rem;
- position: relative;
- }
- .HBgImg{
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: -1;
- }
- .taskRemindDiv{
- width: 4rem;
- height: 4rem;
- margin: 0 auto;
- position: relative;
- }
- .homeHead img{
- display: inline-block;
- width: 100%;
- height: 100%;
- }
- #taskN{
- font-size: 1.54rem;
- color: #ff6e6e;
- font-family: "Arial";
- position: absolute;
- left: 49%;
- top: 45%;
- -webkit-transform: translate(-50%,-50%);
- }
- .home{
- width: 100%;
- /*background: url("../image/BG.jpg") no-repeat 100%/100%;*/
- /*padding-top: 1rem;*/
- position: relative;
- }
- .mainWarp{
- width: 90%;
- margin: 0 auto;
- }
- .mainWarp ul{
- padding-bottom: .48rem;
- }
- .mainWarp ul li{
- width: 25%;
- font-size: .42rem;
- float: left;
- padding-top: .2rem;
- }
- .mainWarp ul li:nth-of-type(2n+1){
- margin-left: 0;
- }
- .mainWarp ul li:nth-of-type(7),.mainWarp ul li:nth-of-type(8){
- margin-bottom: 0;
- }
- .mainWarp ul li div{
- width: 100%;
- height: 100%;
- /*background-color: #096a6c;*/
- /*border-radius: .3rem;*/
- /*padding-top: .5rem;*/
- position: relative;
- }
- .mainWarp ul li span{
- display: block;
- width: 1.63rem;
- height: 1.63rem;
- margin: 0 auto;
- }
- .navTit{
- font-size: .35rem;
- color: #616161;
- text-align: center;
- }
- .remindMes{
- width: .5rem;
- height: .5rem;
- line-height: .5rem;
- text-align: center;
- font-size: .3rem;
- color: #fff;
- border-radius: 50%;
- background-color: #ed1c24;
- position: absolute;
- right: .35rem;
- top: .18rem;
- display: none;
- }
- .remindMes.active{
- display: block;
- }
- .taskTitle{
- height: .9rem;
- line-height: .9rem;
- font-size: .35rem;
- color: #898989;
- padding-left: .2rem;
- background-color: #ececec;
- }
- .noTask{
- height: 1.46rem;
- line-height: 1.46rem;
- text-align: center;
- color: #898989;
- font-size: .35rem;
- background-color: #fff;
- margin-top: .26rem;
- }
- .task_con {
- overflow: auto;
- }
- .task_con ul{
- display: none;
- }
- .task_con li {
- height: 2.83rem;
- margin-bottom: .15rem;
- background-color: #fff;
- position: relative;
- overflow: hidden;
- }
- .task_con li>div {
- display: inline-block;
- }
- .task_status {
- height: 100%;
- font-size: .38rem;
- text-align: center;
- white-space: pre-wrap;
- color: #fff;
- position: relative;
- opacity: 0;
- }
- .task_status_1{
- background-color: #f26522;
- }
- .task_status_2{
- background-color: #22ac38;
- }
- .task_status_3{
- background-color: #a0a0a0;
- }
- .task_status_4{
- background-color: #f39700;
- }
- .task_status span {
- display: inline-block;
- width: .2rem;
- position: absolute;
- top: 50%;
- left: calc(50% - .1rem);
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
- }
- .task_taskCon {
- max-width: calc(100% - 1.1rem);
- padding: .2rem 0 0 .2rem ;
- }
- .task_taskCon p {
- margin-bottom: .1rem;
- height: .5rem;
- color: #3d3d3d;
- font-size: .38rem;
- white-space: nowrap;
- }
- .task_name{
- display: inline-block;
- max-width: 6.1rem;
- font-size: .5rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- vertical-align: middle;
- }
- .task_taskCon p:first-of-type{
- height: .6rem;
- position: relative;
- }
- .task_taskCon p:nth-of-type(n+2){
- width: 8rem;
- color: #898989;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .icon_1{
- width: .3rem;
- height: .3rem;
- background: url("../image/task_icon_1.png") no-repeat 100% 110%/100%;
- margin-right: .1rem;
- }
- .icon_2{
- width: .3rem;
- height: .3rem;
- background: url("../image/task_icon_2.png") no-repeat 50% 140%/80%;
- margin-right: .1rem;
- }
- .task_taskCon p:last-of-type{
- width: 100%;
- overflow: visible;
- }
- .task_taskCon p:nth-of-type(3) {
- margin-bottom: .11rem;
- }
- .task_dbqk {
- display: inline-block;
- font-size: .3rem;
- padding: 0 .1rem;
- border-radius: .03rem;
- color: #fff;
- margin-left: .26rem;
- white-space: nowrap;
- }
- .task_dbqk1{
- background-color: #f39700;
- }
- .task_dbqk2{
- background-color: #ff0000;
- }
- .task_dbqk3{
- background-color: #bbbc5f;
- }
- .task_dbqk4{
- background-color: #e60012;
- }
- .task_dbqk5{
- background-color: #cacbbb;
- }
- .task_pssj,
- .task_wcsj {
- display: inline-block;
- height: .4rem;
- line-height: .4rem;
- font-size: .3rem;
- padding: 0 .18rem;
- border-radius: .03rem;
- }
- .task_pssj {
- border: 1px solid #3aca74;
- color: #3aca74;
- margin-right: .2rem;
- }
- .task_wcsj {
- border: 1px solid #fd9b53;
- color: #fd9b53;
- }
- .task_jt {
- position: absolute;
- top:0;
- right: 0;
- height: 100%;
- line-height: 2.6rem;
- font-size: .5rem;
- color: #b5b5b5;
- padding: 0 .18rem;
- }
- .nomore_tit{
- width: 60%;
- border-top: 1px solid #e0e0e0;
- margin: .2rem auto;
- }
- .nomore_txt{
- font-size: .4rem;
- color: #b0b0b0;
- text-align: center;
- padding: 0 .1rem;
- }
- .hid{
- display: none;
- }
- </style>
- </head>
- <body>
- <div class="homeHead">
- <div class="HBgImg"><img src="../image/home_head.jpg" alt=""></div>
- <div class="taskRemindDiv">
- <img src="../image/home_head.png" alt="">
- <i id="taskN"></i>
- <p id="isHas"></p>
- </div>
- </div>
- <div class="home">
- <div class="mainWarp">
- <ul class="clearFix">
- <li><div><span><img src="../image/icon_alltask.png" alt=""></span><p class="navTit">检修任务</p><i class="remindMes" id="taskNum">0</i></div></li>
- <li><div><span><img src="../image/icon_remind.png" alt=""></span><p class="navTit">巡查任务</p><i class="remindMes" id="xcNum">0</i></div></li>
- <li><div><span><img src="../image/icon_mes.png" alt=""></span><p class="navTit">协助任务</p><i class="remindMes">0</i></div></li>
- <li><div><span><img src="../image/icon_underway.png" alt=""></span><p class="navTit">历史任务</p><i class="remindMes">0</i></div></li>
- <li><div><span><img src="../image/icon_vcard.png" alt=""></span><p class="navTit">我的审核</p><i class="remindMes" id="shNum">0</i></div></li>
- <li><div><span><img src="../image/icon_temporary.png" alt=""></span><p class="navTit">我的管区</p><i class="remindMes">0</i></div></li>
- <li><div><span><img src="../image/icon_finish.png" alt=""></span><p class="navTit">发起任务</p><i class="remindMes" id="mesNum">0</i></div></li>
- <li><div><span><img src="../image/icon_overdue.png" alt=""></span><p class="navTit">警告异常</p><i class="remindMes" id="warning">0</i></div></li>
- </ul>
- </div>
- <div class="maxZIndex"></div>
- </div>
- <div class="taskTitle hid">待处理任务</div>
- <div class="noTask hid">无检修任务</div>
- <div class="flex-con task_con">
- <ul>
- <li class="flex-wrap" data-taskid="{{taskID}}" data-lon="{{lon}}" data-lat="{{lat}}">
- <div class="task_status {{taskstatus}}" data-taskstatus="0"><span>{{status}}</span></div>
- <div class="task_taskCon flex-con">
- <p><span class="task_name">{{name}}</span><span class="task_dbqk {{statusclass}}">{{type}}</span></p>
- <p><i class="icon_1"></i>检修内容:<span class="task_duty">{{duty}}</span></p>
- <p><i class="icon_2"></i>地址:<span class="task_dw">{{enterprise}}</span></p>
- <p><span class="task_pssj">申请日期:{{pssj}}</span><span class="task_wcsj">计划开始:{{jhks}}</span></p>
- </div>
- <div class="task_jt">〉</div>
- </li>
- </ul>
- </div>
- <div class="nomore hid">
- <fieldset class="nomore_tit">
- <legend align="center" class="nomore_txt">已经没有更多了</legend>
- </fieldset>
- </div>
- <script src="../script/publicData.js"></script>
- <script src="../script/jqueryMin.js"></script>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript">
- var ad=["3"],ld=["1","3","5"];
- var duty,page=1;
- var ulModel=$(".task_con ul").html();
- apiready = function(){
- var warp=$api.dom(".mainWarp");
- var warpLi=$api.domAll(warp,"li");
- for(var i=0,len=warpLi.length;i<len;i++){
- !function (i) {
- warpLi[i].onclick=function () {
- openFrame(i);
- $api.rmStorage("dep");
- }
- }(i)
- }
- function openFrame(i) {
- var jsfun=null;
- switch (i){
- case 0:jsfun = 'toFrame(1);';break;
- case 1:jsfun = 'toFrame(15);';break;
- case 3:
- api.openFrame({
- name: 'homePopups',
- url: './homePopups.html',
- rect: {
- x: 0,
- y: 0,
- w: api.winWidth,
- h: api.winHeight
- },
- bounces: false
- });
- return;
- case 7:jsfun = 'toFrame(2);';break;
- case 5:jsfun = 'toWindow("districtMap");';break;
- case 2:jsfun = 'toFrame(17);';break;
- case 6:
- api.openWin({
- name: 'allBDG',
- url: './allTask.html',
- animation: {
- type: 'push',
- subType: 'from_right',
- duration: 300
- },
- delay:300
- });break;
- case 4:jsfun = 'toFrame(13)';break;
- }
- api.execScript({
- script: jsfun
- });
- }
- if(api.systemType=="ios"){
- $(".task_taskCon p").css("margin-bottom",".1rem")
- }
- if(!$api.getStorage("task_frame1Data")){
- api.showProgress({
- title: '努力加载中...',
- text: '请稍等...',
- modal: false
- });
- }
- api.addEventListener({
- name:'scrolltobottom',
- extra:{
- threshold:0 //设置距离底部多少距离时触发,默认值为0,数字类型
- }
- }, function(ret, err){
- if(!$(".nomore").hasClass("hid")){
- return;
- }else {
- if($api.getStorage("taskpage")<=1) return;
- api.toast({
- msg: '正在加载更多',
- duration: 2000,
- location: 'bottom'
- });
- }
- api.ajax({
- url: pageUrl+"/index/task/index",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_id:$api.getStorage("user").id, page:page, status:0, type:2}
- }
- }, function (data, err) {
- data=JSON.parse(data)
- // alert(JSON.stringify(data))
- var data=data.data,str="";
- var dataNames1=[];
- if(!data.length){
- }else {
- for(var i in data){
- str+=ulModel.replace("{{taskID}}",data[i]['id']).replace("{{name}}",data[i]['title']).replace("{{duty}}",data[i]['remark']).replace("{{enterprise}}",data[i]['address']).replace("{{type}}",data[i]['task_type']==1?"紧急":"常规").replace("{{statusclass}}",data[i]['task_type']==0?"task_dbqk1":"task_dbqk2")
- .replace("{{pssj}}",data[i]['created_at']?data[i]['created_at'].slice(0,16):"").replace("{{wcsj}}",data[i]['end_time']?data[i]['end_time'].slice(0,16):"").replace("{{lon}}",data[i]['lon']).replace("{{lat}}",data[i]['lat'])
- switch (data[i]['status']+""){
- case "0":str=str.replace("{{status}}","未开始").replace("{{taskstatus}}","task_status_1");break;
- case "1":str=str.replace("{{status}}","进行中").replace("{{taskstatus}}","task_status_2");break;
- case "2":str=str.replace("{{status}}","暂停中").replace("{{taskstatus}}","task_status_4");break;
- case "3":str=str.replace("{{status}}","已完成").replace("{{taskstatus}}","task_status_3");break;
- }
- dataNames1.push(data[i]['title'])
- }
- }
- api.refreshHeaderLoadDone();
- if(page>=$api.getStorage("taskpage")&&$api.getStorage("taskpage")!=0){
- $(".nomore").removeClass("hid")
- }else {
- page++;
- }
- $(".task_con ul")[0].insertAdjacentHTML("beforeend",str);
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- });
- api.addEventListener({
- name: 'refresh'
- }, function (ret, err) {
- var type=ret.value.task_type;
- var index=$api.getStorage("selectli");
- switch (type){
- case 0:$(".task_con li:eq("+index+")").find(".task_status")[0].className="task_status task_status_1";$(".task_con li:eq("+index+") .task_status span").text("未开始");break;
- case 1:$(".task_con li:eq("+index+")").find(".task_status")[0].className="task_status task_status_2";$(".task_con li:eq("+index+") .task_status span").text("进行中");break;
- case 2:$(".task_con li:eq("+index+")").find(".task_status")[0].className="task_status task_status_4";$(".task_con li:eq("+index+") .task_status span").text("暂停中");break;
- case 3:$(".task_con li:eq("+index+")").remove();break;
- }
- });
- $(".task_con ul").on('click','li',function () {
- //在名为winName的window中执行jsfun脚本
- var jsfun1 = 'toFrame(6);',that=$(this).index();
- $api.setStorage("taskXQ",{taskID:this.dataset.taskid,lon:this.dataset.lon,lat:this.dataset.lat,tohome:true,taskType:"service"});
- api.execScript({
- script: jsfun1
- });
- })
- $(".taskRemindDiv").click(function () {
- var jsfun = 'toFrame(1);'
- api.execScript({
- script: jsfun
- });
- })
- api.addEventListener({
- name: 'reloadPage'
- }, function (ret, err) {
- api.closeFrame({
- name: 'home'
- });
- });
- }
- function getTaskList() {
- api.ajax({
- url: pageUrl+"/index/task/index",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_id:$api.getStorage("user").id, page:1, status:0, type:2}
- }
- }, function (data, err) {
- data=JSON.parse(data)
- // alert(JSON.stringify(data))
- $api.setStorage("taskpage",data["last_page"]);
- var data=data.data,str="";
- var dataNames1=[];
- if(!data.length){
- }else {
- for(var i in data){
- str+=ulModel.replace("{{taskID}}",data[i]['id']).replace("{{name}}",data[i]['title']).replace("{{duty}}",data[i]['remark']).replace("{{enterprise}}",data[i]['address']).replace("{{type}}",data[i]['task_type']==1?"紧急":"常规").replace("{{statusclass}}",data[i]['task_type']==0?"task_dbqk1":"task_dbqk2")
- .replace("{{pssj}}",data[i]['start_time']?data[i]['start_time'].slice(0,16):"").replace("{{jhks}}",data[i]['created_at']?data[i]['created_at'].slice(0,16):"未设定").replace("{{lon}}",data[i]['lon']).replace("{{lat}}",data[i]['lat'])
- switch (data[i]['status']=""){
- case "0":str=str.replace("{{status}}","未开始").replace("{{taskstatus}}","task_status_1");break;
- case "1":str=str.replace("{{status}}","进行中").replace("{{taskstatus}}","task_status_2");break;
- case "2":str=str.replace("{{status}}","暂停中").replace("{{taskstatus}}","task_status_4");break;
- case "3":str=str.replace("{{status}}","已完成").replace("{{taskstatus}}","task_status_3");break;
- }
- dataNames1.push(data[i]['title'])
- }
- }
- api.refreshHeaderLoadDone();
- api.hideProgress();
- if(page>=$api.getStorage("taskpage")&&$api.getStorage("taskpage")!=0){
- $(".nomore").removeClass("hid")
- }else {
- page++;
- }
- $(".task_con ul").html(str).css("display","block");
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- }
- function setData() {
- getTaskList();
- if(!$api.getStorage("user").id) return;
- api.ajax({
- url: pageUrl+"/index/index",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_id:$api.getStorage("user").id}
- }
- }, function (data, err) {
- var data=JSON.parse(data),bl="";
- data['jinggao']-0>0?$("#warning").text(data['jinggao']).addClass("active"):$("#warning").text("0").removeClass("active");
- data['task']-0>0?$("#taskNum").text(data['task']).addClass("active"):$("#taskNum").text("0").removeClass("active");
- data['message']-0>0?$("#mesNum").text(data['message']).addClass("active"):$("#mesNum").text("0").removeClass("active");
- data['check_task']-0>0?$("#shNum").text(data['check_task']).addClass("active"):$("#shNum").text("0").removeClass("active");
- data['task_xc']-0>0?$("#xcNum").text(data['task_xc']).addClass("active"):$("#xcNum").text("0").removeClass("active");
- if(data['task']>0){
- $(".HBgImg>img").prop("src","../image/home_head2.jpg");
- $(".taskRemindDiv>img").prop("src","../image/home_head2.png");
- $("#taskN").text(data['task']);
- $(".taskTitle").removeClass("hid");
- $(".noTask").addClass("hid");
- $api.setStorage("first","1");
- bl= 'setRed();';
- }else {
- $(".HBgImg img").prop("src","../image/home_head.jpg");
- $(".taskRemindDiv>img").prop("src","../image/home_head.png");
- $("#taskN").text("");
- $(".noTask").removeClass("hid");
- $(".taskTitle").addClass("hid");
- if(!$(".nomore").hasClass("hid")){
- $(".nomore").addClass("hid");
- }
- $api.setStorage("first","0");
- bl= 'setGreen();';
- }
- if($api.getStorage("Colorjl")!=$api.getStorage("first")){
- api.execScript({
- script: bl
- });
- }
- $api.setStorage("Colorjl",$api.getStorage("first"))
- $api.setStorage("homeData",data);
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- api.ajax({
- url: pageUrl+"/index/user/auditor",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_module_id:326}
- }
- }, function (data, err) {
- var data=JSON.parse(data),selectData=[];
- // alert(JSON.stringify(data))
- for(var i in data){
- selectData[i]={
- id:data[i]['id'],
- text: data[i]['name'],
- status: 'normal'
- }
- }
- $api.setStorage("userList",selectData);
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- api.ajax({
- url: pageUrl+"/index/user/auditor",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_module_id:328}
- }
- }, function (data, err) {
- var data=JSON.parse(data),headmanData=[];
- // alert(JSON.stringify(data))
- for(var i in data){
- headmanData[i]={
- id:data[i]['id'],
- text: data[i]['name'],
- status: 'normal'
- }
- }
- $api.setStorage("headmanList",headmanData);
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- if($api.getStorage("homeData")){
- var data=$api.getStorage("homeData");
- data['jinggao']-0>0?$("#warning").text(data['jinggao']).addClass("active"):$("#warning").text("0").removeClass("active");
- data['task']-0>0?$("#taskNum").text(data['task']).addClass("active"):$("#taskNum").text("0").removeClass("active");
- data['message']-0>0?$("#mesNum").text(data['message']).addClass("active"):$("#mesNum").text("0").removeClass("active");
- data['check_task']-0>0?$("#shNum").text(data['check_task']).addClass("active"):$("#shNum").text("0").removeClass("active");
- data['task_xc']-0>0?$("#xcNum").text(data['task_xc']).addClass("active"):$("#xcNum").text("0").removeClass("active");
- }
- }
- </script>
- </body>
- </html>
|