修改 app问题

This commit is contained in:
GGJ
2024-09-23 08:50:16 +08:00
parent 1dbecd890f
commit 56a2db2b48
9 changed files with 635 additions and 542 deletions

View File

@@ -1,4 +1,4 @@
// export const MQTT_IP = '192.168.1.18:8083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
// export const MQTT_IP = '192.168.1.24:10215/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
const MQTT_USERNAME = 't_user'//mqtt用户名

View File

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

View File

@@ -88,7 +88,7 @@ export default {
onNavigationBarButtonTap(e) {
uni.showModal({
title: '提示',
content: '确定要全部标记为已读吗1',
content: '确定要全部标记为已读吗?',
success: (res) => {
if (res.confirm) {
updateStatus({

View File

@@ -30,7 +30,7 @@
<GongCheng ref="gongCheng" :devCount="devCount" v-if="userInfo.authorities === 'engineering_user'" />
<!-- 主用户 -->
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
<!-- 游客 -->
<!-- 游客 -->
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"></YouKe>
<template v-show="engineeringList.length">
<view class="canneng-index-title mt20">设备列表</view>
@@ -151,7 +151,7 @@ export default {
return
}
getDevCount(this.select.engineeringId).then((res) => {
// console.log(`12312`,res)
// console.log(`12312`,res)
// Object.assign(this.devCount, res.data)
this.devCount = res.data
this.devCount.currentOffLineDevs.forEach((item) => {
@@ -175,7 +175,7 @@ export default {
if (messagePage) {
uni.setTabBarBadge({
index: 1,
text: messagePage ? messagePage + '' : '',
text:messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
})
} else {
uni.removeTabBarBadge({
@@ -215,7 +215,7 @@ export default {
// #endif
}, 1000)
}
this.timer = setInterval(this.getDevCount, 1000 *60) // 定时请求
this.timer = setInterval(this.getDevCount, 1000 * 60) // 定时请求
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
// #ifdef APP-PLUS
setTimeout(() => {

View File

@@ -30,6 +30,7 @@
</template>
<script>
import { getDevCount } from '../../common/api/device.js'
export default {
data() {
return {
@@ -37,8 +38,10 @@ export default {
userInfo: {},
messageCount: {},
timer: null,
devCount: {},
}
},
methods: {
init() {
this.userInfo = uni.getStorageSync('userInfo')
@@ -76,10 +79,58 @@ export default {
break
}
},
getDevCount() {
if (uni.getStorageSync('projectList')[1] != undefined) {
getDevCount(uni.getStorageSync('projectList')[1].engineeringId).then((res) => {
this.devCount = res.data
this.devCount.currentOffLineDevs.forEach((item) => {
item.runStatus = 1
})
this.devCount.offLineDevs.forEach((item) => {
item.runStatus = 1
})
uni.setStorage({
key: this.$cacheKey.messageCount,
data: this.devCount,
})
let messagePage =
this.devCount.runCount +
this.devCount.eventCount +
this.devCount.alarmCount +
this.devCount.harmonicCount
let minePage = this.devCount.feedBackCount
if (messagePage) {
uni.setTabBarBadge({
index: 1,
text:messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
})
} else {
uni.removeTabBarBadge({
index: 1,
})
}
if (minePage) {
uni.setTabBarBadge({
index: 2,
text: minePage + '',
})
} else {
uni.removeTabBarBadge({
index: 2,
})
}
// #ifdef APP-PLUS
plus.runtime.setBadgeNumber(messagePage + minePage)
// #endif
})
}
},
},
onLoad(options) {},
onShow() {
this.init()
this.getDevCount()
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
this.timer = setInterval(() => {
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}

View File

@@ -84,11 +84,11 @@ export default {
}
this.init()
},
onShow() {},
// onShow() { this.init()},
onNavigationBarButtonTap(e) {
uni.showModal({
title: '提示',
content: '确定要全部标记为已读吗2',
content: '确定要全部标记为已读吗?',
success: (res) => {
if (res.confirm) {
updateStatus({
@@ -136,8 +136,13 @@ export default {
this.store.reload()
},
jump(item) {
console.log(`123`,item);
console.log(`123`,this.type);
if (this.type === '0') {
let str = JSON.stringify(item).replace(/%/g, '百分比')
item.status = '1'
uni.navigateTo({ url: '/pages/message/messageDetail?detail=' + encodeURIComponent(str) })
} else {
if (item.status != '1') {

View File

@@ -4,7 +4,7 @@
<view class="about">
<image src="/static/logo.png" class="logo"></image>
<view class="name">灿能物联</view>
<view class="version">Version 1.6.0</view>
<view class="version">Version 1.6.1</view>
</view>
</view>
</Cn-page>

File diff suppressed because it is too large Load Diff

View File

@@ -187,10 +187,10 @@
},
watch: {
'customStyle.padding': {
handler(padding) {
if(typeof padding == 'number'){
padding += ''
}
handler(padding) {
if(typeof padding == 'number'){
padding += ''
}
let paddingArr = padding.split(' ')
if (paddingArr.length === 1) {
this.padding = {