diff --git a/App.vue b/App.vue index 3b08fca..dd11ebe 100644 --- a/App.vue +++ b/App.vue @@ -5,6 +5,10 @@ export default { }, onShow: function () { console.log('App Show') + uni.setTabBarBadge({ + index: 1, + text: '6' + }) }, onHide: function () { console.log('App Hide') @@ -15,6 +19,15 @@ export default { diff --git a/common/css/base.scss b/common/css/base.scss index 5f42551..227cb6c 100644 --- a/common/css/base.scss +++ b/common/css/base.scss @@ -109,3 +109,31 @@ page { } } + +.index { + + .header { + margin: 0 30rpx; + background: $uni-theme-white; + border-radius: 12rpx; + background: $uni-color-primary; + padding: 30rpx 10rpx 40rpx; + display: grid; + grid-gap: 60rpx 0; + grid-template-columns: 1fr 1fr 1fr; + + .header-item { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + color: #fff; + font-size: 28rpx; + + .header-item-value { + font-size: 40rpx; + margin-bottom: 10rpx; + } + } + } +} \ No newline at end of file diff --git a/common/js/cacheKey.js b/common/js/cacheKey.js new file mode 100644 index 0000000..9c82364 --- /dev/null +++ b/common/js/cacheKey.js @@ -0,0 +1,4 @@ +export default { + config: 'config', // 全剧配置 + userInfo: 'userInfo', // 用户信息 +} \ No newline at end of file diff --git a/common/js/util.js b/common/js/util.js index 2a50b96..6e231af 100644 --- a/common/js/util.js +++ b/common/js/util.js @@ -1,5 +1,5 @@ import request from './request' -import config from './config.js' +import cache from './cacheKey.js' const toast = (title, duration = 1500, call, mask = false, icon = 'none') => { if (Boolean(title) === false) { return diff --git a/main.js b/main.js index de198f4..d660026 100644 --- a/main.js +++ b/main.js @@ -3,12 +3,14 @@ import App from './App' import util from './common/js/util' import request from './common/js/request' import config from './common/js/config' +import cacheKey from './common/js/cacheKey' import Vue from 'vue' import share from "@/common/js/share.js"; Vue.config.productionTip = false Vue.prototype.$request = request Vue.prototype.$util = util Vue.prototype.$config = config +Vue.prototype.$cacheKey = cacheKey Vue.mixin(share); App.mpType = 'app' const app = new Vue({ diff --git a/pages.json b/pages.json index bc6a77e..e6e671e 100644 --- a/pages.json +++ b/pages.json @@ -8,9 +8,9 @@ } }, { - "path": "pages/index/report", + "path": "pages/index/message", "style": { - "navigationBarTitleText": "告警" + "navigationBarTitleText": "消息" } }, { @@ -156,6 +156,24 @@ "style": { "navigationBarTitleText": "通过网关添加设备" } + }, + { + "path": "pages/message/incident", + "style": { + "navigationBarTitleText": "系统消息" + } + }, + { + "path": "pages/message/report", + "style": { + "navigationBarTitleText": "告警" + } + }, + { + "path": "pages/message/system", + "style": { + "navigationBarTitleText": "事件" + } } ], "tabBar": { @@ -173,10 +191,10 @@ "text": "首页" }, { - "pagePath": "pages/index/report", - "iconPath": "static/report.png", - "selectedIconPath": "static/report2.png", - "text": "告警" + "pagePath": "pages/index/message", + "iconPath": "static/notice.png", + "selectedIconPath": "static/notice2.png", + "text": "消息" }, { "pagePath": "pages/index/mine", diff --git a/pages/index/comp/indexGongCheng.vue b/pages/index/comp/indexGongCheng.vue new file mode 100644 index 0000000..cc9ddfe --- /dev/null +++ b/pages/index/comp/indexGongCheng.vue @@ -0,0 +1,42 @@ + + + \ No newline at end of file diff --git a/pages/index/comp/indexYunWei.vue b/pages/index/comp/indexYunWei.vue new file mode 100644 index 0000000..9df94c7 --- /dev/null +++ b/pages/index/comp/indexYunWei.vue @@ -0,0 +1,42 @@ + + + \ No newline at end of file diff --git a/pages/index/comp/indexZhuYongHu.vue b/pages/index/comp/indexZhuYongHu.vue new file mode 100644 index 0000000..ad21acf --- /dev/null +++ b/pages/index/comp/indexZhuYongHu.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/pages/index/comp/indexZhuanZhi.vue b/pages/index/comp/indexZhuanZhi.vue new file mode 100644 index 0000000..bb5b4eb --- /dev/null +++ b/pages/index/comp/indexZhuanZhi.vue @@ -0,0 +1,48 @@ + + + \ No newline at end of file diff --git a/pages/index/comp/indexZiYongHu.vue b/pages/index/comp/indexZiYongHu.vue new file mode 100644 index 0000000..02b5b5a --- /dev/null +++ b/pages/index/comp/indexZiYongHu.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 63c7a35..b66230c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,27 +2,17 @@ -
-
-
-
3
-
正常设备
-
-
-
1
-
报警设备
-
-
-
0
-
离线设备
-
-
-
- - 设备基础信息 - - + + + + + + + + + + +
@@ -30,18 +20,57 @@
\ No newline at end of file diff --git a/pages/index/mine.vue b/pages/index/mine.vue index 315c925..4c4faed 100644 --- a/pages/index/mine.vue +++ b/pages/index/mine.vue @@ -5,7 +5,7 @@ 灿能电力 - 工程 + {{roleName}} @@ -14,10 +14,9 @@ 角色升级 --> - - - 个人消息 + + + 子用户列表 diff --git a/pages/message/incident.vue b/pages/message/incident.vue new file mode 100644 index 0000000..98f0bf8 --- /dev/null +++ b/pages/message/incident.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/pages/index/report.vue b/pages/message/report.vue similarity index 66% rename from pages/index/report.vue rename to pages/message/report.vue index 0f7dcce..98f0bf8 100644 --- a/pages/index/report.vue +++ b/pages/message/report.vue @@ -1,7 +1,8 @@