diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue index 204cbc2..76fef92 100644 --- a/pages/100J/HBY100-J.vue +++ b/pages/100J/HBY100-J.vue @@ -22,7 +22,7 @@ - {{ deviceInfo.batteryRemainingTime || '0' }}分钟 + {{ Math.floor((Number(deviceInfo.batteryRemainingTime)||0)/60) }}小时 {{ (Number(deviceInfo.batteryRemainingTime)||0)%60 }}分钟 续航时间 @@ -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) }); diff --git a/utils/request.js b/utils/request.js index c56423a..544409c 100644 --- a/utils/request.js +++ b/utils/request.js @@ -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) @@ -22,7 +22,7 @@ const request = (options) => { .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(options.data[key])}`) .join('&'); url += `?${params}`; - } + } const config = { url: url,