6170控制设备接口,添加参数imei

This commit is contained in:
fengerli
2025-08-11 11:24:21 +08:00
parent b78ec21152
commit d8edb9f31e
3 changed files with 140 additions and 7 deletions

View File

@ -70,7 +70,7 @@
</view>
</view>
<!-- 灯光模式选择 -->
<view class="mode-section">
<!-- <view class="mode-section">
<view class="mode-buttons">
<view class="mode-v1">
<view class="mode-v2" @click="selectMode">
@ -125,6 +125,20 @@
</view>
</view>
</view> -->
<view class="mode-section">
<view class="mode-buttons">
<view v-for="(item, index) in modeItems" :key="index" class="mode-v1" :class="{ 'active-mode': selectedIndex === index }">
<view class="mode-v2"
@click="handleModeClick(index)">
<image :src="item.image" class="setIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">{{ item.title }}</view>
<view class="mode-v3" v-if="item.subTitle">{{ item.subTitle }}</view>
</view>
</view>
</view>
</view>
</view>
<!-- 人员信息登记 -->
@ -335,6 +349,38 @@
export default {
data() {
return {
selectedIndex: -1, // Track currently selected index
modeItems: [{
image: "/static/images/210/lj.png",
title: "联机设备",
subTitle: ""
},
{
image: "/static/images/common/path7.png",
title: "开机画面",
subTitle: "上传"
},
{
image: "/static/images/210/zd.png",
title: "自动报警",
subTitle: ""
},
{
image: "/static/images/210/zd-HL.png",
title: "手动报警",
subTitle: ""
},
{
image: "/static/images/210/bj.png",
title: "报警声音",
subTitle: "上传"
},
{
image: "/static/images/210/time.png",
title: "报警时长",
subTitle: "30秒"
}
],
currentPopup: {
show: false,
config: {},
@ -402,8 +448,28 @@
handleCancel() {
this.currentPopup.show = false;
},
handleModeClick(index) {
this.selectedIndex = index;
switch (index) {
case 0:
this.selectMode();
break;
case 1:
this.uploadStartup();
break;
case 2:
this.automaticAlarm();
break;
case 3:
this.manualAlarm();
break;
case 5:
this.alarmTime();
break;
}
},
// 手动报警
anualAlarm() {
manualAlarm() {
this.showPopup('del');
},
handleRadioSelect(index) {
@ -538,8 +604,9 @@
saveAlarmTime() {
const time = this.$refs.timePicker.getCurrentTime();
this.alarmTimeDisplay = `${time.minutes}${time.seconds}`;
this.modeItems[5].subTitle = this.alarmTimeDisplay; // 手动更新 modeItems
this.lightModeA = false;
console.log("保存的时间:", time);
// console.log("保存的时间:", time);
},
handleIconClick(index) {
// 历史记录
@ -813,6 +880,18 @@
align-items: center;
}
.mode-v1.active-mode {
border: 2rpx solid #BBE600 !important;
border-radius: 12rpx;
}
.mode-v1.active-mode .battery-v2 {
color: #BBE600 !important;
}
.mode-v1.active-mode .mode-v3{
color: #BBE600 !important;
}
.battery-info,
.duration {
display: flex;

View File

@ -8,6 +8,16 @@
</view>
</view>
</scroll-view>
<scroll-view class="content-list" scroll-y="true">
<view class="record-item" v-for="item in recodesInfo" :key="item.index">
<view class="record-details">
<text class="detail-time">开机时间</text>
<text class="detail-line">2026.08.29 21:13:58</text>
<text class="detail-line">关机时间</text>
<text class="detail-time">2025.06.30 00:45:20</text>
</view>
</view>
</scroll-view>
</view>
</template>
@ -23,6 +33,7 @@
},
],
activeTab: 0,
recodesInfo: [{}]
}
},
methods: {
@ -68,4 +79,42 @@
border-bottom: 6rpx solid rgba(187, 230, 0, 1);
height: 60rpx;
}
.content-list {
height: calc(100vh - 300rpx);
}
.record-item {
display: flex;
margin-bottom: 20rpx;
background: rgba(26, 26, 26, 1);
border-radius: 18rpx;
padding: 20rpx;
}
.record-details {
flex: 1;
}
.detail-line {
display: block;
font-size: 28rpx;
margin-bottom: 10rpx;
color: rgba(255, 255, 255, 0.87);
font-size: 24rpx;
line-height: 40rpx;
}
.detail-time {
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
}
.time-display {
position: absolute;
top: 30rpx;
right: 30rpx;
font-size: 28rpx;
color: #BBE600;
}
</style>

View File

@ -484,7 +484,8 @@
let data = {
deviceId: this.deviceID,
instructValue: this.sliderValue + '.00'
instructValue: this.sliderValue + '.00',
deviceImei:this.itemInfo.deviceImei
}
lightBrightnessSettings(data).then((res) => {
if (res.code !== 200) {
@ -502,7 +503,8 @@
let data = {
deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
instructValue: this.sliderValue + '.00'
instructValue: this.sliderValue + '.00',
deviceImei:this.itemInfo.deviceImei
}
lightBrightnessSettings(data).then((res) => {
if (res.code == 200) {
@ -581,7 +583,8 @@
this.selectedItemIndex = this.selectedItemIndex;
let data = {
deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
instructValue: selectedItem.instructValue
instructValue: selectedItem.instructValue,
deviceImei:this.itemInfo.deviceImei
}
lightModeSettings(data).then((res) => {
if (res.code == 200) {
@ -607,7 +610,8 @@
const instructValue = this.isLaserOn ? 0 : 1;
let data = {
deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
instructValue: instructValue
instructValue: instructValue,
deviceImei:this.itemInfo.deviceImei
}
laserModeSettings(data).then((res) => {
if (res.code == 200) {
@ -690,6 +694,7 @@
name: 'file',
formData: {
deviceId: this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId,
deviceImei:this.itemInfo.deviceImei
},
header: {
'Authorization': 'Bearer ' + getToken(),