processList.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="processWrapper ">
  3. <!-- <cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="backText">返回</block><block slot="content">布局</block></cu-custom>
  4. --> <view class="ding">
  5. <scroll-view scroll-x class="bg-white nav text-center" >
  6. <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav" :key="index" @tap="tabSelect"
  7. :data-id="index">
  8. <view class="cu-tag badge">
  9. <block class="cu-tag badge" v-if="item.badge!=1">99</block>
  10. </view>
  11. {{tabNav[index]}}
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <block v-if="TabCur==0">
  16. <view class="processList" >
  17. <view class="cu-list menu-avatar ">
  18. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  19. <view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
  20. <view class="content">
  21. <view class="pro-title">
  22. <view class="cut">{{item.title}}</view>
  23. </view>
  24. <view class="pro-des ">
  25. <view class="text-cut">
  26. {{item.subTitle}}
  27. </view>
  28. </view>
  29. <view class="pro-date ">{{item.time}}</view>
  30. </view>
  31. <view class="action">
  32. <view class="unProcess" v-if="type==1" @tap="goUnprocessDetail">{{item.status}}</view>
  33. <view class="unProcess" v-else @tap="goVideoUnprocessDetail">{{item.status}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </block>
  39. <block v-if="TabCur==1">
  40. <view class="processList">
  41. <view class="cu-list menu-avatar ">
  42. <view class="cu-item" v-for="(item,index) in processedList" :key="index" >
  43. <view class="cu-avatar lg" style="background-image:url(../../static/processed-icon.png);"></view>
  44. <view class="content">
  45. <view class="pro-title">
  46. <view class="cut">{{item.title}}</view>
  47. </view>
  48. <view class="pro-des ">
  49. <view class="text-cut">
  50. {{item.subTitle}}
  51. </view>
  52. </view>
  53. <view class="pro-date ">{{item.time}}</view>
  54. </view>
  55. <view class="action">
  56. <view class="processed" v-if="type==1" @tap="goProcessedDetail">{{item.status}}</view>
  57. <view class="processed"v-else @tap="goVideoProcessedDetail">{{item.status}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </block>
  63. </view>
  64. </template>
  65. <script>
  66. import json from '../../data/json.js';
  67. export default {
  68. data() {
  69. return {
  70. unporcessList: json.unprocessList,
  71. processedList: json.processedList,
  72. type: '0',
  73. modalName: null,
  74. listTouchStart: 0,
  75. listTouchDirection: null,
  76. CustomBar: this.CustomBar,
  77. TabCur: 0,
  78. tabNav: ['未处理', '已处理']
  79. };
  80. },
  81. onLoad: function(option) {
  82. console.log(option.type); //打印出上个页面传递的参数。
  83. this.type = option.type;
  84. if (option.type == 1) {
  85. uni.setNavigationBarTitle({
  86. title: '电力检测'
  87. });
  88. } else {
  89. uni.setNavigationBarTitle({
  90. title: '视频告警'
  91. });
  92. }
  93. },
  94. methods: {
  95. tabSelect(e) {
  96. this.TabCur = e.currentTarget.dataset.id;
  97. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
  98. },
  99. // 页面跳转
  100. goUnprocessDetail() {
  101. uni.navigateTo({
  102. url: '/pages/unprocessDetail/unprocessDetail?type=1',
  103. success: res => {},
  104. fail: () => {},
  105. complete: () => {}
  106. });
  107. },
  108. goProcessedDetail() {
  109. uni.navigateTo({
  110. url: '/pages/processedDetail/processedDetail?type=1',
  111. success: res => {},
  112. fail: () => {},
  113. complete: () => {}
  114. });
  115. },
  116. goVideoUnprocessDetail() {
  117. uni.navigateTo({
  118. url: '/pages/unprocessDetail/unprocessDetail?type=2',
  119. success: res => {},
  120. fail: () => {},
  121. complete: () => {}
  122. });
  123. },
  124. goVideoProcessedDetail() {
  125. uni.navigateTo({
  126. url: '/pages/processedDetail/processedDetail?type=2',
  127. success: res => {},
  128. fail: () => {},
  129. complete: () => {}
  130. });
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. //已处理未处理消息个数样式
  137. .nav .cu-item.cur {
  138. position: relative;
  139. border-bottom: 8rpx solid;
  140. }
  141. .cu-tag.badge {
  142. top: 14rpx;
  143. right: 96rpx;
  144. }
  145. .nav .cu-item {
  146. width: 50%;
  147. margin: 0;
  148. .text-blue,
  149. .line-blue,
  150. .lines-blue {
  151. color: #4274E7
  152. }
  153. }
  154. </style>