|
|
|
@ -18,14 +18,20 @@
|
|
|
|
|
<view class="battery-v1">
|
|
|
|
|
<image src="/static/images/common/dl.png" class="dlIMG"></image>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="battery-v2">{{deviceInfo.batteryPercentage}}%</view>
|
|
|
|
|
<view class="battery-v2"
|
|
|
|
|
:style="{color: deviceInfo.batteryPercentage < 20 ? '#FF0000' : ''}">
|
|
|
|
|
{{deviceInfo.batteryPercentage}}%
|
|
|
|
|
</view>
|
|
|
|
|
<view class="battery-v3">电量</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="deviceInfo.chargeState==1">
|
|
|
|
|
<image src="/static/images/common/chargeState.png" class="chargeStateIMG"></image>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="battery-v1">
|
|
|
|
|
<image src="/static/images/common/nz.png" class="dlIMG" mode="aspectFit"></image>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="battery-v2">{{deviceInfo.batteryRemainingTime || '0分钟'}}分钟</view>
|
|
|
|
|
<view class="battery-v2">{{deviceInfo.batteryRemainingTime || '0'}}分钟</view>
|
|
|
|
|
<view class="battery-v3">续航时间</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
@ -101,6 +107,7 @@
|
|
|
|
|
<image src="/static/images/6170/jg.png" class="setIMG" mode="aspectFit"></image>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="battery-v2">激光模式</view>
|
|
|
|
|
<view class="mode-v3">{{currentlaserMode}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
@ -256,8 +263,10 @@
|
|
|
|
|
<CustomPopup v-if="popupType === 'cancel'" :show="showPopupFlag"
|
|
|
|
|
popupBorder="1rpx solid rgba(224, 52, 52, 0.3)" :message="popupMessage"
|
|
|
|
|
icon="/static/images/6170/svg.png" :confirm-text="popupConfirmText" :show-cancel="false"
|
|
|
|
|
@confirm="onPopupConfirm" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
|
|
|
|
|
@confirm="onPopupConfirmPolice" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
|
|
|
|
|
</view>
|
|
|
|
|
<!-- ===============进度条============== -->
|
|
|
|
|
<Progress :config="Progress"></Progress>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -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;
|
|
|
|
|