1
0
forked from dyf/APP

Compare commits

..

10 Commits

10 changed files with 54 additions and 60 deletions

View File

@ -2,11 +2,11 @@
const config = {
// 开发环境
development: {
BASE_URL: 'http://192.168.110.54:8000',
BASE_URL: 'http://192.168.2.34:8000',
API_PREFIX: '',
// MQTT 配置
MQTT_HOST: '47.120.79.150',
MQTT_PORT: 8083,
MQTT_PORT: 9083,
MQTT_USERNAME: 'admin',
MQTT_PASSWORD: '#YtvpSfCNG'
},
@ -16,7 +16,7 @@ const config = {
API_PREFIX: '',
// MQTT 配置
MQTT_HOST: '47.120.79.150',
MQTT_PORT: 8083,
MQTT_PORT: 9083,
MQTT_USERNAME: 'admin',
MQTT_PASSWORD: '#YtvpSfCNG'
}

View File

@ -188,7 +188,7 @@
const statusRes = await getdeviceSTatus({
functionMode: 2,
batchId,
typeName,
typeName:'FunctionAccessBatchStatusRule',
deviceImei,
interval: 500
},
@ -236,7 +236,7 @@
<style scoped>
.container {
min-height: 100vh;
background-color: #1A1D24;
background-color:rgb(18, 18, 18);
box-sizing: border-box;
overflow-x: hidden;
@ -280,7 +280,7 @@
}
.device-content {
background-color: rgba(30, 33, 40, 0.8);
background-color: rgb(26, 26, 26);
border-radius: 16rpx;
position: relative;
/* display: flex; */

View File

@ -545,15 +545,6 @@
});
return;
}
// 防重复提交
if (this.isProcessing) return;
let loadingShown = false;
uni.showLoading({
title: '处理中...',
mask: true
});
loadingShown = true;
this.isProcessing = true
if (this.selectedItemIndex === null) return;
const selectedItem = this.items[this.selectedItemIndex];
let data = {
@ -573,15 +564,15 @@
})
uni.hideLoading();
this.lightModeA = false;
this.isProcessing = false
loadingShown = false
//this.isProcessing = false
//loadingShown = false
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
this.isProcessing = false
loadingShown = false
//this.isProcessing = false
//loadingShown = false
uni.hideLoading();
}
})
@ -599,15 +590,6 @@
});
return;
}
// 防重复提交
if (this.isProcessing) return;
let loadingShown = false;
uni.showLoading({
title: '处理中...',
mask: true
});
loadingShown = true;
this.isProcessing = true
const instructValue = this.isLaserOn ? 0 : 1;
let data = {
deviceId: this.computedDeviceId,
@ -625,15 +607,11 @@
this.isLaserOn = !this.isLaserOn;
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
this.lightModeC = false;
this.isProcessing = false
loadingShown = false
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
this.isProcessing = false
loadingShown = false
}
})
},
@ -725,12 +703,12 @@
// 获取设备状态
// 4. 获取设备状态
let deviceImei = this.itemInfo.deviceImei
let typeName = this.itemInfo.typeName
//let typeName = this.itemInfo.typeName
let batchId = ''
const statusRes = await getdeviceSTatus({
functionMode: 1,
batchId,
typeName,
typeName: 'FunctionAccessStatusRule',
deviceImei,
interval: 800
},
@ -907,13 +885,13 @@
})
return
}
// 4. 获取设备状态
// 4. 获取设备状态FunctionAccessBatchStatusRule 批量
let deviceImei = this.itemInfo.deviceImei
let typeName = this.itemInfo.typeName
const statusRes = await getdeviceSTatus({
functionMode: 2,
batchId,
typeName,
typeName: 'FunctionAccessBatchStatusRule',
deviceImei,
interval: 500
},
@ -991,11 +969,11 @@
}
// 4. 获取设备状态
let deviceImei = this.itemInfo.deviceImei
let typeName = this.itemInfo.typeName
//let typeName = this.itemInfo.typeName
const statusRes = await getdeviceSTatus({
functionMode: 2,
batchId,
typeName,
typeName: 'FunctionAccessBatchStatusRule',
deviceImei,
interval: 500
},
@ -1187,16 +1165,15 @@
case 12:
this.currentMainMode = this.getMainLightModeLabel(deviceState[
1]);
this.isLaserOn = deviceState[2] === 1;
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
if (this.deviceInfo) {
this.deviceInfo.batteryPercentage = deviceState[3];
this.deviceInfo.chargeState = deviceState[4];
this.deviceInfo.batteryRemainingTime = deviceState[5];
this.deviceInfo.batteryPercentage = deviceState[3]; //第4位电量百分比
this.deviceInfo.chargeState = deviceState[4]; //第5位为充电状态0没有充电1正在充电2为已充满
this.deviceInfo.batteryRemainingTime = deviceState[5]; //第6位200代表电池剩余续航时间200分钟
}
setTimeout(() => {
if (this.deviceInfo.batteryPercentage <
20) {
if (this.deviceInfo.batteryPercentage <20 && this.deviceInfo.chargeState == 0) {
this.popupType = 'bettery';
this.popupMessage = '请及时充电';
this.showPopupFlag = true;
@ -1648,7 +1625,7 @@
/* 弹窗主体 */
.agreement-popup {
width: 100%;
height: 50%;
/* height: 50%; */
background-color: rgb(42, 42, 42);
border-radius: 60rpx 60rpx 0rpx 0rpx;
padding: 40rpx;

View File

@ -629,7 +629,7 @@
receiveData.modeCurr = staticLevelText;
receiveData.lightCurr = lightingLevelText;
receiveData.xuhang = json.sta_PowerTime + "分钟";
receiveData.battary = json.sta_PowerPercent + "%";
receiveData.battary = json.sta_PowerPercent ;
receiveData.warnLevel = warn;
receiveData.staticWarn = staticWarn;
@ -892,6 +892,7 @@
}
if(!ispop){
closeEvt();
return;
}
this.showPop({
showHeader: true,
@ -1686,6 +1687,8 @@
showPop: function(option) {
hideLoading(this);
let defaultCfg = {
showHeader: false,
headerTxt: "",
showHeader: false,
showCancel: false,
borderColor: '#BBE600',

View File

@ -60,7 +60,7 @@
data() {
return {
showView: false,
phone: '17671332251', //手机号码
phone: '13800138002', //手机号码
code: "123456", //验证码
agreed: false,
isCounting: false,

View File

@ -86,14 +86,29 @@
} catch (error) {}
}
},
},
onLoad(options) {
if (options.deviceId) {
this.deviceId = decodeURIComponent(options.deviceId);
} else {
this.deviceId = '未获取到设备ID';
}
},
// 处理返回键
onBackPress() {
// 如果绑定成功了,返回时也要刷新首页
if (this.isSuccess) {
uni.$emit('refreshDeviceList');
}
return false; // 允许正常返回
},
// 页面卸载时处理
onUnload() {
// 如果绑定成功了,卸载时也要刷新首页
if (this.isSuccess) {
uni.$emit('refreshDeviceList');
}
},
onLoad(options) {
if (options.deviceId) {
this.deviceId = decodeURIComponent(options.deviceId);
} else {
this.deviceId = '未获取到设备ID';
}
}
}
</script>

View File

@ -157,7 +157,7 @@ export default {
const statusRes = await getdeviceSTatus({
functionMode: 2,
batchId,
typeName,
typeName:'FunctionAccessBatchStatusRule',
deviceImei,
interval: 500
},

View File

@ -6,7 +6,7 @@
<image src="/static/images/common/logo.png" class="logo"></image>
</view>
<view class="user-right">
<view class="user-title">富源晟科技</view>
<view class="user-title">武汉星汉</view>
<view class="ID">ID:123456</view>
</view>
</view>

View File

@ -119,9 +119,8 @@ import Paho from 'paho-mqtt';
import allConfigs from '../config/index.js';
// 根据环境选择正确的配置
const env = 'development'; //production //开发of线上 改这里就行
const env = 'production'; //production //开发of线上 改这里就行
const config = allConfigs[env];
class MqttClient {
constructor() {
this.client = null;

View File

@ -1,5 +1,5 @@
import config from '../config/index.js';
const env = 'development'; //production development //开发of线上 改这里就行
const env = 'production'; //production development //开发of线上 改这里就行
const BASE = config[env];
const request = (options) => {
console.log("options"+JSON.stringify(options),BASE.BASE_URL)