newsDetail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="page">
  3. <view class="newsDetail">
  4. <view class="n-d1">
  5. <text class="t1"></text>
  6. <text class="t2">告警信息</text>
  7. </view>
  8. <view class="n-d2">
  9. <text>告警对象</text>
  10. <text class="t2">{{dataObj.alarmFor}}</text>
  11. </view>
  12. <view class="n-d2">
  13. <text>告警内容</text>
  14. <text class="t2">{{dataObj.discernResult}}</text>
  15. </view>
  16. <view class="n-d2">
  17. <text>告警等级</text>
  18. <text class="t2">{{dataObj.alarmLevel | alarmLevel}}</text>
  19. </view>
  20. <view class="n-d2">
  21. <text>告警时间</text>
  22. <text class="t2">{{dataObj.createTime}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {readMsg,getReadNum} from '@/common/api.js'
  29. export default {
  30. data() {
  31. return {
  32. dataObj:{}
  33. }
  34. },
  35. filters:{
  36. alarmLevel(val){
  37. return val == 1 ? '预警' :val == 2 ?'一般告警': val == 3 ? '严重告警' : val == 4 ?'危急告警' :'正常'
  38. }
  39. },
  40. mounted() {
  41. var that = this;
  42. this.dataObj = uni.getStorageSync("newsDetailxjapp")
  43. readMsg({
  44. msgId:this.dataObj.id
  45. }).then(res =>{
  46. getReadNum({
  47. userId: that.$store.state.Token
  48. }).then(res => {
  49. if(res==0){
  50. uni.hideTabBarRedDot({ //隐藏红点
  51. index: 2
  52. })
  53. }else{
  54. uni.showTabBarRedDot({ //显示红点
  55. index: 2
  56. })
  57. }
  58. }).catch(e => {
  59. console.log(e)
  60. })
  61. console.log(res)
  62. }).catch(e =>{
  63. console.log(e)
  64. })
  65. },
  66. methods: {
  67. }
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .page {
  72. background: #F9F9F9;
  73. height:calc(100vh - 30rpx);
  74. padding-top:30rpx ;
  75. }
  76. .newsDetail {
  77. background: #fff;
  78. margin:0rpx 18rpx 50rpx 18rpx;
  79. border-radius: 20rpx;
  80. padding: 38rpx 38rpx 0 38rpx;
  81. .n-d2{
  82. display: flex;
  83. align-items: center;
  84. justify-content: space-between;
  85. font-size: 30rpx;
  86. height: 90rpx;
  87. line-height: 90rpx;
  88. border-bottom: 1rpx solid #E5E5E5;
  89. color: #666666;
  90. .t2{
  91. font-weight: bold;
  92. color: #333;
  93. }
  94. &:last-child{
  95. border: none;
  96. }
  97. }
  98. .n-d1 {
  99. margin-bottom: 20rpx;
  100. .t1 {
  101. width: 7rpx;
  102. height: 24rpx;
  103. background: #0581FD;
  104. border-radius: 3px;
  105. display: inline-block;
  106. margin-right: 10rpx;
  107. }
  108. .t2 {
  109. font-size: 32rpx;
  110. color: #000;
  111. font-weight: bold;
  112. }
  113. }
  114. }
  115. </style>