123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <template name="camera">
- <view>
- <scroll-view>
- <!-- 综合报表 -->
- <view class="cu-bar bg-white solid-bottom" :style="[{animation: 'show 0.6s 1'}]">
- <view class="action">
- <text class='cuIcon-title text-yellow'></text>综合报表
- </view>
- </view>
- <!-- 通风设备 -->
- <view class="cu-bar bg-white solid-bottom margin-top" :style="[{animation: 'show 0.5s 1'}]">
- <view class="action">
- <text class='cuIcon-title text-blue'></text>通风设备
- </view>
- </view>
-
-
- <!-- 防灭火设备 -->
- <view class="cu-bar bg-white solid-bottom margin-top" :style="[{animation: 'show 0.6s 1'}]">
- <view class="action">
- <text class='cuIcon-title text-yellow'></text>防灭火设备
- </view>
- </view>
- <!-- 防尘设备 -->
- <view class="cu-bar bg-white solid-bottom margin-top" :style="[{animation: 'show 0.6s 1'}]">
- <view class="action">
- <text class='cuIcon-title text-yellow'></text>防尘设备
- </view>
- </view>
- </scroll-view>
- <view class="cu-tabbar-height margin-top"></view>
- </view>
- </template>
- <script>
- import { us,os } from '@/common/util/work.js'
- import socket from '@/common/js-sdk/socket/socket.js'
- export default {
- name: 'camera',
- props:{
- cur:String,
- },
- watch: {
- cur: {
- immediate: true,
- handler:function(val,oldVal){
- console.log('cur',val,oldVal)
- this.initMenu()
- },
- },
- },
- data() {
- return {
- }
- },
- methods: {
- initMenu(){
- console.log("-----------home------------")
- this.onSocketOpen()
- this.onSocketReceive()
- this.loadCount(0);
- },
- goPage(page){
- if(!page){
- return false;
- }
- if(page==='annotationList'){
- this.msgCount = 0
- }
- this.dot[page]=false
- this.$Router.push({name: page})
- },
- // 启动webSocket
- onSocketOpen() {
- socket.init('websocket');
- },
- onSocketReceive() {
- var _this=this
- socket.acceptMessage = function(res){
- // console.log("页面收到的消息", res);
- if(res.cmd == "topic"){
- //系统通知
- _this.loadCount('1')
- }else if(res.cmd == "user"){
- //用户消息
- _this.loadCount('2')
- } else if(res.cmd == 'email'){
- //邮件消息
- _this.loadEmailCount()
- }
- }
- },
- loadCount(flag){
- console.log("loadCount::flag",flag)
- let url = '/sys/annountCement/listByUser';
- this.$http.get(url).then(res=>{
- console.log("res::",res)
- if(res.data.success){
- let msg1Count = res.data.result.anntMsgTotal;
- let msg2Count = res.data.result.sysMsgTotal;
- this.msgCount = msg1Count + msg2Count
- console.log("this.msgCount",this.msgCount)
- }
- })
- },
- loadEmailCount(){
- this.dot.mailHome = true
- },
- getTtemDotInfo(item){
- if(item.page==='annotationList' && this.msgCount>0){
- return this.msgCount
- }
- return '';
- }
- }
- }
- </script>
- <style scoped>
- .cu-list.grid>.cu-item {
- padding: 0px 0px;
- }
- .line2-icon {
- width: 60px;
- height: 60px;
- }
-
- </style>
|