From 135f3ca3a332529c8a18188b738f8e5f23ae9c48 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sat, 12 Oct 2019 17:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E3=80=81=E8=80=83=E8=AF=95?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 +- pages/examtest/index.js | 5 + pages/examtest/index.wxml | 24 ++- pages/examtest/main.js | 1 + pages/main/main.js | 146 ++++++++----- pages/main/main.json | 5 +- pages/main/main.wxml | 17 ++ pages/main/main.wxss | 6 +- pages/observe/addobserve.js | 1 + pages/observe/observedetail.wxml | 14 +- pages/operation/operationadd.wxml | 4 +- pages/operation/operationcheck.js | 28 ++- pages/operation/operationcheck.wxml | 14 +- pages/operation/operationdetail.js | 40 +++- pages/operation/operationdetail.wxml | 308 +++++++++++++++------------ pages/riskact/index.wxml | 104 ++++----- 16 files changed, 446 insertions(+), 275 deletions(-) diff --git a/app.js b/app.js index a75ea24..2036e08 100644 --- a/app.js +++ b/app.js @@ -74,8 +74,8 @@ App({ }, globalData: { userInfo: null, - //serverUrl: 'https://safeyun.ctcshe.com/', - serverUrl: 'http://127.0.0.1:8000/', + serverUrl: 'https://safeyun.ctcshe.com/', + //serverUrl: 'http://127.0.0.1:8000/', //serverUrl: 'http://192.168.0.102:8000/', //serverUrl:'http://10.7.100.250:8000/', isaqy: 0, diff --git a/pages/examtest/index.js b/pages/examtest/index.js index d777d0e..e9e7031 100644 --- a/pages/examtest/index.js +++ b/pages/examtest/index.js @@ -108,6 +108,11 @@ Page({ } else { list = this.data.todokslist.concat(res.data.rows) } + for(var n=0;n 0 ? true : false; + list[n].isActive = isActive; + } this.setData({ todototal: res.data.total, todokslist: list diff --git a/pages/examtest/index.wxml b/pages/examtest/index.wxml index 7a7131b..b52faf9 100644 --- a/pages/examtest/index.wxml +++ b/pages/examtest/index.wxml @@ -10,18 +10,24 @@ {{item.examtest__name}} - 答卷时长:{{item.examtest__duration}}分钟 通过分数:{{item.examtest__passscore}} + 答卷时长:{{item.examtest__duration}}分钟 通过分数:{{item.examtest__passscore}} + + + 可参加 + 已过期 + + \ No newline at end of file diff --git a/pages/examtest/main.js b/pages/examtest/main.js index 7a93cfb..6053549 100644 --- a/pages/examtest/main.js +++ b/pages/examtest/main.js @@ -224,6 +224,7 @@ Page({ tmIndex:tmIndex, }) that.showChecked(tmIndex) + console.log(that.tmdata.tms) }, previous: function () { var that = this diff --git a/pages/main/main.js b/pages/main/main.js index 6d9ea99..66664f8 100644 --- a/pages/main/main.js +++ b/pages/main/main.js @@ -5,21 +5,51 @@ Page({ * 页面的初始数据 */ data: { - yhtodonum:0, - zytodonum:0, - noread:0, - dqdnum:0, - dknum:0, - gcnoread:0, - wsnoread:0, - jytodonum:0, - tasknum:0, + yhtodonum: 0, + zytodonum: 0, + noread: 0, + dqdnum: 0, + dknum: 0, + gcnoread: 0, + wsnoread: 0, + jytodonum: 0, + tasknum: 0, + serverUrl: getApp().globalData.serverUrl, + // Banner数据 + images: [], + // 是否显示面板指示点 + indicatorDots: true, + // 滑动方向是否为纵向 + vertical: false, + // 自动切换 + autoplay: true, + // 采用衔接滑动 + circular: true, + // 自动切换时间间隔2s + interval: 4000, + // 滑动动画时长0.5s + duration: 1000, + // 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值 + previousMargin: 0, + // 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值 + nextMargin: 0 }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + var that = this + let images = [ + that.data.serverUrl + 'media/banner/1.jpg', + that.data.serverUrl + 'media/banner/2.jpg', + that.data.serverUrl + 'media/banner/3.jpg', + that.data.serverUrl + 'media/banner/4.jpg', + that.data.serverUrl + 'media/banner/5.jpg', + ] + that.setData({ + images: images + }) }, /** @@ -34,7 +64,7 @@ Page({ onShow: function () { var that = this //获取待阅读通知数目 - if(wx.getStorageSync("sessionid")){ + if (wx.getStorageSync("sessionid")) { this.getnoread() this.getyhtodonum() this.getzytodonum() @@ -44,16 +74,16 @@ Page({ this.getwsnoreadnum()//未遂未读 this.getjytodonum() this.gettasknum() - }else{ + } else { getApp().callback = () => { - this.getnoread() - this.getyhtodonum() - this.getzytodonum() - this.getpxqdnum() - this.getdknum() - this.getgcnoreadnum() - this.getjytodonum() - this.gettasknum() + this.getnoread() + this.getyhtodonum() + this.getzytodonum() + this.getpxqdnum() + this.getdknum() + this.getgcnoreadnum() + this.getjytodonum() + this.gettasknum() }; } @@ -93,9 +123,9 @@ Page({ onShareAppMessage: function () { }, - getnoread: function(){ + getnoread: function () { wx.request({ - url: getApp().globalData.serverUrl + 'api/notice?a=noreadnum', + url: this.data.serverUrl + 'api/notice?a=noreadnum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -111,11 +141,11 @@ Page({ } }); }, - getyhtodonum:function(){ + getyhtodonum: function () { var that = this //获取隐患待办数目 wx.request({ - url: getApp().globalData.serverUrl + 'troublehandle?a=todonum', + url: this.data.serverUrl + 'troublehandle?a=todonum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -135,7 +165,7 @@ Page({ var that = this //获取作业待办数目 wx.request({ - url: getApp().globalData.serverUrl + 'api/operation?a=todonum', + url: this.data.serverUrl + 'api/operation?a=todonum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -151,11 +181,11 @@ Page({ } }); }, - getpxqdnum:function(){ + getpxqdnum: function () { var that = this //获取待签到培训 wx.request({ - url: getApp().globalData.serverUrl + 'pxhandle?a=dqdnum', + url: this.data.serverUrl + 'pxhandle?a=dqdnum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -175,7 +205,7 @@ Page({ var that = this //获取待考 wx.request({ - url: getApp().globalData.serverUrl + 'api/examtestdetail?a=dknum', + url: this.data.serverUrl + 'api/examtestdetail?a=dknum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -195,7 +225,7 @@ Page({ var that = this //获取待考 wx.request({ - url: getApp().globalData.serverUrl + 'gchandle?a=noreadnum', + url: this.data.serverUrl + 'gchandle?a=noreadnum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -215,7 +245,7 @@ Page({ var that = this //获取待考 wx.request({ - url: getApp().globalData.serverUrl + 'api/miss?a=noreadnum', + url: this.data.serverUrl + 'api/miss?a=noreadnum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -235,7 +265,7 @@ Page({ var that = this //获取待考 wx.request({ - url: getApp().globalData.serverUrl + 'api/suggest?a=todonum', + url: this.data.serverUrl + 'api/suggest?a=todonum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -255,7 +285,7 @@ Page({ var that = this //获取待考 wx.request({ - url: getApp().globalData.serverUrl + 'api/riskacttask?a=todonum', + url: this.data.serverUrl + 'api/riskacttask?a=todonum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -271,8 +301,8 @@ Page({ } }); }, - taptest:function(){ - if(getApp().globalData.rights != undefined){ + taptest: function () { + if (getApp().globalData.rights != undefined) { if (getApp().globalData.rights.indexOf('25') != -1) {//考试功能 wx.navigateTo({ url: '/pages/examtest/index', @@ -283,7 +313,7 @@ Page({ showCancel: false }) } - }else{ + } else { wx.showModal({ content: '加载中,请稍后。。', showCancel: false @@ -292,17 +322,18 @@ Page({ }, tapexercise: function () { if (getApp().globalData.rights != undefined) { - if (getApp().globalData.rights.indexOf('25') != -1) {//考试功能 - wx.navigateTo({ - url: '/pages/exercise/index', - }) - } else { - wx.showModal({ - content: '该功能如需开通,请查看公告或联系管理员!', - showCancel:false - }) - }} - else{ + if (getApp().globalData.rights.indexOf('25') != -1) {//考试功能 + wx.navigateTo({ + url: '/pages/exercise/index', + }) + } else { + wx.showModal({ + content: '该功能如需开通,请查看公告或联系管理员!', + showCancel: false + }) + } + } + else { wx.showModal({ content: '加载中,请稍后。。', showCancel: false @@ -311,22 +342,23 @@ Page({ }, tapinspect: function () { if (getApp().globalData.rights != undefined) { - if (getApp().globalData.rights.indexOf('35') != -1) {//设备巡检 - wx.navigateTo({ - url: '/pages/inspect/index', - }) - } else { - wx.showModal({ - content: '该功能如需开通,请查看公告或联系管理员!', - showCancel: false - }) - }} - else{ + if (getApp().globalData.rights.indexOf('35') != -1) {//设备巡检 + wx.navigateTo({ + url: '/pages/inspect/index', + }) + } else { + wx.showModal({ + content: '该功能如需开通,请查看公告或联系管理员!', + showCancel: false + }) + } + } + else { wx.showModal({ content: '加载中,请稍后。。', showCancel: false }) } }, - + }) \ No newline at end of file diff --git a/pages/main/main.json b/pages/main/main.json index 9e26dfe..b55b5a2 100644 --- a/pages/main/main.json +++ b/pages/main/main.json @@ -1 +1,4 @@ -{} \ No newline at end of file +{ + "usingComponents": { + } +} \ No newline at end of file diff --git a/pages/main/main.wxml b/pages/main/main.wxml index e0ae4bb..b4c0834 100644 --- a/pages/main/main.wxml +++ b/pages/main/main.wxml @@ -1,4 +1,21 @@ + + + + + + + + + + 数据采集 diff --git a/pages/main/main.wxss b/pages/main/main.wxss index ecc2274..d9973d0 100644 --- a/pages/main/main.wxss +++ b/pages/main/main.wxss @@ -1 +1,5 @@ -/* pages/main/main.wxss */ \ No newline at end of file +/* pages/main/main.wxss */ +.swiper-item-images{ + width: 100%; + height: 300rpx; +} diff --git a/pages/observe/addobserve.js b/pages/observe/addobserve.js index f2b9cb0..456699e 100644 --- a/pages/observe/addobserve.js +++ b/pages/observe/addobserve.js @@ -263,6 +263,7 @@ Page({ otherunsafe: this.data.otherunsafe, safecontent: this.data.safecontent, unsafe: this.getunsafe(), + lookers:this.data.lookers } //console.log(gcdata.unsafe) wx.request({ diff --git a/pages/observe/observedetail.wxml b/pages/observe/observedetail.wxml index 701a428..63fe4eb 100644 --- a/pages/observe/observedetail.wxml +++ b/pages/observe/observedetail.wxml @@ -27,11 +27,19 @@ - 观察人 + 记录人 {{looker__name}} + + + + 观察参与人 + + {{lookers}} + + @@ -80,7 +88,7 @@ 过程及交流记录 - + {{otherunsafe}} @@ -88,7 +96,7 @@ 共识或改进要求 - + {{safecontent}} diff --git a/pages/operation/operationadd.wxml b/pages/operation/operationadd.wxml index 5db30bf..b41f0bc 100644 --- a/pages/operation/operationadd.wxml +++ b/pages/operation/operationadd.wxml @@ -121,8 +121,8 @@ - {{item.fxfx}} - {{item.aqcs}} + {{item.fxfx}} + {{item.aqcs}} {{item.cslx}} diff --git a/pages/operation/operationcheck.js b/pages/operation/operationcheck.js index 513859c..79caa66 100644 --- a/pages/operation/operationcheck.js +++ b/pages/operation/operationcheck.js @@ -8,7 +8,9 @@ Page({ data: { serverUrl: getApp().globalData.serverUrl, zyimg2: [], - zjsp:false + zjsp:false, + zyspryname: '', + spry: [], }, getZy: function (zyid) { wx.showLoading({ @@ -122,7 +124,7 @@ Page({ wx.request({ url: that.data.serverUrl + 'api/operation?a=qrzy', header: { - 'content-type': 'application/x-www-form-urlencoded', // + 'content-type': 'aapplication/json', // 'Cookie': wx.getStorageSync("sessionid"), }, method: 'POST', @@ -142,7 +144,7 @@ Page({ wx.request({ url: that.data.serverUrl + 'api/operation?a=spzy', header: { - 'content-type': 'application/x-www-form-urlencoded', // + 'content-type': 'application/json', // 'Cookie': wx.getStorageSync("sessionid"), }, method: 'POST', @@ -252,6 +254,24 @@ Page({ } }); }, + zjsp: function () { + var that=this + wx.request({ + url: getApp().globalData.serverUrl + 'api/operation?a=spzy', + header: { + 'content-type': 'application/json', // + 'Cookie': wx.getStorageSync("sessionid"), + }, + method: 'POST', + data: { 'zyid': that.data.zyid, 'zjsp': true, 'newsprs': that.data.spry }, + success: res => { + if (res.statusCode === 200) { + wx.hideLoading(); + wx.navigateBack() + } + } + }); + }, openaction: function () { var that = this wx.showActionSheet({ @@ -270,7 +290,7 @@ Page({ wx.request({ url: that.data.serverUrl + 'api/operation?a=spzy', header: { - 'content-type': 'application/x-www-form-urlencoded', // + 'content-type': 'application/json', // 'Cookie': wx.getStorageSync("sessionid"), }, method: 'POST', diff --git a/pages/operation/operationcheck.wxml b/pages/operation/operationcheck.wxml index a066628..e2b1ce5 100644 --- a/pages/operation/operationcheck.wxml +++ b/pages/operation/operationcheck.wxml @@ -2,13 +2,13 @@ 作业详情 - + 当前状态 - 已关闭 - {{zyzt.zyzt}} - + {{zyzt.jdmc}}-{{zyzt.zyzt}} + {{zyzt.zyzt}} + 作业类型 @@ -87,9 +87,9 @@ - {{item.fxfx}} - {{item.aqcs}} - {{item.cslx}} + {{item.fxfx}} + {{item.aqcs}} + {{item.cslx}} diff --git a/pages/operation/operationdetail.js b/pages/operation/operationdetail.js index 139022e..77f8e9d 100644 --- a/pages/operation/operationdetail.js +++ b/pages/operation/operationdetail.js @@ -1,5 +1,6 @@ // pages/operation/operationcheck.js var util = require('../../utils/util.js') +var sliderWidth = 96; Page({ /** @@ -7,6 +8,17 @@ Page({ */ data: { serverUrl: getApp().globalData.serverUrl, + tabs: ["作业详情","流程详情"], + activeIndex: 0, + sliderOffset: 0, + sliderLeft: 0 + }, + tabClick: function (e) { + var that = this + that.setData({ + sliderOffset: e.currentTarget.offsetLeft, + activeIndex: e.currentTarget.id + }); }, getZy: function (zyid) { wx.showLoading({ @@ -31,8 +43,6 @@ Page({ zydata.zyimg2[i] = this.data.serverUrl + zydata.zyimg2[i]; } this.setData(zydata) - switch (zydata.zyzt) { - } //console.log(this.data.yhzt) } } @@ -42,7 +52,31 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.getZy(options.zyid); + var fromwx = options.fromwx + if(fromwx==1){ + var pages = getCurrentPages();//页面指针数组 + var prepage = pages[pages.length - 2];//上一页面指针 + var zydata = prepage.data + //格式化信息 + for (var i = 0; i < zydata.zyimg.length; i++) { + zydata.zyimg[i] = this.data.serverUrl + zydata.zyimg[i]; + } + for (var i = 0; i < zydata.zyimg2.length; i++) { + zydata.zyimg2[i] = this.data.serverUrl + zydata.zyimg2[i]; + } + this.setData(zydata) + }else{ + this.getZy(options.zyid); + } + var that = this + wx.getSystemInfo({ + success: function (res) { + that.setData({ + sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2, + sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex + }); + } + }); }, /** diff --git a/pages/operation/operationdetail.wxml b/pages/operation/operationdetail.wxml index 2d45527..2f61bf3 100644 --- a/pages/operation/operationdetail.wxml +++ b/pages/operation/operationdetail.wxml @@ -1,147 +1,187 @@ - - 作业详情 - - - - - 当前状态 - - 已关闭 - {{zyzt.zyzt}} - - - - 作业类型 - - - {{zylx__dickeyname}} - - - - - 作业地点 - - - {{zydd}} - - - - - 作业部门 - - - {{zybm__partname}} - - - - - 作业负责人 - - - {{zyfzr__name}} - - - - - 属地部门 - - - {{sdbm__partname}} - - - - - - 开始时间 - - - {{kssj}} - - - - - 结束时间 - - - {{jssj}} - - - - - 作业内容 - - {{zynr}} + + + + + {{item}} - + + - - - 现场图片 - - - - + + - + + + - - - -风险分析和安全措施 - - - - {{item.fxfx}} - {{item.aqcs}} - {{item.cslx}} - + 风险分析和安全措施 + + + + {{item.fxfx}} + {{item.aqcs}} + {{item.cslx}} + - - -作业人员确认详情 - - - - - {{item.operzyry__name}} + - - 待确认 - - - 已确认 - - - - -审批详情 - - - - - {{item.jdmc}} - {{item.spr__name}} {{item.submittime}} - - - 待审批 - - - 已通过 - - - - -关闭现场图片 - - - - - + 审批流程 + + + + + {{index+1}} {{item.jdmc}} + + + 已执行 + + + 已执行 + + 关闭现场图片 + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/riskact/index.wxml b/pages/riskact/index.wxml index dd43578..89c11a3 100644 --- a/pages/riskact/index.wxml +++ b/pages/riskact/index.wxml @@ -11,61 +11,61 @@