From d49e827b37edc04aad5510700c0d91f6f8e75995 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 6 Aug 2019 09:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=80=83=E8=AF=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/equipment/detail.js | 10 +++++++++- pages/equipment/detail.wxml | 3 ++- pages/equipment/detail.wxss | 5 ++++- pages/examtest/main.js | 2 +- pages/main/main.js | 31 ++++++++++++++++++++++++++----- pages/trouble/accesstrouble.js | 25 +++++++++++++------------ 6 files changed, 55 insertions(+), 21 deletions(-) diff --git a/pages/equipment/detail.js b/pages/equipment/detail.js index 82a6291..5273f67 100644 --- a/pages/equipment/detail.js +++ b/pages/equipment/detail.js @@ -6,7 +6,7 @@ Page({ * 页面的初始数据 */ data: { - + fromWx:false }, /** @@ -22,6 +22,9 @@ Page({ // console.log("index 生命周期 onload url=" + q) // console.log("index 生命周期 onload 参数 trainid=" + util.getQueryString(q, 'trainid')) equipmentid = util.getQueryString(q, 'id') + this.setData({ + fromWx:true + }) } } wx.request({ @@ -87,5 +90,10 @@ Page({ */ onShareAppMessage: function () { + }, + back: function () { + wx.switchTab({ + url: '/pages/main/main' + }) } }) \ No newline at end of file diff --git a/pages/equipment/detail.wxml b/pages/equipment/detail.wxml index e4ecb82..a86d6bc 100644 --- a/pages/equipment/detail.wxml +++ b/pages/equipment/detail.wxml @@ -64,4 +64,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/equipment/detail.wxss b/pages/equipment/detail.wxss index 59a94d0..5bbca33 100644 --- a/pages/equipment/detail.wxss +++ b/pages/equipment/detail.wxss @@ -1 +1,4 @@ -/* pages/equipment/detail.wxss */ \ No newline at end of file +.weui-btn{ + width:auto; + margin: 5px; +} \ No newline at end of file diff --git a/pages/examtest/main.js b/pages/examtest/main.js index 94c63c7..bd3eaf1 100644 --- a/pages/examtest/main.js +++ b/pages/examtest/main.js @@ -197,7 +197,7 @@ Page({ var tm = this.tmdata.tms[index] let choices = this.data.answerChoices if(tm.userchecked){ - if (tm.question__type = 2) { + if (tm.question__type == 2) { for (var i = 0, len = choices.length; i < len; i++) { if (tm.userchecked.indexOf(choices[i].value) != -1) { choices[i].checked = true diff --git a/pages/main/main.js b/pages/main/main.js index c2709c2..54c9967 100644 --- a/pages/main/main.js +++ b/pages/main/main.js @@ -249,18 +249,26 @@ Page({ }); }, taptest:function(){ - if (getApp().globalData.rights.indexOf('25') != -1) {//考试功能 - wx.navigateTo({ - url: '/pages/examtest/index', - }) + if(getApp().globalData.rights != undefined){ + if (getApp().globalData.rights.indexOf('25') != -1) {//考试功能 + wx.navigateTo({ + url: '/pages/examtest/index', + }) + } else { + wx.showModal({ + content: '该功能如需开通,请查看公告或联系管理员!', + showCancel: false + }) + } }else{ wx.showModal({ - content: '该功能如需开通,请查看公告或联系管理员!', + content: '加载中,请稍后。。', showCancel: false }) } }, tapexercise: function () { + if (getApp().globalData.rights != undefined) { if (getApp().globalData.rights.indexOf('25') != -1) {//考试功能 wx.navigateTo({ url: '/pages/exercise/index', @@ -270,9 +278,16 @@ Page({ content: '该功能如需开通,请查看公告或联系管理员!', showCancel:false }) + }} + else{ + wx.showModal({ + content: '加载中,请稍后。。', + showCancel: false + }) } }, tapinspect: function () { + if (getApp().globalData.rights != undefined) { if (getApp().globalData.rights.indexOf('35') != -1) {//设备巡检 wx.navigateTo({ url: '/pages/inspect/index', @@ -282,6 +297,12 @@ Page({ content: '该功能如需开通,请查看公告或联系管理员!', showCancel: false }) + }} + else{ + wx.showModal({ + content: '加载中,请稍后。。', + showCancel: false + }) } }, diff --git a/pages/trouble/accesstrouble.js b/pages/trouble/accesstrouble.js index 5e1711e..f2547cc 100644 --- a/pages/trouble/accesstrouble.js +++ b/pages/trouble/accesstrouble.js @@ -159,7 +159,6 @@ Page({ data: {}, success: res => { if (res.statusCode === 200) { - //console.log(res.data) this.data.yhpgArray = res.data; this.setData({ yhpgArray: res.data, @@ -177,7 +176,6 @@ Page({ data: {}, success: res => { if (res.statusCode === 200) { - //console.log(res.data) this.data.yhlxArray = res.data; this.setData({ yhlxArray: res.data, @@ -195,7 +193,6 @@ Page({ data: {}, success: res => { if (res.statusCode === 200) { - //console.log(res.data) this.yhlbArray.data1 = res.data; } } @@ -210,7 +207,6 @@ Page({ data: {}, success: res => { if (res.statusCode === 200) { - //console.log(res.data) this.yhlbArray.data2 = res.data; } } @@ -221,7 +217,6 @@ Page({ case 7: break; } - //console.log(this.data.yhzt) } } }); @@ -317,6 +312,7 @@ Page({ }, //上传整改图片 upimg2: function (x, y) { + console.log(x,y) var that = this if (x < y) { wx.showLoading({ @@ -346,7 +342,12 @@ Page({ that.data.zghtp[x].replace(that.data.serverUrl, "") var bl = that.data.zghtp[x].replace(that.data.serverUrl, "") that.data.zghtp[x] = bl - that.accesstrouble() + x = x + 1 + if (x < y) { + that.upimg2(x, y) + } else { + that.accesstrouble() + } } } else { that.accesstrouble() @@ -383,7 +384,12 @@ Page({ } else { var bl=that.data.yhtp[x].replace(that.data.serverUrl, "") that.data.yhtp[x] = bl - that.addtrouble() + x = x + 1 + if (x < y) { + that.upimg(x, y) + } else { + that.addtrouble() + } } } else { that.addtrouble() @@ -411,7 +417,6 @@ Page({ }, accesstrouble: function(){ var that=this - //console.log(that.data.zghtp) wx.request({ url: that.data.serverUrl + 'accessyh', header: { @@ -434,7 +439,6 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - //console.log(options) this.getYh(options.troubleid); var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear); var dateTimeArray1 = obj1.dateTimeArray @@ -539,7 +543,6 @@ Page({ var that = this; var zghtp = that.data.zghtp; var index = e.currentTarget.dataset.index; //获取当前长按图片下标 - console.log(e.index) wx.showModal({ title: '系统提醒', content: '确定要删除此图片吗?', @@ -581,7 +584,6 @@ Page({ sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: function (res) { - //console.log(that.data.zghtp == '') if(that.data.zghtp==''){ that.data.zghtp=[] } @@ -598,7 +600,6 @@ Page({ sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: function (res) { - //console.log(that.data.zghtp == '') if (that.data.yhtp == '') { that.data.yhtp = [] }