merge upstream
This commit is contained in:
@ -22,7 +22,7 @@
|
|||||||
<view class="row">
|
<view class="row">
|
||||||
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
|
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
|
||||||
<view class="txt">
|
<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>
|
||||||
<view class="smallTxt">续航时间</view>
|
<view class="smallTxt">续航时间</view>
|
||||||
</view>
|
</view>
|
||||||
@ -464,19 +464,19 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
this.mqttClient = new MqttClient();
|
this.mqttClient = new MqttClient();
|
||||||
this.mqttClient.connect(() => {
|
// this.mqttClient.connect(() => {
|
||||||
// 订阅来自设备的状态更新
|
// // 订阅来自设备的状态更新
|
||||||
const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
|
// const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
|
||||||
this.mqttClient.subscribe(statusTopic, (payload) => {
|
// this.mqttClient.subscribe(statusTopic, (payload) => {
|
||||||
try {
|
// try {
|
||||||
// 解析MQTT返回的payload
|
// // 解析MQTT返回的payload
|
||||||
const payloadObj = typeof payload === 'string' ? JSON.parse(
|
// const payloadObj = typeof payload === 'string' ? JSON.parse(
|
||||||
payload) : payload;
|
// payload) : payload;
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
|
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
console.log(data, 'datatatatat');
|
console.log(data, 'datatatatat');
|
||||||
these.fetchDeviceDetail(data.data.id)
|
these.fetchDeviceDetail(data.data.id)
|
||||||
});
|
});
|
||||||
|
|||||||
@ -22,7 +22,7 @@ const request = (options) => {
|
|||||||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(options.data[key])}`)
|
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(options.data[key])}`)
|
||||||
.join('&');
|
.join('&');
|
||||||
url += `?${params}`;
|
url += `?${params}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
Reference in New Issue
Block a user