1
0
forked from dyf/APP

100J续航时间显示优化

This commit is contained in:
fengerli
2026-02-07 09:54:38 +08:00
parent 943d98dd40
commit 3fecf3380a
2 changed files with 15 additions and 15 deletions

View File

@ -22,7 +22,7 @@
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{ deviceInfo.batteryRemainingTime || '0' }}分钟
<view class="bigTxt"> {{ Math.floor((Number(deviceInfo.batteryRemainingTime)||0)/60) }}小时 {{ (Number(deviceInfo.batteryRemainingTime)||0)%60 }}分钟
</view>
<view class="smallTxt">续航时间</view>
</view>
@ -464,19 +464,19 @@
}
this.mqttClient = new MqttClient();
this.mqttClient.connect(() => {
// 订阅来自设备的状态更新
const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
this.mqttClient.subscribe(statusTopic, (payload) => {
try {
// 解析MQTT返回的payload
const payloadObj = typeof payload === 'string' ? JSON.parse(
payload) : payload;
} catch (e) {
// this.mqttClient.connect(() => {
// // 订阅来自设备的状态更新
// const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
// this.mqttClient.subscribe(statusTopic, (payload) => {
// try {
// // 解析MQTT返回的payload
// const payloadObj = typeof payload === 'string' ? JSON.parse(
// payload) : payload;
// } catch (e) {
}
})
})
// }
// })
// })
console.log(data, 'datatatatat');
these.fetchDeviceDetail(data.data.id)
});

View File

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