温度修改
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
"name" : "灿能物联",
|
"name" : "灿能物联",
|
||||||
"appid" : "__UNI__88BC25B",
|
"appid" : "__UNI__88BC25B",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.2.4",
|
"versionName" : "1.2.6",
|
||||||
"versionCode" : 124,
|
"versionCode" : 126,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
<view class="item item-title">{{ item[3].clDid }}
|
<view class="item item-title">{{ item[3].clDid }}
|
||||||
<template v-if="item[3].clDid "> (°C)</template>
|
<template v-if="item[3].clDid "> (°C)</template>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">{{ item[0].clDid ? item[0].value || '-' : ''}}</view>
|
<view class="item">{{ item[0].clDid ? item[0].value || '-' : '' }}</view>
|
||||||
<view class="item">{{ item[1].clDid ? item[1].value || '-' : ''}}</view>
|
<view class="item">{{ item[1].clDid ? item[1].value || '-' : '' }}</view>
|
||||||
<view class="item">{{ item[2].clDid ? item[2].value || '-' : ''}}</view>
|
<view class="item">{{ item[2].clDid ? item[2].value || '-' : '' }}</view>
|
||||||
<view class="item">{{ item[3].clDid ? item[3].value || '-' : ''}}</view>
|
<view class="item">{{ item[3].clDid ? item[3].value || '-' : '' }}</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -58,13 +58,16 @@ export default {
|
|||||||
for (let i = 0; i < this.IOData.length; i += 4) {
|
for (let i = 0; i < this.IOData.length; i += 4) {
|
||||||
arr.push(this.IOData.slice(i, i + 4))
|
arr.push(this.IOData.slice(i, i + 4))
|
||||||
}
|
}
|
||||||
arr.forEach(item => {
|
// 把每组的长度补齐到4
|
||||||
|
arr.forEach((item) => {
|
||||||
if (item.length < 4) {
|
if (item.length < 4) {
|
||||||
for (let i = 0; i < 4 - item.length; i++) {
|
let length = 4 - item.length
|
||||||
|
for (let i = 0; i < length; i++) {
|
||||||
item.push({})
|
item.push({})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.warn(arr)
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -252,9 +252,7 @@ export default {
|
|||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: this.deviceInfo.filePath,
|
url: this.deviceInfo.filePath,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res)
|
|
||||||
pathToBase64(res.tempFilePath).then((res) => {
|
pathToBase64(res.tempFilePath).then((res) => {
|
||||||
console.log(res)
|
|
||||||
this.topoImg = res
|
this.topoImg = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -321,7 +319,7 @@ export default {
|
|||||||
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
|
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.client = mqtt.connect('wss://' + MQTT_IP, MQTT_OPTIONS)
|
this.client = mqtt.connect('ws://' + MQTT_IP, MQTT_OPTIONS)
|
||||||
// #endif
|
// #endif
|
||||||
this.client
|
this.client
|
||||||
.on('connect', () => {
|
.on('connect', () => {
|
||||||
@@ -371,6 +369,13 @@ export default {
|
|||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
this.IOData = JSON.parse(message.toString())
|
this.IOData = JSON.parse(message.toString())
|
||||||
|
this.IOData.forEach(item=>{
|
||||||
|
if(item.value === 0){
|
||||||
|
item.value = '0'
|
||||||
|
}else if(!item.value){
|
||||||
|
item.value = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user