diff --git a/common/js/cacheKey.js b/common/js/cacheKey.js index 31fa107..bf380e0 100644 --- a/common/js/cacheKey.js +++ b/common/js/cacheKey.js @@ -6,4 +6,5 @@ export default { refresh_token: 'refresh_token', // 刷新token dictData: 'dictData', // 字典数据 messageCount: 'messageCount', // 消息数量 + serverConfig: 'serverConfig', // 服务内容配置 } diff --git a/components/Cn-grid/Cn-grid.vue b/components/Cn-grid/Cn-grid.vue index 087e7d3..f937e68 100644 --- a/components/Cn-grid/Cn-grid.vue +++ b/components/Cn-grid/Cn-grid.vue @@ -1,4 +1,3 @@ - - \ No newline at end of file + diff --git a/pages.json b/pages.json index 588deac..2c21566 100644 --- a/pages.json +++ b/pages.json @@ -357,6 +357,12 @@ "navigationBarTitleText": "关注工程配置" } }, + { + "path": "pages/mine/serverSetting", + "style": { + "navigationBarTitleText": "服务内容配置" + } + }, { "path": "pages/user/erweima", "style": { diff --git a/pages/index/comp/indexGongCheng.vue b/pages/index/comp/indexGongCheng.vue index 3808fe9..a86f803 100644 --- a/pages/index/comp/indexGongCheng.vue +++ b/pages/index/comp/indexGongCheng.vue @@ -21,9 +21,8 @@ 当前工程设备统计 - {{ - devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0 - }} + {{ devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0 }} 设备总数 @@ -38,10 +37,23 @@ 常用功能 - + - - + + + + + @@ -52,7 +64,11 @@ export default { data() { return { - loading: false, + loading: true, + config: { + feature: true, + factory: true, + }, } }, props: { @@ -61,9 +77,17 @@ export default { default: {}, }, }, + created() { + this.init() + }, methods: { + init() { + console.log('工程init') + let serverConfig = uni.getStorageSync(this.$cacheKey.serverConfig) + serverConfig && (this.config = serverConfig) + }, submitFeedBack() { - uni.navigateTo({url: '/pages/home/feedback'}) + uni.navigateTo({ url: '/pages/home/feedback' }) }, registerDevice(type) { uni.showModal({ @@ -72,7 +96,7 @@ export default { confirmText: '直连设备', cancelText: '网关接入', cancelColor: '#007aff', - success: ({confirm, cancel}) => { + success: ({ confirm, cancel }) => { if (confirm) { if (this.devCount.engineeringListLength > 0) { uni.navigateTo({ @@ -80,10 +104,9 @@ export default { }) } else { uni.navigateTo({ - url: '/pages/engineering/new?from=index&type=' + type + url: '/pages/engineering/new?from=index&type=' + type, }) } - } else if (cancel) { // uni.navigateTo({ // url: '/pages/gateway/list', @@ -100,8 +123,7 @@ export default { }, jump(type) { uni.navigateTo({ - url: - '/pages/device/list?type=' + type + url: '/pages/device/list?type=' + type, }) }, }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 5c2168a..247ecf6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -27,7 +27,7 @@ - + @@ -146,6 +146,7 @@ export default { if (!this.select.engineeringId) return if (!uni.getStorageSync(this.$cacheKey.access_token)) { clearInterval(this.timer) + return } getDevCount(this.select.engineeringId).then((res) => { // Object.assign(this.devCount, res.data) @@ -221,6 +222,8 @@ export default { }) } else { this.init() + console.log(this.$refs.gongCheng); + this.$refs.gongCheng?.init() } }, } diff --git a/pages/index/mine.vue b/pages/index/mine.vue index 70744e8..571fb5a 100644 --- a/pages/index/mine.vue +++ b/pages/index/mine.vue @@ -81,7 +81,7 @@ 关注工程配置 - + 服务内容配置 diff --git a/pages/mine/serverSetting.vue b/pages/mine/serverSetting.vue new file mode 100644 index 0000000..827b4ab --- /dev/null +++ b/pages/mine/serverSetting.vue @@ -0,0 +1,123 @@ + + + + +