修改 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 export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
const MQTT_USERNAME = 't_user'//mqtt用户名 const MQTT_USERNAME = 't_user'//mqtt用户名

View File

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

View File

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

View File

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

View File

@@ -30,6 +30,7 @@
</template> </template>
<script> <script>
import { getDevCount } from '../../common/api/device.js'
export default { export default {
data() { data() {
return { return {
@@ -37,8 +38,10 @@ export default {
userInfo: {}, userInfo: {},
messageCount: {}, messageCount: {},
timer: null, timer: null,
devCount: {},
} }
}, },
methods: { methods: {
init() { init() {
this.userInfo = uni.getStorageSync('userInfo') this.userInfo = uni.getStorageSync('userInfo')
@@ -76,10 +79,58 @@ export default {
break 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) {}, onLoad(options) {},
onShow() { onShow() {
this.init() this.init()
this.getDevCount()
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {} this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {} this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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