|
|
@ -74,7 +74,7 @@ Page({ |
|
|
|
checkItems: checkItems.map(c => ({ |
|
|
|
id: `${device.deviceId}-${c.id}`, |
|
|
|
name: c.name, |
|
|
|
isNormal: null, |
|
|
|
isNormal: true, |
|
|
|
msgInp: null, |
|
|
|
level: null, |
|
|
|
imgs: [], |
|
|
@ -86,7 +86,7 @@ Page({ |
|
|
|
checkItems: checkItems.map(c => ({ |
|
|
|
id: c.id, |
|
|
|
name: c.name, |
|
|
|
isNormal: null, |
|
|
|
isNormal: true, |
|
|
|
msgInp: null, |
|
|
|
level: null, |
|
|
|
imgs: [], |
|
|
@ -152,22 +152,38 @@ Page({ |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showToast({ |
|
|
|
title: res.errMsg, |
|
|
|
icon: 'none', |
|
|
|
duration: 1000 |
|
|
|
}); |
|
|
|
if (res.errMsg === 'getLocation:fail auth deny') { |
|
|
|
that.toSettingModal('请允许位置权限') |
|
|
|
} else { |
|
|
|
wx.showToast({ |
|
|
|
title: res.errMsg, |
|
|
|
icon: 'none', |
|
|
|
duration: 1000 |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
toSettingModal() { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
confirmText: '去设置', |
|
|
|
content: '请允许位置权限', |
|
|
|
success: function (res) { |
|
|
|
const { confirm } = res || {} |
|
|
|
if (confirm) { |
|
|
|
wx.openSetting() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeTwo(e) { |
|
|
|
const isNormal = e.detail === 'normal'; |
|
|
|
const { deviceidx, itemidx } = e.currentTarget.dataset; |
|
|
|
let nextInspectContentArr = this.data.inspectContentArr; |
|
|
|
|
|
|
|
nextInspectContentArr[deviceidx].checkItems[itemidx].isNormal = isNormal; |
|
|
|
if (isNormal) { // 清除异常数据
|
|
|
|
nextInspectContentArr[deviceidx].checkItems[itemidx].isNormal = e.detail; |
|
|
|
if (e.detail) { // 清除异常数据
|
|
|
|
nextInspectContentArr[deviceidx].checkItems[itemidx].msgInp = null; |
|
|
|
nextInspectContentArr[deviceidx].checkItems[itemidx].level = null; |
|
|
|
nextInspectContentArr[deviceidx].checkItems[itemidx].imgs = []; |
|
|
|