diff --git a/App.vue b/App.vue
index ad4ba44..31fcb8a 100644
--- a/App.vue
+++ b/App.vue
@@ -10,6 +10,7 @@ export default {
console.log(window)
// this.connect()
console.log('App Launch')
+
let devCode = uni.getStorageSync('devCode')
if (!devCode) {
uni.getSystemInfo({
@@ -18,18 +19,6 @@ export default {
},
})
}
- if (!uni.getStorageSync(this.$cacheKey.access_token)) {
- uni.reLaunch({
- url: '/pages/user/login',
- })
- }
- let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
- if (!userInfo) return
- // 查询字典
- queryDictDataCache().then((res) => {
- uni.setStorageSync(this.$cacheKey.dictData, res.data)
- })
-
},
onHide: function () {
console.log('App Hide')
diff --git a/androidPrivacy.json b/androidPrivacy.json
index a78485c..33ad2a0 100644
--- a/androidPrivacy.json
+++ b/androidPrivacy.json
@@ -1,3 +1,38 @@
{
- "prompt" : "none"
+ "version": "2",
+ "prompt": "template",
+ "title": "服务协议和隐私政策",
+ "message": " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
你可阅读《服务协议》和《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
+ "buttonAccept": "同意并接受",
+ "buttonRefuse": "暂不同意",
+ "hrefLoader": "system|default",
+ "backToExit":"false",
+ "second": {
+ "title": "确认提示",
+ "message": " 进入应用前,你需先同意《用户协议》和《隐私政策》,否则将退出应用。",
+ "buttonAccept": "同意并继续",
+ "buttonRefuse": "退出应用"
+ },
+ "disagreeMode":{
+ "support": false,
+ "loadNativePlugins": false,
+ "visitorEntry": false,
+ "showAlways": false
+ },
+ "styles": {
+ "backgroundColor": "#ffffff",
+ "borderRadius":"5px",
+ "title": {
+ "color": "#111"
+ },
+ "buttonAccept": {
+ "color": "#111"
+ },
+ "buttonRefuse": {
+ "color": "#111"
+ },
+ "buttonVisitor": {
+ "color": "#111"
+ }
+ }
}
diff --git a/common/js/util.js b/common/js/util.js
index dbd61bf..f0dfe09 100644
--- a/common/js/util.js
+++ b/common/js/util.js
@@ -1,10 +1,10 @@
import request from './request'
import cache from './cacheKey.js'
-import {getImageUrl} from '@/common/api/basic'
-import {apiUpdatePush} from '@/common/api/user'
-import {queryDictDataCache} from '../api/dictionary.js'
+import { getImageUrl } from '@/common/api/basic'
+import { apiUpdatePush } from '@/common/api/user'
+import { queryDictDataCache } from '../api/dictionary.js'
import cacheKey from './cacheKey.js'
-import config from "@/common/js/config";
+import config from '@/common/js/config'
import jsrsasign from 'jsrsasign'
const toast = (title, duration = 1500, call, mask = false, icon = 'none') => {
@@ -268,10 +268,20 @@ const decodeToken = (token) => {
}
const getDictData = (key) => {
- let dictData = uni.getStorageSync(cacheKey.dictData)
- if (dictData) {
- return dictData.filter((item) => item.code === key)[0]?.children || []
- }
+ return new Promise((resolve, reject) => {
+ let dictData = uni.getStorageSync(cacheKey.dictData)
+ if (dictData) {
+ resolve(dictData.filter((item) => item.code === key)[0]?.children || [])
+ } else {
+ // 查询字典
+ queryDictDataCache().then((res) => {
+ uni.setStorageSync(cacheKey.dictData, res.data)
+ resolve(res.data.filter((item) => item.code === key)[0]?.children || [])
+ }).catch(err=>{
+ reject(err)
+ })
+ }
+ })
}
export default {
@@ -285,5 +295,5 @@ export default {
prePage,
loginSuccess,
refreshPrePage,
- getDictData
+ getDictData,
}
diff --git a/manifest.json b/manifest.json
index e3555cf..8e35901 100644
--- a/manifest.json
+++ b/manifest.json
@@ -3,7 +3,7 @@
"appid" : "__UNI__88BC25B",
"description" : "",
"versionName" : "1.2.8",
- "versionCode" : 128,
+ "versionCode" : 127,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
@@ -106,6 +106,9 @@
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
+ },
+ "splashscreen" : {
+ "useOriginalMsgbox" : true
}
}
},
@@ -131,7 +134,7 @@
"proxy" : {
"/api" : {
"https" : true,
- "target" : "http://192.168.1.115:10215",
+ "target" : "https://pqmcn.com:8092/api",
"changOrigin" : true,
"pathRewrite" : {
"/api" : ""
diff --git a/pages/device/APF/detail.vue b/pages/device/APF/detail.vue
index 097022b..c13dcbd 100644
--- a/pages/device/APF/detail.vue
+++ b/pages/device/APF/detail.vue
@@ -488,31 +488,33 @@ export default {
})
}
}
- this.topolodyData = this.$util.getDictData('Line_Position').map((item) => {
- switch (item.name) {
- case '电网侧':
- item.showKey = ['Apf_ThdA_Sys(%)']
- break
- case '负载侧':
- item.showKey = ['Apf_ThdA_Load(%)']
- break
- case '输出侧':
- item.showKey = ['Apf_RmsI_TolOut(A)']
- break
- case 'PCC公共点':
- item.showKey = []
- break
- default:
- break
- }
- return {
- label: item.name,
- linePostion: item.id,
- lat: '',
- lng: '',
- showKey: item.showKey, //要展示的指标key
- value: [],
- }
+ this.$util.getDictData('Line_Position').then((res) => {
+ this.topolodyData = res.map((item) => {
+ switch (item.name) {
+ case '电网侧':
+ item.showKey = ['Apf_ThdA_Sys(%)']
+ break
+ case '负载侧':
+ item.showKey = ['Apf_ThdA_Load(%)']
+ break
+ case '输出侧':
+ item.showKey = ['Apf_RmsI_TolOut(A)']
+ break
+ case 'PCC公共点':
+ item.showKey = []
+ break
+ default:
+ break
+ }
+ return {
+ label: item.name,
+ linePostion: item.id,
+ lat: '',
+ lng: '',
+ showKey: item.showKey, //要展示的指标key
+ value: [],
+ }
+ })
})
this.init()
},
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a074137..afeb096 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -15,26 +15,25 @@
灿能物联
- {{
- select.engineeringName || emptyEngineeringName
- }}
+ {{ select.engineeringName || emptyEngineeringName }}
-
+
-
+
-
+
-
+
设备列表
-
+
@@ -48,8 +47,8 @@ import ZhuanZhi from './comp/indexZhuanZhi.vue'
import YouKe from './comp/indexYouKe.vue'
import Device from './comp/device.vue'
import list from '../../common/js/list'
-import {getDevCount} from '../../common/api/device.js'
-import {queryEngineering} from '@/common/api/engineering.js'
+import { getDevCount } from '../../common/api/device.js'
+import { queryEngineering } from '@/common/api/engineering.js'
export default {
mixins: [list],
@@ -71,7 +70,7 @@ export default {
engineeringId: '',
},
engineeringList: [],
- navTabHeight: 0
+ navTabHeight: 0,
}
},
computed: {
@@ -83,7 +82,7 @@ export default {
} else {
return '创建工程'
}
- }
+ },
},
methods: {
selectEngineering() {
@@ -153,19 +152,27 @@ export default {
item.runStatus = 1
})
this.devCount.engineeringListLength = this.engineeringList.length
- console.log(this.devCount);
+ console.log(this.devCount)
})
},
},
onLoad() {
+ if (!uni.getStorageSync(this.$cacheKey.access_token)) {
+ uni.reLaunch({
+ url: '/pages/user/login',
+ })
+ }
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
// #ifdef APP-PLUS
setTimeout(() => {
// 获取nav高度
- uni.createSelectorQuery().select('.uni-navbar').boundingClientRect((rect) => {
- this.navTabHeight = rect.height
- console.log('calc(100vh - ' + this.navTabHeight + ')')
- }).exec()
+ uni.createSelectorQuery()
+ .select('.uni-navbar')
+ .boundingClientRect((rect) => {
+ this.navTabHeight = rect.height
+ console.log('calc(100vh - ' + this.navTabHeight + ')')
+ })
+ .exec()
}, 1000)
// #endif
},
@@ -174,7 +181,7 @@ export default {
let access_token = uni.getStorageSync(this.$cacheKey.access_token)
if (!access_token) {
uni.reLaunch({
- url: `/pages/user/login`
+ url: `/pages/user/login`,
})
} else {
if (
@@ -189,7 +196,6 @@ export default {
}
this.init()
}
-
},
}
diff --git a/pages/message/report.vue b/pages/message/report.vue
index c380665..b9b6ec5 100644
--- a/pages/message/report.vue
+++ b/pages/message/report.vue
@@ -26,8 +26,8 @@ export default {
this.init()
},
methods: {
- init() {
- let dictData = this.$util.getDictData('app_event')
+ async init() {
+ let dictData = await this.$util.getDictData('app_event')
console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
this.store.params.type = 3
diff --git a/pages/message/run.vue b/pages/message/run.vue
index b121a08..50cba4d 100644
--- a/pages/message/run.vue
+++ b/pages/message/run.vue
@@ -26,8 +26,8 @@ export default {
this.init()
},
methods: {
- init() {
- let dictData = this.$util.getDictData('app_event')
+ async init() {
+ let dictData = await this.$util.getDictData('app_event')
console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
this.store.params.type = 2
diff --git a/pages/message/steady.vue b/pages/message/steady.vue
index c76890b..1c9c3e9 100644
--- a/pages/message/steady.vue
+++ b/pages/message/steady.vue
@@ -1,17 +1,60 @@
-
-
-
-
-
+
+
+
+
+
@@ -51,7 +94,6 @@ export default {
padding-top: 20rpx;
}
-
/deep/ .uni-list-item {
background-color: $uni-theme-white !important;
}
diff --git a/pages/message/transient.vue b/pages/message/transient.vue
index b88af03..fa07596 100644
--- a/pages/message/transient.vue
+++ b/pages/message/transient.vue
@@ -1,14 +1,19 @@
-
+
{{ item.engineeringName + '' + item.projectName }}
-
+
{{ item2.showName + ':' + item2.value + (item2.unit || '') }}
@@ -17,11 +22,10 @@
-
diff --git a/pages/mine/agreement.vue b/pages/mine/agreement.vue
index 0940574..55f3870 100644
--- a/pages/mine/agreement.vue
+++ b/pages/mine/agreement.vue
@@ -21,17 +21,13 @@ export default {
}
},
methods: {},
- created() {
- let dictData = uni.getStorageSync(this.$cacheKey.dictData)
- dictData.forEach((item) => {
- if (item.code === 'appInformationType') {
- item.children.forEach((item2) => {
- if (item2.code === 'User_Agreement') {
- queryAppInfoByType(item2.id).then((res) => {
- this.value = res.data.content
- this.loading = false
- })
- }
+ async onLoad() {
+ let dictData = await this.$util.getDictData('appInformationType')
+ dictData.forEach((item2) => {
+ if (item2.code === 'User_Agreement') {
+ queryAppInfoByType(item2.id).then((res) => {
+ this.value = res.data.content
+ this.loading = false
})
}
})
diff --git a/pages/mine/policy.vue b/pages/mine/policy.vue
index e0a247c..d78ffd8 100644
--- a/pages/mine/policy.vue
+++ b/pages/mine/policy.vue
@@ -21,17 +21,13 @@ export default {
}
},
methods: {},
- created() {
- let dictData = uni.getStorageSync(this.$cacheKey.dictData)
- dictData.forEach((item) => {
- if (item.code === 'appInformationType') {
- item.children.forEach((item2) => {
- if (item2.code === 'Personal_Infor_Protect') {
- queryAppInfoByType(item2.id).then((res) => {
- this.value = res.data.content
- this.loading = false
- })
- }
+ async onLoad() {
+ let dictData = await this.$util.getDictData('appInformationType')
+ dictData.forEach((item2) => {
+ if (item2.code === 'Personal_Infor_Protect') {
+ queryAppInfoByType(item2.id).then((res) => {
+ this.value = res.data.content
+ this.loading = false
})
}
})