Compare commits
5 Commits
2f437e16b6
...
new-202508
Author | SHA1 | Date | |
---|---|---|---|
6ee45f6868 | |||
8108744d56 | |||
c537e17780 | |||
82ca470b2d | |||
49834be90d |
@ -2,11 +2,11 @@
|
|||||||
const config = {
|
const config = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
development: {
|
||||||
BASE_URL: 'http://192.168.110.54:8000',
|
BASE_URL: 'http://192.168.2.34:8000',
|
||||||
API_PREFIX: '',
|
API_PREFIX: '',
|
||||||
// MQTT 配置
|
// MQTT 配置
|
||||||
MQTT_HOST: '47.120.79.150',
|
MQTT_HOST: '47.120.79.150',
|
||||||
MQTT_PORT: 8083,
|
MQTT_PORT: 9083,
|
||||||
MQTT_USERNAME: 'admin',
|
MQTT_USERNAME: 'admin',
|
||||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||||
},
|
},
|
||||||
@ -16,7 +16,7 @@ const config = {
|
|||||||
API_PREFIX: '',
|
API_PREFIX: '',
|
||||||
// MQTT 配置
|
// MQTT 配置
|
||||||
MQTT_HOST: '47.120.79.150',
|
MQTT_HOST: '47.120.79.150',
|
||||||
MQTT_PORT: 8083,
|
MQTT_PORT: 9083,
|
||||||
MQTT_USERNAME: 'admin',
|
MQTT_USERNAME: 'admin',
|
||||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@
|
|||||||
const statusRes = await getdeviceSTatus({
|
const statusRes = await getdeviceSTatus({
|
||||||
functionMode: 2,
|
functionMode: 2,
|
||||||
batchId,
|
batchId,
|
||||||
typeName,
|
typeName:'FunctionAccessBatchStatusRule',
|
||||||
deviceImei,
|
deviceImei,
|
||||||
interval: 500
|
interval: 500
|
||||||
},
|
},
|
||||||
@ -236,7 +236,7 @@
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #1A1D24;
|
background-color:rgb(18, 18, 18);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
@ -280,7 +280,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.device-content {
|
.device-content {
|
||||||
background-color: rgba(30, 33, 40, 0.8);
|
background-color: rgb(26, 26, 26);
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
/* display: flex; */
|
/* display: flex; */
|
||||||
|
@ -545,15 +545,6 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 防重复提交
|
|
||||||
if (this.isProcessing) return;
|
|
||||||
let loadingShown = false;
|
|
||||||
uni.showLoading({
|
|
||||||
title: '处理中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
loadingShown = true;
|
|
||||||
this.isProcessing = true
|
|
||||||
if (this.selectedItemIndex === null) return;
|
if (this.selectedItemIndex === null) return;
|
||||||
const selectedItem = this.items[this.selectedItemIndex];
|
const selectedItem = this.items[this.selectedItemIndex];
|
||||||
let data = {
|
let data = {
|
||||||
@ -573,15 +564,15 @@
|
|||||||
})
|
})
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.lightModeA = false;
|
this.lightModeA = false;
|
||||||
this.isProcessing = false
|
//this.isProcessing = false
|
||||||
loadingShown = false
|
//loadingShown = false
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.isProcessing = false
|
//this.isProcessing = false
|
||||||
loadingShown = false
|
//loadingShown = false
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -599,15 +590,6 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 防重复提交
|
|
||||||
if (this.isProcessing) return;
|
|
||||||
let loadingShown = false;
|
|
||||||
uni.showLoading({
|
|
||||||
title: '处理中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
loadingShown = true;
|
|
||||||
this.isProcessing = true
|
|
||||||
const instructValue = this.isLaserOn ? 0 : 1;
|
const instructValue = this.isLaserOn ? 0 : 1;
|
||||||
let data = {
|
let data = {
|
||||||
deviceId: this.computedDeviceId,
|
deviceId: this.computedDeviceId,
|
||||||
@ -625,15 +607,11 @@
|
|||||||
this.isLaserOn = !this.isLaserOn;
|
this.isLaserOn = !this.isLaserOn;
|
||||||
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||||
this.lightModeC = false;
|
this.lightModeC = false;
|
||||||
this.isProcessing = false
|
|
||||||
loadingShown = false
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
this.isProcessing = false
|
|
||||||
loadingShown = false
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -725,12 +703,12 @@
|
|||||||
// 获取设备状态
|
// 获取设备状态
|
||||||
// 4. 获取设备状态
|
// 4. 获取设备状态
|
||||||
let deviceImei = this.itemInfo.deviceImei
|
let deviceImei = this.itemInfo.deviceImei
|
||||||
let typeName = this.itemInfo.typeName
|
//let typeName = this.itemInfo.typeName
|
||||||
let batchId = ''
|
let batchId = ''
|
||||||
const statusRes = await getdeviceSTatus({
|
const statusRes = await getdeviceSTatus({
|
||||||
functionMode: 1,
|
functionMode: 1,
|
||||||
batchId,
|
batchId,
|
||||||
typeName,
|
typeName: 'FunctionAccessStatusRule',
|
||||||
deviceImei,
|
deviceImei,
|
||||||
interval: 800
|
interval: 800
|
||||||
},
|
},
|
||||||
@ -907,13 +885,13 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 4. 获取设备状态
|
// 4. 获取设备状态FunctionAccessBatchStatusRule 批量
|
||||||
let deviceImei = this.itemInfo.deviceImei
|
let deviceImei = this.itemInfo.deviceImei
|
||||||
let typeName = this.itemInfo.typeName
|
let typeName = this.itemInfo.typeName
|
||||||
const statusRes = await getdeviceSTatus({
|
const statusRes = await getdeviceSTatus({
|
||||||
functionMode: 2,
|
functionMode: 2,
|
||||||
batchId,
|
batchId,
|
||||||
typeName,
|
typeName: 'FunctionAccessBatchStatusRule',
|
||||||
deviceImei,
|
deviceImei,
|
||||||
interval: 500
|
interval: 500
|
||||||
},
|
},
|
||||||
@ -991,11 +969,11 @@
|
|||||||
}
|
}
|
||||||
// 4. 获取设备状态
|
// 4. 获取设备状态
|
||||||
let deviceImei = this.itemInfo.deviceImei
|
let deviceImei = this.itemInfo.deviceImei
|
||||||
let typeName = this.itemInfo.typeName
|
//let typeName = this.itemInfo.typeName
|
||||||
const statusRes = await getdeviceSTatus({
|
const statusRes = await getdeviceSTatus({
|
||||||
functionMode: 2,
|
functionMode: 2,
|
||||||
batchId,
|
batchId,
|
||||||
typeName,
|
typeName: 'FunctionAccessBatchStatusRule',
|
||||||
deviceImei,
|
deviceImei,
|
||||||
interval: 500
|
interval: 500
|
||||||
},
|
},
|
||||||
@ -1187,16 +1165,15 @@
|
|||||||
case 12:
|
case 12:
|
||||||
this.currentMainMode = this.getMainLightModeLabel(deviceState[
|
this.currentMainMode = this.getMainLightModeLabel(deviceState[
|
||||||
1]);
|
1]);
|
||||||
this.isLaserOn = deviceState[2] === 1;
|
this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位
|
||||||
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||||
if (this.deviceInfo) {
|
if (this.deviceInfo) {
|
||||||
this.deviceInfo.batteryPercentage = deviceState[3];
|
this.deviceInfo.batteryPercentage = deviceState[3]; //第4位电量百分比
|
||||||
this.deviceInfo.chargeState = deviceState[4];
|
this.deviceInfo.chargeState = deviceState[4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满)
|
||||||
this.deviceInfo.batteryRemainingTime = deviceState[5];
|
this.deviceInfo.batteryRemainingTime = deviceState[5]; //第6位200代表电池剩余续航时间200分钟
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.deviceInfo.batteryPercentage <
|
if (this.deviceInfo.batteryPercentage <20 && this.deviceInfo.chargeState == 0) {
|
||||||
20) {
|
|
||||||
this.popupType = 'bettery';
|
this.popupType = 'bettery';
|
||||||
this.popupMessage = '请及时充电';
|
this.popupMessage = '请及时充电';
|
||||||
this.showPopupFlag = true;
|
this.showPopupFlag = true;
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showView: false,
|
showView: false,
|
||||||
phone: '17671332251', //手机号码
|
phone: '13800138002', //手机号码
|
||||||
code: "123456", //验证码
|
code: "123456", //验证码
|
||||||
agreed: false,
|
agreed: false,
|
||||||
isCounting: false,
|
isCounting: false,
|
||||||
|
@ -157,7 +157,7 @@ export default {
|
|||||||
const statusRes = await getdeviceSTatus({
|
const statusRes = await getdeviceSTatus({
|
||||||
functionMode: 2,
|
functionMode: 2,
|
||||||
batchId,
|
batchId,
|
||||||
typeName,
|
typeName:'FunctionAccessBatchStatusRule',
|
||||||
deviceImei,
|
deviceImei,
|
||||||
interval: 500
|
interval: 500
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<image src="/static/images/common/logo.png" class="logo"></image>
|
<image src="/static/images/common/logo.png" class="logo"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-right">
|
<view class="user-right">
|
||||||
<view class="user-title">富源晟科技</view>
|
<view class="user-title">武汉星汉</view>
|
||||||
<view class="ID">ID:123456</view>
|
<view class="ID">ID:123456</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -119,9 +119,8 @@ import Paho from 'paho-mqtt';
|
|||||||
import allConfigs from '../config/index.js';
|
import allConfigs from '../config/index.js';
|
||||||
|
|
||||||
// 根据环境选择正确的配置
|
// 根据环境选择正确的配置
|
||||||
const env = 'development'; //production //开发of线上 改这里就行
|
const env = 'production'; //production //开发of线上 改这里就行
|
||||||
const config = allConfigs[env];
|
const config = allConfigs[env];
|
||||||
|
|
||||||
class MqttClient {
|
class MqttClient {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.client = null;
|
this.client = null;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import config from '../config/index.js';
|
import config from '../config/index.js';
|
||||||
const env = 'development'; //production development //开发of线上 改这里就行
|
const env = 'production'; //production development //开发of线上 改这里就行
|
||||||
const BASE = config[env];
|
const BASE = config[env];
|
||||||
const request = (options) => {
|
const request = (options) => {
|
||||||
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
|
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
|
||||||
|
Reference in New Issue
Block a user