修正考试bug

This commit is contained in:
caoqianming 2019-08-06 09:00:40 +08:00
parent 930d652732
commit d49e827b37
6 changed files with 55 additions and 21 deletions

View File

@ -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'
})
}
})

View File

@ -64,4 +64,5 @@
</view>
</view>
</view>
</view>
</view>
<button class="weui-btn" type="primary" bindtap='back' wx:if="{{fromWx}}">返回主页</button>

View File

@ -1 +1,4 @@
/* pages/equipment/detail.wxss */
.weui-btn{
width:auto;
margin: 5px;
}

View File

@ -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

View File

@ -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
})
}
},

View File

@ -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 = []
}