修改 测试问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// export const MQTT_IP = '192.168.1.24:10215/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
||||
export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
||||
// export const MQTT_IP = '192.168.1.24:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
||||
|
||||
const MQTT_USERNAME = 't_user'//mqtt用户名
|
||||
const MQTT_PASSWORD = 'njcnpqs'//密码
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "灿能物联",
|
||||
"appid" : "__UNI__88BC25B",
|
||||
"description" : "",
|
||||
"versionName" : "1.6.1",
|
||||
"versionCode" : 161,
|
||||
"versionName" : "1.6.3",
|
||||
"versionCode" : 163,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
||||
@@ -298,6 +298,7 @@ barCateGoryGap:20,
|
||||
},
|
||||
initEcharts() {
|
||||
setTimeout(() => {
|
||||
if(this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]] == undefined) return
|
||||
let obj = JSON.parse(
|
||||
JSON.stringify(
|
||||
this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]],
|
||||
|
||||
@@ -5,18 +5,10 @@
|
||||
<view class="detail-header">
|
||||
<Cn-htmlToImg domId="header" @renderFinish="renderFinish">
|
||||
<view class="header" id="header" ref="header" @click="previewImg">
|
||||
<img
|
||||
:src="topoImg"
|
||||
style="width: 375px; display: block"
|
||||
mode="widthFix"
|
||||
@load="domLoading = false"
|
||||
/>
|
||||
<view
|
||||
class="point"
|
||||
:style="{ left: item.lat + 'px', top: item.lng + 'px' }"
|
||||
v-for="(item, index) in topolodyData"
|
||||
:key="index"
|
||||
>
|
||||
<img :src="topoImg" style="width: 375px; display: block" mode="widthFix"
|
||||
@load="domLoading = false" />
|
||||
<view class="point" :style="{ left: item.lat + 'px', top: item.lng + 'px' }"
|
||||
v-for="(item, index) in topolodyData" :key="index">
|
||||
<view class="grid-card mt10" style="width: fit-content">
|
||||
<view class="grid-card-content-1">
|
||||
<view class="item">{{ item.label }}</view>
|
||||
@@ -51,13 +43,9 @@
|
||||
<text class="ml10">设备状态</text>
|
||||
</view> -->
|
||||
<view class="nav" style="margin-top: -10rpx">
|
||||
<view
|
||||
class="nav-menu"
|
||||
:class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList"
|
||||
:key="index"
|
||||
@click="navMenuClick(index)"
|
||||
>{{ item.text }}
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -80,7 +68,7 @@
|
||||
</view>
|
||||
<view style="height: 20rpx"></view>
|
||||
</view>
|
||||
<!-- <uni-fab
|
||||
<!-- <uni-fab
|
||||
ref="fab"
|
||||
direction="vertical"
|
||||
horizontal="right"
|
||||
@@ -88,7 +76,7 @@
|
||||
:content="content"
|
||||
@trigger="trigger"
|
||||
/> -->
|
||||
<hover-menu :btnList="content" @trigger='trigger'></hover-menu>
|
||||
<hover-menu :btnList="content" @trigger='trigger'></hover-menu>
|
||||
<uni-popup ref="share" type="share" :safe-area="false">
|
||||
<uni-popup-share title="分享到"></uni-popup-share>
|
||||
<view style="height: 40rpx; background: #fff"></view>
|
||||
@@ -107,22 +95,10 @@
|
||||
</uni-popup> -->
|
||||
<!-- 输入框示例 -->
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
type="info"
|
||||
mode="input"
|
||||
:title="dialogType"
|
||||
value="对话框预置提示内容!"
|
||||
placeholder="请输入内容"
|
||||
@confirm="dialogInputConfirm"
|
||||
>
|
||||
<uni-easyinput
|
||||
type="textarea"
|
||||
:maxlength="250"
|
||||
autoHeight
|
||||
v-model="remarkContent"
|
||||
placeholder="请输入备注"
|
||||
></uni-easyinput>
|
||||
<uni-popup-dialog ref="inputClose" type="info" mode="input" :title="dialogType" value="对话框预置提示内容!"
|
||||
placeholder="请输入内容" @confirm="dialogInputConfirm">
|
||||
<uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="remarkContent"
|
||||
placeholder="请输入备注"></uni-easyinput>
|
||||
</uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@@ -166,18 +142,22 @@ export default {
|
||||
navMenuList: [
|
||||
{
|
||||
text: '基本',
|
||||
id: 'fc8c86dbc3f2d9810f5cd8f53c295415'
|
||||
},
|
||||
{
|
||||
text: '谐波',
|
||||
id: '769f3db0bce070d35acf8fa92c998eb6'
|
||||
},
|
||||
{
|
||||
text: '功率',
|
||||
id: 'a16aceae7d1565bf9f94dd7410cf9bce'
|
||||
},
|
||||
// {
|
||||
// text: '波形',
|
||||
// },
|
||||
{
|
||||
text: '其他',
|
||||
|
||||
},
|
||||
],
|
||||
content: [
|
||||
@@ -197,7 +177,7 @@ export default {
|
||||
iconPath: '/static/access.png',
|
||||
text: '接入',
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
client: null,
|
||||
timer: null,
|
||||
@@ -209,7 +189,7 @@ export default {
|
||||
basicData: [],
|
||||
IOData: [],
|
||||
pageOptions: {},
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -277,9 +257,9 @@ export default {
|
||||
}
|
||||
// this.$refs.fab.close()
|
||||
},
|
||||
clickItem(item) {
|
||||
console.log(item);
|
||||
},
|
||||
clickItem(item) {
|
||||
console.log(item);
|
||||
},
|
||||
// 取消调试
|
||||
cancelDebug() {
|
||||
this.dialogType = '取消调试'
|
||||
@@ -319,9 +299,20 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
navMenuClick(idx) {
|
||||
this.navMenuActive = idx
|
||||
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
|
||||
async navMenuClick(idx) {
|
||||
// console.log("🚀 ~ navMenuClick ~ idx:", idx)
|
||||
if (idx != 3) {
|
||||
await this.client.end()
|
||||
await setTimeout(() => {
|
||||
this.initMqtt(this.navMenuList[idx].id)
|
||||
|
||||
},500)
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.navMenuActive = idx
|
||||
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
|
||||
}, 500)
|
||||
},
|
||||
downloadImg() {
|
||||
uni.downloadFile({
|
||||
@@ -361,7 +352,7 @@ export default {
|
||||
if (this.client) {
|
||||
this.loading = false
|
||||
} else {
|
||||
this.initMqtt()
|
||||
this.initMqtt(this.navMenuList[0].id)
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -387,7 +378,7 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
initMqtt() {
|
||||
initMqtt(id) {
|
||||
MQTT_OPTIONS.clientId = uni.getStorageSync('devCode')
|
||||
// #ifdef APP-PLUS
|
||||
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
|
||||
@@ -403,16 +394,22 @@ export default {
|
||||
console.log(`订阅成功:/zl/TemperData/${this.devId}`)
|
||||
}
|
||||
})
|
||||
this.client.subscribe(`/zl/devData/${this.devId}`, (err) => {
|
||||
|
||||
this.client.subscribe(`/zl/devData/${this.devId}/${id}`, (err) => {
|
||||
if (!err) {
|
||||
console.log(`订阅成功:/zl/devData/${this.devId}`)
|
||||
console.log(`订阅成功:/zl/devData/${this.devId}/${id}`)
|
||||
|
||||
// 默认推送
|
||||
this.client.publish(`/zl/askDevData/${this.devId}`)
|
||||
this.client.publish(`/zl/askDevData/${this.devId}/${id}`)
|
||||
this.client.publish(`/zl/askTemperData/${this.devId}`)
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
|
||||
console.log('askDevData')
|
||||
this.client.publish(`/zl/askDevData/${this.devId}`)
|
||||
this.client.publish(`/zl/askDevData/${this.devId}/${id}`)
|
||||
this.client.publish(`/zl/askTemperData/${this.devId}`)
|
||||
}, 1000 * 60)
|
||||
}
|
||||
@@ -430,7 +427,9 @@ export default {
|
||||
})
|
||||
.on('message', (topic, message) => {
|
||||
console.log('接收推送信息:', JSON.parse(message.toString()), topic)
|
||||
if (topic === `/zl/devData/${this.devId}`) {
|
||||
console.log("🚀 ~ .on ~ topic:", topic)
|
||||
|
||||
if (topic === `/zl/devData/${this.devId}/${id}`) {
|
||||
if ((!message.toString() || message.toString().length < 10) && this.loading) {
|
||||
this.$util.toast('该设备暂无数据')
|
||||
}
|
||||
@@ -456,6 +455,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handlerData(data) {
|
||||
this.basicData = data
|
||||
|
||||
@@ -594,6 +594,7 @@ export default {
|
||||
|
||||
<style lang="scss">
|
||||
.detail {
|
||||
|
||||
// background: $uni-theme-white;
|
||||
.header-bg {
|
||||
position: absolute;
|
||||
@@ -644,6 +645,7 @@ export default {
|
||||
bottom: 0;
|
||||
right: 10rpx;
|
||||
opacity: 0.8;
|
||||
|
||||
.grid-card-content-2,
|
||||
.grid-card-content-6,
|
||||
.grid-card-content-1 {
|
||||
@@ -675,14 +677,17 @@ export default {
|
||||
background: #f3f4f5;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-fab__circle--rightBottom {
|
||||
right: 8px !important;
|
||||
bottom: 8px !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-fab--rightBottom {
|
||||
right: 8px !important;
|
||||
bottom: 8px !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-fab__circle {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -692,10 +697,12 @@ export default {
|
||||
width: 40px !important;
|
||||
// height: 50px !important;
|
||||
}
|
||||
|
||||
/deep/.uni-fab__item {
|
||||
// height: 45px;
|
||||
width: 40px !important;
|
||||
}
|
||||
|
||||
/deep/.uni-fab__item--first {
|
||||
height: 40px !important;
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
<view class="mine-nav-label">意见反馈</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<!-- @click="jump('about')" -->
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<!-- @click="jump('about')" -->
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">版本信息</view>
|
||||
<view style="color: #828282;font-size: 14rpx;">当前版本V1.6.2</view>
|
||||
<view style="color: #828282;font-size: 14rpx;">当前版本V1.6.3</view>
|
||||
<!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init() {},
|
||||
async init() { },
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
case 'changePwd':
|
||||
|
||||
Reference in New Issue
Block a user