From 813998dee2af2b94adc6a1ab739064cd66f3083a Mon Sep 17 00:00:00 2001 From: jinna Date: Fri, 15 Dec 2023 16:34:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=AD=E9=9F=B3=E3=80=81?= =?UTF-8?q?=E5=B7=A1=E6=9B=B4=E4=B8=8A=E6=8A=A5=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/patrolRecord/report.vue | 97 +++++++++++++++-------------------- pages/voiceRecord/report.vue | 78 ++++++++++++++-------------- 2 files changed, 81 insertions(+), 94 deletions(-) diff --git a/pages/patrolRecord/report.vue b/pages/patrolRecord/report.vue index ec082d3..12873d3 100644 --- a/pages/patrolRecord/report.vue +++ b/pages/patrolRecord/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() } } } diff --git a/pages/voiceRecord/report.vue b/pages/voiceRecord/report.vue index 1aee60b..c23cc00 100644 --- a/pages/voiceRecord/report.vue +++ b/pages/voiceRecord/report.vue @@ -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() + } }, }