videoList.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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">
  6. <view class="cu-avatar round lg" :style="`background-image:url(${item.imgUrl})`" style="opacity:.7"></view>
  7. <view class="content">
  8. <view class="">{{item.title}}</view>
  9. </view>
  10. <view class="nav-right num">
  11. <view v-if="item.status=='在线'" class="online" >
  12. {{item.status}}
  13. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  14. </view>
  15. <view v-else-if="item.status=='离线'" class="text-gray" >
  16. {{item.status}}
  17. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  18. </view>
  19. <view v-else="item.status=='异常'" class="error" >
  20. {{item.status}}
  21. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. deviceData: [{
  33. status: '离线',
  34. imgUrl: '../../static/video-icon-off.png',
  35. title: 'C59360332',
  36. num: 6
  37. }, {
  38. status: '在线',
  39. imgUrl: '../../static/video-icon-on.png',
  40. title: 'C59360332',
  41. num: 11
  42. },
  43. {
  44. status: '异常',
  45. imgUrl: '../../static/video-icon-error.png',
  46. title: 'C59360332',
  47. num: 6
  48. }
  49. ],
  50. modalName: null,
  51. };
  52. },
  53. onLoad:function(option){
  54. this.getVideoList({'company_code':uni.getStorageSync('selectedCode')})
  55. },
  56. methods: {
  57. // 视频列表数据请求
  58. async getVideoList(params = {}) {
  59. const res = await this.$myRequest({
  60. url: 'VideoMonitoring/getVideoList',
  61. data:params,
  62. showLoading: true
  63. })
  64. this.getData=res.data.data;
  65. console.log(this.getData)
  66. },
  67. goVideoDetail() {
  68. uni.navigateTo({
  69. url: '/pages/videoList/videoDetail/videoDetail',
  70. success: res => {},
  71. fail: () => {},
  72. complete: () => {}
  73. });
  74. },
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. </style>