修改 测试问题

This commit is contained in:
GGJ
2024-11-06 09:17:49 +08:00
parent c5ae23e8da
commit 26066db3fd
5 changed files with 67 additions and 59 deletions

View File

@@ -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 = '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_USERNAME = 't_user'//mqtt用户名
const MQTT_PASSWORD = 'njcnpqs'//密码 const MQTT_PASSWORD = 'njcnpqs'//密码

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.6.1", "versionName" : "1.6.3",
"versionCode" : 161, "versionCode" : 163,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -298,6 +298,7 @@ barCateGoryGap:20,
}, },
initEcharts() { initEcharts() {
setTimeout(() => { setTimeout(() => {
if(this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]] == undefined) return
let obj = JSON.parse( let obj = JSON.parse(
JSON.stringify( JSON.stringify(
this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]], this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]],

View File

@@ -5,18 +5,10 @@
<view class="detail-header"> <view class="detail-header">
<Cn-htmlToImg domId="header" @renderFinish="renderFinish"> <Cn-htmlToImg domId="header" @renderFinish="renderFinish">
<view class="header" id="header" ref="header" @click="previewImg"> <view class="header" id="header" ref="header" @click="previewImg">
<img <img :src="topoImg" style="width: 375px; display: block" mode="widthFix"
:src="topoImg" @load="domLoading = false" />
style="width: 375px; display: block" <view class="point" :style="{ left: item.lat + 'px', top: item.lng + 'px' }"
mode="widthFix" v-for="(item, index) in topolodyData" :key="index">
@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 mt10" style="width: fit-content">
<view class="grid-card-content-1"> <view class="grid-card-content-1">
<view class="item">{{ item.label }}</view> <view class="item">{{ item.label }}</view>
@@ -51,13 +43,9 @@
<text class="ml10">设备状态</text> <text class="ml10">设备状态</text>
</view> --> </view> -->
<view class="nav" style="margin-top: -10rpx"> <view class="nav" style="margin-top: -10rpx">
<view <view class="nav-menu" :class="{ 'nav-menu-active': navMenuActive == index }"
class="nav-menu" v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text
:class="{ 'nav-menu-active': navMenuActive == index }" }}
v-for="(item, index) in navMenuList"
:key="index"
@click="navMenuClick(index)"
>{{ item.text }}
</view> </view>
</view> </view>
</view> </view>
@@ -80,7 +68,7 @@
</view> </view>
<view style="height: 20rpx"></view> <view style="height: 20rpx"></view>
</view> </view>
<!-- <uni-fab <!-- <uni-fab
ref="fab" ref="fab"
direction="vertical" direction="vertical"
horizontal="right" horizontal="right"
@@ -88,7 +76,7 @@
:content="content" :content="content"
@trigger="trigger" @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 ref="share" type="share" :safe-area="false">
<uni-popup-share title="分享到"></uni-popup-share> <uni-popup-share title="分享到"></uni-popup-share>
<view style="height: 40rpx; background: #fff"></view> <view style="height: 40rpx; background: #fff"></view>
@@ -107,22 +95,10 @@
</uni-popup> --> </uni-popup> -->
<!-- 输入框示例 --> <!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog"> <uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog <uni-popup-dialog ref="inputClose" type="info" mode="input" :title="dialogType" value="对话框预置提示内容!"
ref="inputClose" placeholder="请输入内容" @confirm="dialogInputConfirm">
type="info" <uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="remarkContent"
mode="input" placeholder="请输入备注"></uni-easyinput>
:title="dialogType"
value="对话框预置提示内容!"
placeholder="请输入内容"
@confirm="dialogInputConfirm"
>
<uni-easyinput
type="textarea"
:maxlength="250"
autoHeight
v-model="remarkContent"
placeholder="请输入备注"
></uni-easyinput>
</uni-popup-dialog> </uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
@@ -166,18 +142,22 @@ export default {
navMenuList: [ navMenuList: [
{ {
text: '基本', text: '基本',
id: 'fc8c86dbc3f2d9810f5cd8f53c295415'
}, },
{ {
text: '谐波', text: '谐波',
id: '769f3db0bce070d35acf8fa92c998eb6'
}, },
{ {
text: '功率', text: '功率',
id: 'a16aceae7d1565bf9f94dd7410cf9bce'
}, },
// { // {
// text: '波形', // text: '波形',
// }, // },
{ {
text: '其他', text: '其他',
}, },
], ],
content: [ content: [
@@ -277,9 +257,9 @@ export default {
} }
// this.$refs.fab.close() // this.$refs.fab.close()
}, },
clickItem(item) { clickItem(item) {
console.log(item); console.log(item);
}, },
// 取消调试 // 取消调试
cancelDebug() { cancelDebug() {
this.dialogType = '取消调试' this.dialogType = '取消调试'
@@ -319,9 +299,20 @@ export default {
}) })
} }
}, },
navMenuClick(idx) { async navMenuClick(idx) {
this.navMenuActive = idx // console.log("🚀 ~ navMenuClick ~ idx:", idx)
uni.pageScrollTo({ scrollTop: 0, duration: 0 }) 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() { downloadImg() {
uni.downloadFile({ uni.downloadFile({
@@ -361,7 +352,7 @@ export default {
if (this.client) { if (this.client) {
this.loading = false this.loading = false
} else { } else {
this.initMqtt() this.initMqtt(this.navMenuList[0].id)
} }
}) })
}, },
@@ -387,7 +378,7 @@ export default {
}) })
} }
}, },
initMqtt() { initMqtt(id) {
MQTT_OPTIONS.clientId = uni.getStorageSync('devCode') MQTT_OPTIONS.clientId = uni.getStorageSync('devCode')
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS) this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
@@ -403,16 +394,22 @@ export default {
console.log(`订阅成功:/zl/TemperData/${this.devId}`) 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) { 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}`) this.client.publish(`/zl/askTemperData/${this.devId}`)
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
this.timer = setInterval(() => { this.timer = setInterval(() => {
console.log('askDevData') 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}`) this.client.publish(`/zl/askTemperData/${this.devId}`)
}, 1000 * 60) }, 1000 * 60)
} }
@@ -430,7 +427,9 @@ export default {
}) })
.on('message', (topic, message) => { .on('message', (topic, message) => {
console.log('接收推送信息:', JSON.parse(message.toString()), topic) 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) { if ((!message.toString() || message.toString().length < 10) && this.loading) {
this.$util.toast('该设备暂无数据') this.$util.toast('该设备暂无数据')
} }
@@ -456,6 +455,7 @@ export default {
} }
}) })
}, },
handlerData(data) { handlerData(data) {
this.basicData = data this.basicData = data
@@ -594,6 +594,7 @@ export default {
<style lang="scss"> <style lang="scss">
.detail { .detail {
// background: $uni-theme-white; // background: $uni-theme-white;
.header-bg { .header-bg {
position: absolute; position: absolute;
@@ -644,6 +645,7 @@ export default {
bottom: 0; bottom: 0;
right: 10rpx; right: 10rpx;
opacity: 0.8; opacity: 0.8;
.grid-card-content-2, .grid-card-content-2,
.grid-card-content-6, .grid-card-content-6,
.grid-card-content-1 { .grid-card-content-1 {
@@ -675,14 +677,17 @@ export default {
background: #f3f4f5; background: #f3f4f5;
} }
} }
/deep/ .uni-fab__circle--rightBottom { /deep/ .uni-fab__circle--rightBottom {
right: 8px !important; right: 8px !important;
bottom: 8px !important; bottom: 8px !important;
} }
/deep/ .uni-fab--rightBottom { /deep/ .uni-fab--rightBottom {
right: 8px !important; right: 8px !important;
bottom: 8px !important; bottom: 8px !important;
} }
/deep/ .uni-fab__circle { /deep/ .uni-fab__circle {
width: 40px; width: 40px;
height: 40px; height: 40px;
@@ -692,10 +697,12 @@ export default {
width: 40px !important; width: 40px !important;
// height: 50px !important; // height: 50px !important;
} }
/deep/.uni-fab__item { /deep/.uni-fab__item {
// height: 45px; // height: 45px;
width: 40px !important; width: 40px !important;
} }
/deep/.uni-fab__item--first { /deep/.uni-fab__item--first {
height: 40px !important; height: 40px !important;
} }

View File

@@ -45,10 +45,10 @@
<view class="mine-nav-label">意见反馈</view> <view class="mine-nav-label">意见反馈</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> --> </view> -->
<!-- @click="jump('about')" --> <!-- @click="jump('about')" -->
<view class="mine-nav" style="border-bottom: none"> <view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">版本信息</view> <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> --> <!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
</view> </view>
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none"> <view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">
@@ -67,7 +67,7 @@ export default {
} }
}, },
methods: { methods: {
async init() {}, async init() { },
jump(type) { jump(type) {
switch (type) { switch (type) {
case 'changePwd': case 'changePwd':