diff --git a/api/warn/message.js b/api/warn/message.js new file mode 100644 index 0000000..3b5b177 --- /dev/null +++ b/api/warn/message.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询系统消息中心列表 +export function listMessage(query) { + return request({ + url: '/warn/message/list', + method: 'get', + params: query + }) +} + +// 查询系统消息中心详细 +export function getMessage(id) { + return request({ + url: '/warn/message/' + id, + method: 'get' + }) +} + +// 新增系统消息中心 +export function addMessage(data) { + return request({ + url: '/warn/message', + method: 'post', + data: data + }) +} + +// 修改系统消息中心 +export function updateMessage(data) { + return request({ + url: '/warn/message', + method: 'put', + data: data + }) +} + +// 删除系统消息中心 +export function delMessage(id) { + return request({ + url: '/warn/message/' + id, + method: 'delete' + }) +} diff --git a/pages.json b/pages.json index b43855d..7ec1c97 100644 --- a/pages.json +++ b/pages.json @@ -24,19 +24,27 @@ { "path": "pages/data/index", "style": { - "navigationBarTitleText": "数据中心" + "navigationBarTitleText": "数据中心", +// "navigationBarBackgroundColor": "pink", +// "navigationBarTextStyle": "white", + "navigationBarShadow": { +// grey、blue、green、orange、red、yellow + "colorType": "red" + } + } + }, + { + "path": "pages/data/indexDemo", + "style": { + "navigationBarTitleText": "数据中心11" } }, -// { -// "path": "pages/data/indexDemo", -// "style": { -// "navigationBarTitleText": "数据中心11" -// } -// }, { "path": "pages/news/index", "style": { - "navigationBarTitleText": "消息中心" + "navigationBarTitleText": "消息中心", + "navigationStyle": "custom", + "disableScroll": true } }, { @@ -92,12 +100,36 @@ "root": "pages/data", "pages": [ ] - }, - { - "root": "pages/news", - "pages": [ - ] },*/ + { + "root": "pages/news/subpages", + "pages": [ + { + "path": "sysNotice/index", + "style": { + "navigationBarTitleText": "系统公告" + } + }, + { + "path": "eventCenter/index", + "style": { + "navigationBarTitleText": "活动中心" + } + }, + { + "path": "videoCenter/index", + "style": { + "navigationBarTitleText": "视频中心" + } + }, + { + "path": "deviceCenter/index", + "style": { + "navigationBarTitleText": "设备状态" + } + } + ] + }, { "root": "pages/work", "pages": [ @@ -187,12 +219,12 @@ "selectedIconPath": "static/images/tabbar/data_.png", "text": "历史数据" }, -// { -// "pagePath": "pages/data/indexDemo", -// "iconPath": "static/images/tabbar/data.png", -// "selectedIconPath": "static/images/tabbar/data_.png", -// "text": "历史数据" -// }, + { + "pagePath": "pages/data/indexDemo", + "iconPath": "static/images/tabbar/data.png", + "selectedIconPath": "static/images/tabbar/data_.png", + "text": "历史数据" + }, { "pagePath": "pages/news/index", "iconPath": "static/images/tabbar/news.png", diff --git a/pages/news/index.vue b/pages/news/index.vue index adf315b..77e1fb0 100644 --- a/pages/news/index.vue +++ b/pages/news/index.vue @@ -24,12 +24,14 @@ - - - - 系统通知未开启,报警消息无法通知 + + + + + 系统通知未开启,报警消息无法通知 + + 去开启 - 去开启 @@ -103,6 +105,7 @@ export default { data() { return { title: '消息中心', + isShowTips: true, isShowNumBadge: true, messageList: [ { @@ -143,18 +146,13 @@ export default { // iconBg: '#FFA726', title: '活动中心', desc: '没有新的消息', - time: Date.now()-9900000, + time: Date.now()-119900000, badge: false, numBadge: 25, // 无值则不显示 width: '100rpx' } ], - options: [{ - text: '置顶', - style: { - backgroundColor: '#FFA726' - } - }, + options: [ { text: '删除', style: { @@ -167,32 +165,36 @@ export default { methods: { isTodayDate, navBack() { + // 消息推送设置 this.showDrawer('showLeft'); - console.log('点击消息中心') + console.log('点击消息中心:消息推送设置') }, clearUnread() { + // 全部已读 this.$modal.showToast('模块建设中~') - console.log('清除未读') + console.log('清除未读:当前页面全部已读') }, openSetting() { + // 当前页面勿扰模式设置 this.$modal.showToast('模块建设中~') - console.log('打开通知设置') + console.log('打开通知设置:当前页面勿扰模式设置') }, goToOpen() { this.$modal.showToast('模块建设中~') - console.log('去开启系统通知') + console.log('去开启系统通知:同左侧消息中心') }, goToClose() { + this.isShowTips = false this.$modal.showToast('模块建设中~') - console.log('关闭系统通知') + console.log('关闭系统通知提示') }, goToSubscribe() { this.$modal.showToast('模块建设中~') - console.log('进入消息订阅') + console.log('进入消息订阅:暂未开发') }, goToAI() { this.$modal.showToast('模块建设中~') - console.log('进入AI识别') + console.log('进入AI识别:暂未开发') }, handleItemClick(item) { this.$modal.showToast('敬请期待~') @@ -203,11 +205,12 @@ export default { this.$tab.navigateTo('/pages/news/subpages/eventCenter/index'); } else if (item.title === '视频中心') { this.$tab.navigateTo('/pages/news/subpages/videoCenter/index'); + } else if (item.title === '设备状态') { + this.$tab.navigateTo('/pages/news/subpages/deviceCenter/index'); } }, deleteItem(event, index) { - this.$modal.showToast('敬请期待~') - console.log('删除消息:', event, index) + this.$modal.showToast('敬请期待~,删除当前消息') }, // 打开窗口 showDrawer(e) { @@ -288,12 +291,14 @@ export default { } } +.notice-out { + margin: 20rpx 30rpx; +} /* 系统通知提示条 */ .notice-bar { display: flex; align-items: center; justify-content: space-between; - margin: 20rpx 30rpx; padding: 20rpx; background-color: #FFF3E0; border-radius: 12rpx; diff --git a/pages/news/subpages/deviceCenter/index.vue b/pages/news/subpages/deviceCenter/index.vue new file mode 100644 index 0000000..5ac13a9 --- /dev/null +++ b/pages/news/subpages/deviceCenter/index.vue @@ -0,0 +1,208 @@ + + + + + \ No newline at end of file