修改语音、巡更上报接口调用时间

main
jinna 2 years ago
parent 7ff6fe2371
commit 813998dee2
  1. 97
      pages/patrolRecord/report.vue
  2. 78
      pages/voiceRecord/report.vue

@ -70,7 +70,8 @@
rules: {},
userInfo: {},
locationInfo: {},
deviceSn:''
deviceSn:'',
filesList:[]
}
},
onUnload() {
@ -107,7 +108,7 @@
this.form.longidute = obj.y;
});
this.queryPlanTypeList();
this.getDeviceSn()
// this.getDeviceSn()
},
methods: {
getDeviceSn(){
@ -143,25 +144,43 @@
uni.removeStorageSync('bizToken');
this.getDeviceSn(deviceId);
}else{
// setTimeout(() =>{
// uni.showToast({
// title: 'device ============>' + res.data.rows[0].tags,
// icon: 'none'
// });
// },1000)
// setTimeout(() =>{
// uni.showToast({
// title: 'mac ============>' + JSON.parse(res.data.rows[0].tags),
// icon: 'none'
// });
// },5000)
// setTimeout(() =>{
// uni.showToast({
// title: 'mac1 ============>' + JSON.parse(res.data.rows[0].tags).mac,
// icon: 'none'
// });
// },10000)
this.deviceSn = JSON.parse(res.data.rows[0].tags).mac;
let _arr = [];
this.filesList.forEach(item => {
_arr.push({url: item});
})
let data = {
"alarmTypeIdentity": "700006",
"description": "巡更照片上报",
"deviceSn": this.deviceSn,
"platformCode": "DIANXIN",
"pictureList": _arr
}
console.log('iot', data)
uni.request({
url: getApp().globalData.apiUrl + '/appData/escalation',
method: 'POST',
data: data,
success: (res) => {
let _data = JSON.parse(res.data.data);
if (_data.resultCode == 0) {
uni.showToast({
title: '成功'
});
uni.redirectTo({
url: '/pages/patrolRecord/list'
})
} else {
uni.showToast({
title: _data.msg,
icon: 'none'
});
}
},
complete: (res) => {
console.log(res)
}
})
}
},
fail: (err) => {
@ -323,42 +342,8 @@
// title: 'deviceSN ===========>' + this.deviceSn,
// icon: 'none'
// })
let _arr = [];
files.forEach(item => {
_arr.push({url: item});
})
let data = {
"alarmTypeIdentity": "700006",
"description": "巡更照片上报",
"deviceSn": this.deviceSn,
"platformCode": "DIANXIN",
"pictureList": _arr
}
console.log('iot', data)
uni.request({
url: getApp().globalData.apiUrl + '/appData/escalation',
method: 'POST',
data: data,
success: (res) => {
let _data = JSON.parse(res.data.data);
if (_data.resultCode == 0) {
uni.showToast({
title: '成功'
});
uni.redirectTo({
url: '/pages/patrolRecord/list'
})
} else {
uni.showToast({
title: _data.msg,
icon: 'none'
});
}
},
complete: (res) => {
console.log(res)
}
})
this.filesList = files
this.getDeviceSn()
}
}
}

@ -120,7 +120,7 @@
this.form.latidute = this.locationInfo.latidute;
this.form.longidute = this.locationInfo.longidute;
}
this.getDeviceSn()
// this.getDeviceSn()
},
onLoad() {
uni.$on('mapData', (data) => {
@ -190,6 +190,43 @@
this.getDeviceSn(deviceId);
}else{
this.deviceSn = JSON.parse(res.data.rows[0].tags).mac;
let _arr = [];
this.voices.forEach(item => {
_arr.push({url:item});
})
let data = {
"alarmTypeIdentity": "700005",
"description": "语音上报",
"deviceSn": this.deviceSn,
"platformCode": "DIANXIN",
"pictureList": _arr
}
uni.request({
url: getApp().globalData.apiUrl + '/appData/escalation',
method: 'POST',
data: data,
success: (res) => {
let _data = JSON.parse(res.data.data);
if (_data.resultCode == 0) {
uni.showToast({
title: '成功',
success: () => {
uni.redirectTo({
url: '/pages/voiceRecord/list'
})
}
});
} else {
uni.showToast({
title: _data.msg,
icon: 'none'
});
}
},
fail: (err) => {
console.log(err)
}
})
}
},
fail: (err) => {
@ -366,43 +403,8 @@
// title:'deviceSn =============>' + this.deviceSn,
// icon:'none'
// })
let _arr = [];
this.voices.forEach(item => {
_arr.push({url:item});
})
let data = {
"alarmTypeIdentity": "700005",
"description": "语音上报",
"deviceSn": this.deviceSn,
"platformCode": "DIANXIN",
"pictureList": _arr
}
uni.request({
url: getApp().globalData.apiUrl + '/appData/escalation',
method: 'POST',
data: data,
success: (res) => {
let _data = JSON.parse(res.data.data);
if (_data.resultCode == 0) {
uni.showToast({
title: '成功',
success: () => {
uni.redirectTo({
url: '/pages/voiceRecord/list'
})
}
});
} else {
uni.showToast({
title: _data.msg,
icon: 'none'
});
}
},
fail: (err) => {
console.log(err)
}
})
this.getDeviceSn()
}
},
}

Loading…
Cancel
Save