diff --git a/api/6075/6075.js b/api/6075/6075.js new file mode 100644 index 0000000..2c20546 --- /dev/null +++ b/api/6075/6075.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' +export function deviceDetail(id) { + return request({ + url: `/app/bjq6075/device/${id}`, + method: 'get', + }) +} +// 获取设备分享详细信息 +export function deviceShareId(id) { + return request({ + url: `/app/bjq6075/device/getShareInfo/${id}`, + method: 'get', + }) +} +// 人员信息登记 +export function registerPersonInfo(data) { + return request({ + url: `/app/bjq6075/device/registerPersonInfo`, + method: 'post', + data: data + }) +} +// 发送信息 +export function deviceSendMessage(data) { + return request({ + url: `/app/bjq6075/device/sendMessage`, + method: 'post', + data: data + }) +} +// 灯光模式设置 +export function lightModeSettings(data) { + return request({ + url: `/app/bjq6075/device/lightModeSettings`, + method: 'post', + data: data + }) +} +// 激光模式设置 +export function laserModeSettings(data) { + return request({ + url: `/app/bjq6075/device/laserModeSettings`, + method: 'post', + data: data + }) +} +// 灯光亮度设置 +export function lightBrightnessSettings(data) { + return request({ + url: `/app/bjq6075/device/lightBrightnessSettings`, + method: 'post', + data: data + }) +} +// 地图逆解析 +export function mapReverseGeocoding(data) { + return request({ + url: `/app/bjq6075/device/mapReverseGeocoding`, + method: 'post', + data: data + }) +} diff --git a/config/index.js b/config/index.js index dfb50b2..a4c0eeb 100644 --- a/config/index.js +++ b/config/index.js @@ -2,7 +2,7 @@ const config = { // 开发环境 development: { - BASE_URL: 'http://192.168.110.56:8000', + BASE_URL: 'http://192.168.2.23:8000', API_PREFIX: '', // MQTT 配置 MQTT_HOST: 'www.cnxhyc.com', diff --git a/pages/6075/BJQ6075.vue b/pages/6075/BJQ6075.vue index 121307b..146bf60 100644 --- a/pages/6075/BJQ6075.vue +++ b/pages/6075/BJQ6075.vue @@ -8,7 +8,7 @@ + ]" @icon-click="handleIconClick"> @@ -40,28 +40,29 @@ IMEI号 - 123488756 + {{deviceInfo.deviceImei}} 设备状态 - 运行中 + {{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }} 定位信息 - 114.72 30.28 + {{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }} + {{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }} - 深圳市龙华区富源晟 + {{ deviceInfo.address || '/'}} - 海拔高度 2666m - 相对高度123m + 海拔高度 {{deviceInfo.altitude}}m + 相对高度{{deviceInfo.relativeAltitude}}m @@ -95,11 +96,11 @@ - + 声光报警 - {{ currentMainMode }} + @@ -180,11 +181,10 @@ - {{ popupTitle }} - + {{ item.text }} @@ -259,7 +259,6 @@ confirm() { return true; // 直接关闭 } - }, // 上传开机log logo: { @@ -285,10 +284,22 @@ showCancel: true }, confirm() { - return true; // 直接关闭 + return true; } }, - + // 声光报警 + audibleAlarm: { + config: { + icon: '/static/images/210/bj_1.png', + message: '确定开启设备声光报警?', + confirmBtnBg: 'rgba(255, 200, 78, 1)', + popupBorder:'1rpx solid rgba(255, 200, 78, 0.3)', + showCancel: true + }, + confirm() { + return true; + } + } } import MqttClient from '@/utils/mqtt.js'; @@ -300,7 +311,7 @@ lightModeSettings, //灯光模式设置 laserModeSettings, //激光模式设置 mapReverseGeocoding //地图逆解析 - } from '@/api/6170/deviceControl.js' + } from '@/api/6075/6075.js' import { baseURL, getToken, @@ -318,7 +329,10 @@ }, currentMainMode: '强光', // 主灯当前模式 currentSubMode: '泛光', // 辅灯当前模式 - lightModeC:false, + currentlaserMode: '关闭', + isLaserOn: false, + popupTitle: '', + lightModeC: false, pageLoading: true, mainMode: 'string', secondaryMode: 'string', @@ -357,9 +371,6 @@ computedDeviceId() { return this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId; }, - popupTitle() { - return this.modeType === 'main' ? '主灯模式' : '辅灯模式'; - } }, methods: { // 点击弹框外的区域关闭 @@ -399,15 +410,6 @@ case 1: this.uploadStartup(); break; - case 2: - this.automaticAlarm(); - break; - case 3: - this.manualAlarm(); - break; - case 5: - this.alarmTime(); - break; } }, @@ -426,11 +428,23 @@ lasermode() { this.lightModeC = true }, + // 声光报警 + audible() { + this.showPopup('audibleAlarm'); + }, + handleDisagree() { + this.lightModeC = false + }, + // 取消按钮 + handleBtn() { + this.lightModeC = false + }, // 主灯模式 selectMode(type) { this.modeType = type; this.lightModeA = true; if (type === 'main') { + this.popupTitle = '主灯模式' this.items = [{ text: '强光', selected: this.currentMainMode === '强光', // 修正匹配条件 @@ -477,33 +491,34 @@ ]; // 辅灯 } else if (type === 'sub') { + this.popupTitle = '辅灯模式' this.items = [{ text: '泛光', - selected: this.currentMainMode === '泛光', // 修正匹配条件 + selected: this.currentSubMode === '泛光', // 修正匹配条件 image: '/static/images/6075/fg.png', instructValue: '1' }, { text: '泛光爆闪', - selected: this.currentMainMode === '泛光爆闪', + selected: this.currentSubMode === '泛光爆闪', image: '/static/images/6075/fg.png', instructValue: '2' }, { text: '警示灯', - selected: this.currentMainMode === '警示灯', + selected: this.currentSubMode === '警示灯', image: '/static/images/6075/jsg.png', instructValue: '3' }, { text: '警示灯/泛光', - selected: this.currentMainMode === '警示灯/泛光', + selected: this.currentSubMode === '警示灯/泛光', image: '/static/images/6075/jsg.png', instructValue: '4' }, { text: '关闭灯光', - selected: this.currentMainMode === '关闭灯光', + selected: this.currentSubMode === '关闭灯光', image: '/static/images/6170/close.png', instructValue: '0', } @@ -515,6 +530,25 @@ toggleForm() { this.isFormExpanded = !this.isFormExpanded; }, + onItemClick(index) { + console.log(index, 'index'); + const item = this.items[index]; + this.selectedItemIndex = index; + this.items = this.items.map((item, i) => ({ + ...item, + selected: i === index + })); + this.pendingMainMode = item.text; + // 主灯 + this.currentMainMode = item.text; + // 辅灯 + this.currentSubMode = item.text; + + }, + // 灯光模式的确认 + handleSumbit() { + this.lightModeA = false + }, // 上传开机画面 uploadStartup() { this.lightModeB = true @@ -538,17 +572,21 @@ }); return; } - this.selectedImage = res.tempFilePaths[0]; - console.log('选择的图片:', res); - //this.file = res.tempFiles[0].file - }, - fail: (err) => { - console.error('选择图片失败:', err); - uni.showToast({ - title: '选择图片失败', - icon: 'none' + let that = this; + uni.navigateTo({ + url: "/pages/6155/ImgCrop", + events: { + ImgCutOverPath: function(data) { + that.selectedImage = data.picPath; + } + }, + success(ev) { + ev.eventChannel.emit('checkImg', { + data: res.tempFiles[0].path, + }); + } }); - } + }, }); }, // 上传开机画面确认按键 @@ -618,7 +656,7 @@ // 历史记录 if (index === 0) { uni.navigateTo({ - url: '/pages/210/historyRecords/index', + url: '/pages/670/History', events: { ack: function(data) {} }, @@ -630,24 +668,22 @@ }) } else { uni.navigateTo({ - url: '/pages/6170/share/index', + url: '/pages/common/share/index', events: { ack: function(data) {} }, success: (res) => { + let json = { + persissonType: '670' + }; + Object.assign(json, this.device); res.eventChannel.emit('share', { - data: this.itemInfo, + data: json }); } }) } }, - - // 分享 - shareUp() { - - }, - // 操作说明 operatingInst() { uni.navigateTo({ diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 120cf2c..fed16ce 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -802,7 +802,6 @@ ack: function(data) {} }, success: (res) => { - debugger; let json = { persissonType: '670' }; diff --git a/pages/common/login/index.vue b/pages/common/login/index.vue index aa2ee4b..df87d80 100644 --- a/pages/common/login/index.vue +++ b/pages/common/login/index.vue @@ -1,7 +1,7 @@