videoList.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
  5. :key="index" :data-target="'move-box-' + index" @tap="goVideoDetail(item)">
  6. <view v-if="item.trueStatus==0" class="cu-avatar round lg" style="background-image:url(../../static/video-icon-on.png);opacity:.7" ></view>
  7. <view v-else class="cu-avatar round lg" style="background-image:url(../../static/video-icon-off.png);opacity:.7" ></view>
  8. <view class="content">
  9. <view class="">{{item.deviceName}}</view>
  10. </view>
  11. <view class="nav-right num">
  12. <view v-if="item.trueStatus==1" class="offline" >
  13. 离线
  14. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  15. </view>
  16. <view v-else class="online">
  17. 在线
  18. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. deviceData: [
  30. // {
  31. // status: '离线',
  32. // imgUrl: '../../static/video-icon-off.png',
  33. // title: 'C59360332',
  34. // num: 6
  35. // }, {
  36. // status: '在线',
  37. // imgUrl: '../../static/video-icon-on.png',
  38. // title: 'C59360332',
  39. // num: 11
  40. // },
  41. // {
  42. // status: '异常',
  43. // imgUrl: '../../static/video-icon-error.png',
  44. // title: 'C59360332',
  45. // num: 6
  46. // }
  47. ],
  48. modalName: null,
  49. };
  50. },
  51. onLoad:function(option){
  52. console.log(111)
  53. console.log(option.companyCode)
  54. this.companyCode=option.companyCode
  55. this.deviceType=option.deviceType
  56. this.getDeviceManage({"companyCode":option.companyCode,"deviceType":option.deviceType})
  57. },
  58. methods: {
  59. async getDeviceManage(ming={}) {
  60. const res= await this.$myRequest({
  61. url:'OperationMonitoring/getDeviceList',
  62. data:ming
  63. })
  64. console.log(res.data.data)
  65. this.deviceData=res.data.data
  66. // this.powerDeviceCount= res.data.data[0].powerDeviceCount
  67. // this.videoDeviceCount= res.data.data[0].videoDeviceCount
  68. },
  69. goVideoDetail(item) {
  70. uni.navigateTo({
  71. url: '/pages/videoDetail/videoDetail?deviceType=2&companyCode='+this.companyCode+'&deviceCode='+item.deviceCode+'',
  72. success: res => {},
  73. fail: () => {},
  74. complete: () => {}
  75. });
  76. },
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. </style>