diff --git a/api/6170/callPolice.js b/api/6170/callPolice.js
index cebbd97..88a5e01 100644
--- a/api/6170/callPolice.js
+++ b/api/6170/callPolice.js
@@ -2,7 +2,7 @@ import request from '@/utils/request'
//报警
export function deviceSendAlarmMessage(data) {
return request({
- url: '/app/device/sendAlarmMessage',
+ url: '/app/bjq/device/sendAlarmMessage',
method: 'post',
data: data
})
diff --git a/api/6170/deviceControl.js b/api/6170/deviceControl.js
index 75b1f25..e257231 100644
--- a/api/6170/deviceControl.js
+++ b/api/6170/deviceControl.js
@@ -2,7 +2,7 @@
import request from '@/utils/request'
export function deviceDetail(id) {
return request({
- url: `/app/device/${id}`,
+ url: `/app/bjq/device/${id}`,
method: 'get',
})
}
@@ -16,7 +16,7 @@ export function deviceShareId(id) {
// 人员信息登记
export function registerPersonInfo(data) {
return request({
- url: `/app/device/registerPersonInfo`,
+ url: `/app/bjq/device/registerPersonInfo`,
method: 'post',
data: data
})
@@ -24,7 +24,7 @@ export function registerPersonInfo(data) {
// 发送信息
export function deviceSendMessage(data) {
return request({
- url: `/app/device/sendMessage`,
+ url: `/app/bjq/device/sendMessage`,
method: 'post',
data: data
})
@@ -32,7 +32,7 @@ export function deviceSendMessage(data) {
// 灯光模式设置
export function lightModeSettings(data) {
return request({
- url: `/app/device/lightModeSettings`,
+ url: `/app/bjq/device/lightModeSettings`,
method: 'post',
data: data
})
@@ -40,7 +40,7 @@ export function lightModeSettings(data) {
// 激光模式设置
export function laserModeSettings(data) {
return request({
- url: `/app/device/laserModeSettings`,
+ url: `/app/bjq/device/laserModeSettings`,
method: 'post',
data: data
})
@@ -49,7 +49,7 @@ export function laserModeSettings(data) {
export function lightBrightnessSettings(data) {
return request({
- url: `/app/device/lightBrightnessSettings`,
+ url: `/app/bjq/device/lightBrightnessSettings`,
method: 'post',
data: data
})
@@ -57,7 +57,7 @@ export function lightBrightnessSettings(data) {
// 地图逆解析
export function mapReverseGeocoding(data) {
return request({
- url: `/app/device/mapReverseGeocoding`,
+ url: `/app/bjq/device/mapReverseGeocoding`,
method: 'post',
data: data
})
diff --git a/pages/6170/allShare/index.vue b/pages/6170/allShare/index.vue
index 024ce1b..91c9135 100644
--- a/pages/6170/allShare/index.vue
+++ b/pages/6170/allShare/index.vue
@@ -40,7 +40,12 @@
ID:{{item.deviceImei}}
- 在线
+
+ 在线
+
+ 离线
电量:{{item.battery || '0'}}%
@@ -67,7 +72,7 @@
+
+
@@ -273,14 +282,14 @@
lightBrightnessSettings, //灯光亮度设置
mapReverseGeocoding //地图逆解析
} from '@/api/6170/deviceControl.js'
- import {
- getDeviceId
- } from '../../../store/BLETools';
import {
baseURL,
getToken,
clientid
} from '@/utils/request'
+ import {
+ deviceSendAlarmMessage
+ } from '@/api/6170/callPolice.js'
export default {
data() {
return {
@@ -297,6 +306,7 @@
sliderValue: 25,
lightModeA: false,
currentMainMode: '强光',
+ currentlaserMode: "关闭",
lightModeB: false,
lightModeC: false, //激光提示框
items: [],
@@ -311,10 +321,7 @@
position: '',
code: '',
},
- deviceInfo: {
-
- },
-
+ deviceInfo: {},
activePermissions: [], // 存储当前设备的权限数组
isSharedDevice: false, // 标记是否来自分享
isRightIconVisible: false,
@@ -326,7 +333,24 @@
file: '',
selectedItemIndex: 0,
popupType: 'person', //弹框类型
- isLaserOn: false
+ isLaserOn: false,
+ // 进度条
+ Progress: {
+ show: false, //是否显示
+ height: '40rpx',
+ showMask: true, //是否显示mask
+ maskBgColor: 'rgba(0, 0, 0, 0.5)', // 半透明黑色遮罩
+ contentBgColor: 'rgba(18, 18, 18, 0.8)', // 主背景带透明度
+ showText: true, //是否显示当前进度的文字
+ txtColor: '#ffffffde', //文字的颜色
+ curr: 20, //当前进度
+ total: 100, //总进度
+ proBgColor: '#2a2a2a', //进度条底色,
+ proBorder: '', //进度条border
+ currBgColor: '#bbe600', //当前进度底色
+ currBorder: '', //当前进度border
+ borderRadius: '10rpx'
+ }
}
},
computed: {
@@ -448,7 +472,7 @@
this.sliderValue = value;
let data = {
- deviceId: this.deviceID,
+ deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
instructValue: this.sliderValue + '.00'
}
lightBrightnessSettings(data).then((res) => {
@@ -527,7 +551,7 @@
// 修正这里的赋值错误,应该保存索引而不是文本
this.selectedItemIndex = this.selectedItemIndex;
let data = {
- deviceId: this.deviceID,
+ deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
instructValue: selectedItem.instructValue
}
lightModeSettings(data).then((res) => {
@@ -551,9 +575,9 @@
},
// 激光确认框提交
handleBtn() {
- const instructValue = this.isLaserOn ? 0 : 1;
+ const instructValue = this.isLaserOn ? 0 : 1;
let data = {
- deviceId: this.deviceID,
+ deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
instructValue: instructValue
}
laserModeSettings(data).then((res) => {
@@ -562,7 +586,8 @@
icon: 'none',
title: res.msg
})
- this.isLaserOn = !this.isLaserOn;
+ this.isLaserOn = !this.isLaserOn;
+ this.currentlaserMode = this.isLaserOn ? "开启" : "关闭"; // 更新显示文本
this.lightModeC = false
} else {
uni.showToast({
@@ -622,18 +647,20 @@
});
return;
}
- // 显示上传中加载提示
- uni.showLoading({
- title: '上传中...',
- mask: true
- });
+ // 显示进度条
+ this.Progress = {
+ ...this.Progress,
+ show: true,
+ curr: 0,
+ showText: true
+ };
uni.uploadFile({
- url: baseURL + '/app/device/uploadLogo',
+ url: baseURL + '/app/bjq/device/uploadLogo',
filePath: this.selectedImage,
name: 'file',
formData: {
- deviceId: this.deviceID,
+ deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
},
header: {
'Authorization': 'Bearer ' + getToken(),
@@ -644,9 +671,6 @@
try {
const responseData = JSON.parse(res.data);
if (responseData.code === 200) {
- this.popupType = 'logo'; //弹框类型
- this.showPopupFlag = true;
- this.popupMessage = '上传成功';
this.selectedImage = '';
this.file = null;
this.lightModeB = false
@@ -661,6 +685,7 @@
title: '上传失败',
icon: 'none'
});
+ this.Progress.show = false; // 上传失败隐藏进度条
} finally {
uni.hideLoading();
}
@@ -684,20 +709,23 @@
// 操作说明
operatingInst() {
+ let id = this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId
uni.navigateTo({
- url: `/pages/common/operatingInstruct/index?id=${this.deviceID}`
+ url: `/pages/common/operatingInstruct/index?id=${id}`
})
},
// 产品参数
productparams() {
+ let id = this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId
uni.navigateTo({
- url: `/pages/common/productDes/index?id=${this.deviceID}`
+ url: `/pages/common/productDes/index?id=${id}`
})
},
// 操作视频
operatingVideo() {
+ let id = this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId
uni.navigateTo({
- url: `/pages/common/operationVideo/index?id=${this.deviceID}`
+ url: `/pages/common/operationVideo/index?id=${id}`
})
},
@@ -741,7 +769,7 @@
name: this.personnelInfo.name,
position: this.personnelInfo.position,
unitName: this.personnelInfo.unitName,
- deviceId: this.deviceID
+ deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
}
registerPersonInfo(data).then((res) => {
if (res.code == 200) {
@@ -761,6 +789,32 @@
this.showPopupFlag = false
console.log('用户点击了确定')
},
+ // 解除报警
+ onPopupConfirmPolice() {
+ let data = {
+ deviceIds: this.apiType === 'listA' ? [this.deviceID] : [this.itemInfo.deviceId],
+ instructValue: 0, // '解除报警'
+ }
+ deviceSendAlarmMessage(data).then((res) => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ });
+ this.showPopupFlag = false
+ setTimeout(() => {
+ this.fetchDeviceDetail(this.deviceID);
+ uni.$emit('deviceStatusUpdate', {});
+ }, 500)
+
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ });
+ }
+ });
+ },
// 发送文本消息
sendTextMessage() {
if (!this.messageToSend) {
@@ -776,7 +830,9 @@
})
let data = {
sendMsg: this.messageToSend,
- deviceIds: [this.deviceID]
+ //deviceIds: [this.deviceID],
+ deviceIds: this.apiType === 'listA' ? [this.deviceID] : [this.itemInfo.deviceId],
+
}
deviceSendMessage(data).then((res) => {
if (res.code == 200) {
@@ -892,7 +948,6 @@
setTimeout(() => {
this.fetchDeviceDetail(data.data.id);
}, 20000);
-
// 这里判断电量低于20%,弹框提示
if (this.deviceInfo.batteryPercentage < 20) {
this.popupType = 'bettery'
@@ -900,13 +955,32 @@
this.showPopupFlag = true;
}
}
+ // 处理上传照片进度消息
+ if (deviceState[0] === 3) {
+ const progress = deviceState[1];
+ // 更新进度条
+ this.Progress = {
+ ...this.Progress,
+ curr: progress * 2,
+ show: progress < 50 // 进度达到100时自动隐藏
+ };
+ // 当进度为100时显示成功弹框
+ if (progress === 50) {
+ this.popupType = 'logo';
+ this.popupMessage = '上传成功';
+ this.showPopupFlag = true;
+ this.lightModeB = false; // 关闭上传弹窗
+ this.selectedImage = ''; // 清空已选图片
+ }
+ }
});
});
if (this.apiType === 'listA') {
this.fetchDeviceDetail(data.data.id)
} else {
- this.fetchSharedDeviceDetail(data.data.deviceId)
+ // 查分享权限详情
+ this.fetchSharedDeviceDetail(data.data.id)
}
});
@@ -995,6 +1069,12 @@
height: 52rpx;
}
+ .chargeStateIMG {
+ width: 27rpx;
+ height: 37rpx;
+ margin-left: 10rpx;
+ }
+
.cpIMG {
width: 66rpx;
height: 66rpx;
diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue
index f9564ca..1edd3cb 100644
--- a/pages/common/index/index.vue
+++ b/pages/common/index/index.vue
@@ -542,7 +542,7 @@
});
// 监听设备状态更新事件
uni.$on('deviceStatusUpdate', (data) => {
- console.log('收到设备状态更新通知:', data);
+ console.log('列表收到消息了么');
this.onIntall()
});
},
diff --git a/static/images/common/chargeState.png b/static/images/common/chargeState.png
new file mode 100644
index 0000000..c892c64
Binary files /dev/null and b/static/images/common/chargeState.png differ
diff --git a/utils/request.js b/utils/request.js
index 375949b..a5f55e2 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -1,5 +1,5 @@
import config from '../config/index.js';
-const env = 'production'; //production development //开发of线上 改这里就行
+const env = 'development'; //production development //开发of线上 改这里就行
const BASE = config[env];
const request = (options) => {
console.log("options"+JSON.stringify(options),BASE.BASE_URL)