123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <view class="page">
- <view class="newsDetail">
- <view class="n-d1">
- <text class="t1"></text>
- <text class="t2">告警信息</text>
- </view>
- <view class="n-d2">
- <text>告警对象</text>
- <text class="t2">{{dataObj.alarmFor}}</text>
- </view>
- <view class="n-d2">
- <text>告警内容</text>
- <text class="t2">{{dataObj.discernResult}}</text>
- </view>
- <view class="n-d2">
- <text>告警等级</text>
- <text class="t2">{{dataObj.alarmLevel | alarmLevel}}</text>
- </view>
- <view class="n-d2">
- <text>告警时间</text>
- <text class="t2">{{dataObj.createTime}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {readMsg,getReadNum} from '@/common/api.js'
- export default {
- data() {
- return {
- dataObj:{}
- }
- },
- filters:{
- alarmLevel(val){
- return val == 1 ? '预警' :val == 2 ?'一般告警': val == 3 ? '严重告警' : val == 4 ?'危急告警' :'正常'
- }
- },
- mounted() {
- var that = this;
- this.dataObj = uni.getStorageSync("newsDetailxjapp")
- readMsg({
- msgId:this.dataObj.id
- }).then(res =>{
- getReadNum({
- userId: that.$store.state.Token
- }).then(res => {
- if(res==0){
- uni.hideTabBarRedDot({ //隐藏红点
- index: 2
- })
- }else{
- uni.showTabBarRedDot({ //显示红点
- index: 2
- })
- }
- }).catch(e => {
- console.log(e)
- })
- console.log(res)
- }).catch(e =>{
- console.log(e)
- })
-
- },
- methods: {
- }
- }
- </script>
- <style scoped lang="scss">
- .page {
- background: #F9F9F9;
- height:calc(100vh - 30rpx);
- padding-top:30rpx ;
- }
- .newsDetail {
- background: #fff;
- margin:0rpx 18rpx 50rpx 18rpx;
- border-radius: 20rpx;
- padding: 38rpx 38rpx 0 38rpx;
- .n-d2{
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 30rpx;
- height: 90rpx;
- line-height: 90rpx;
- border-bottom: 1rpx solid #E5E5E5;
- color: #666666;
- .t2{
- font-weight: bold;
- color: #333;
- }
- &:last-child{
- border: none;
- }
- }
- .n-d1 {
- margin-bottom: 20rpx;
- .t1 {
- width: 7rpx;
- height: 24rpx;
- background: #0581FD;
- border-radius: 3px;
- display: inline-block;
- margin-right: 10rpx;
- }
- .t2 {
- font-size: 32rpx;
- color: #000;
- font-weight: bold;
- }
- }
- }
- </style>
|