siteList.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="site-wrapper">
  3. <!-- 站点列表start -->
  4. <view class="site-items" :style="[{top:CustomBar + 'px'}]">
  5. <view class="cu-list menu-avatar">
  6. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in siteListData"
  7. :key="index" :data-target="'move-box-' + index">
  8. <view class="cu-avatar round lg" v-if="type==1" style="background-image: url(../../static/site-icon-alarm.png);"></view>
  9. <view class="cu-avatar round lg" v-else style="background-image: url(../../static/site-icon.png);"></view>
  10. <view class="content" v-if="type==1" @tap="goAlarmingList">
  11. <view class="text-grey site-tit">
  12. {{item.siteName}}
  13. <text>(共3个未处理告警)</text>
  14. </view>
  15. </view>
  16. <view class="content" v-else @tap="goDeviceType">
  17. <view class="text-grey site-tit">
  18. {{item.siteName}}
  19. <text>(共3个设备)</text>
  20. </view>
  21. </view>
  22. <view class="nav-right num">
  23. <view class="text-grey">
  24. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 站点列表end -->
  31. </view>
  32. </template>
  33. <script>
  34. import json from '../../data/json.js';
  35. export default {
  36. data() {
  37. return {
  38. type: '0',
  39. siteListData: json.siteListData,
  40. modalName: null,
  41. listTouchStart: 0,
  42. listTouchDirection: null,
  43. CustomBar: this.CustomBar,
  44. };
  45. },
  46. onLoad: function(option) {
  47. console.log(option.type); //打印出上个页面传递的参数。
  48. this.type = option.type;
  49. },
  50. methods: {
  51. // 页面跳转
  52. goAlarmingList() {
  53. uni.navigateTo({
  54. url: '/pages/alarmingList/alarmingList',
  55. success: res => {},
  56. fail: () => {},
  57. complete: () => {}
  58. });
  59. },
  60. goDeviceType() {
  61. uni.navigateTo({
  62. url: '/pages/deviceType/deviceType',
  63. success: res => {},
  64. fail: () => {},
  65. complete: () => {}
  66. });
  67. },
  68. }
  69. }
  70. </script>
  71. <style>
  72. </style>