|
|
|
@ -79,6 +79,17 @@ |
|
|
|
uni.$off('mapData'); |
|
|
|
uni.$off('mapData'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
|
|
|
|
uni.$on('mapData',(data) => { |
|
|
|
|
|
|
|
let obj = JSON.parse(data.data[0].detail); |
|
|
|
|
|
|
|
console.log('监听到事件来自返回的参数:', obj); |
|
|
|
|
|
|
|
this.position = obj; |
|
|
|
|
|
|
|
this.form.buildId = obj.buildId; |
|
|
|
|
|
|
|
if(obj.floorNo) { |
|
|
|
|
|
|
|
this.form.floorNo = obj.floorNo > 3 ? obj.floorNo - 3 : obj.floorNo > 0 && obj.floorNo <= 3 ? obj.floorNo - 4 : obj.floorNo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.form.latidute = obj.y; |
|
|
|
|
|
|
|
this.form.longidute = obj.x; |
|
|
|
|
|
|
|
}) |
|
|
|
let userInfo = uni.getStorageSync('mobileInfo'); |
|
|
|
let userInfo = uni.getStorageSync('mobileInfo'); |
|
|
|
let locationInfo = uni.getStorageSync('locationInfo'); |
|
|
|
let locationInfo = uni.getStorageSync('locationInfo'); |
|
|
|
if (userInfo) { |
|
|
|
if (userInfo) { |
|
|
|
@ -98,15 +109,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
onLoad() { |
|
|
|
uni.$on('mapData', (data) => { |
|
|
|
|
|
|
|
let obj = JSON.parse(data.data[0].detail); |
|
|
|
|
|
|
|
console.log('监听到事件来自返回的参数:', obj); |
|
|
|
|
|
|
|
this.position = obj; |
|
|
|
|
|
|
|
this.form.buildId = obj.buildId; |
|
|
|
|
|
|
|
this.form.floorNo = obj.floorNo && obj.floorNo > 3 ? obj.floorNo - 3 : obj.floorNo && obj.floorNo < 4 ? obj.floorNo - 4 : ''; |
|
|
|
|
|
|
|
this.form.latidute = obj.y; |
|
|
|
|
|
|
|
this.form.longidute = obj.x; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.queryPlanTypeList(); |
|
|
|
this.queryPlanTypeList(); |
|
|
|
// this.getDeviceSn() |
|
|
|
// this.getDeviceSn() |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -248,9 +250,14 @@ |
|
|
|
''; |
|
|
|
''; |
|
|
|
let floorNo = ''; |
|
|
|
let floorNo = ''; |
|
|
|
if(this.positionType == 1) { |
|
|
|
if(this.positionType == 1) { |
|
|
|
floorNo = this.locationInfo.floorNo; |
|
|
|
floorNo = this.locationInfo.floorNo ? this.locationInfo.floorNo : ''; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
floorNo = this.position.floorNo && this.position.floorNo > 3 ? this.position.floorNo - 3 : this.position.floorNo && this.position.floorNo < 4 ? this.position.floorNo - 4 : ''; |
|
|
|
if(this.position && this.position.floorNo) { |
|
|
|
|
|
|
|
floorNo = this.position.floorNo > 3 ? this.position.floorNo - 3 : this.position.floorNo > 0 && this.position.floorNo <= 3 ? this.position.floorNo - 4 : this.position.floorNo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
floorNo = ''; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.form.floorNo = floorNo; |
|
|
|
this.form.floorNo = floorNo; |
|
|
|
this.form.latidute = this.positionType == 1 ? this.locationInfo.latidute : this.position ? this.position.y : ''; |
|
|
|
this.form.latidute = this.positionType == 1 ? this.locationInfo.latidute : this.position ? this.position.y : ''; |
|
|
|
@ -266,6 +273,10 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '请求中' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
console.log(this.photoList) |
|
|
|
uni.uploadFile({ |
|
|
|
uni.uploadFile({ |
|
|
|
url: getApp().globalData.apiUrl + '/appData/putFile', |
|
|
|
url: getApp().globalData.apiUrl + '/appData/putFile', |
|
|
|
files: this.photoList, |
|
|
|
files: this.photoList, |
|
|
|
@ -287,6 +298,11 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
fail: (err) => { |
|
|
|
console.log(err) |
|
|
|
console.log(err) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
complete: () => { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
}, 2000) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
@ -311,12 +327,12 @@ |
|
|
|
let fileList = []; |
|
|
|
let fileList = []; |
|
|
|
res.tempFiles.forEach((item, index) => { |
|
|
|
res.tempFiles.forEach((item, index) => { |
|
|
|
fileList.push({ |
|
|
|
fileList.push({ |
|
|
|
name: 'file' + index, |
|
|
|
name: 'file' + (new Date().getTime()) + '_' + index, |
|
|
|
uri: res.tempFilePaths[index], |
|
|
|
uri: res.tempFilePaths[index], |
|
|
|
file: item |
|
|
|
file: item |
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.photoList = this.photoList.concat(fileList) |
|
|
|
this.photoList = this.photoList.concat(fileList); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|