list-test.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="site-wrapper" ref="contentWrapper">
  3. <!-- 筛选框start -->
  4. <view class="ding">
  5. <view class="cu-bar search bg-gray filter-section">
  6. <view class="search-form round bg-white">
  7. <text class="cuIcon-search"></text>
  8. <input class="" @focus="InputFocus" @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入站点名称"
  9. confirm-type="search"></input>
  10. </view>
  11. <view class="action">
  12. <button class="cu-btn bg-blue round">查询</button>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 筛选框end -->
  17. <!-- 站点列表start -->
  18. <view class="site-items">
  19. <view class="cu-list menu-avatar">
  20. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in nowData"
  21. :key="index" :data-target="'move-box-' + index">
  22. <view class="cu-avatar round lg" v-bind:style="{ 'background-image': 'url(' + nowIcon+ ')' }"></view>
  23. <view class="content" @tap="goNowUrl" v-if="nowType==0">
  24. <view class="text-grey site-tit">
  25. {{item.siteName}}
  26. <text>
  27. ({{nowNum}})
  28. </text>
  29. </view>
  30. </view>
  31. <view class="content" v-else @tap="goNowUrl" @longpress="showDetail(item)">
  32. <view class="text-grey site-tit">
  33. {{item.siteName}}
  34. <text>(共3个设备)</text>
  35. </view>
  36. <view class="showDetail" v-if="item.isShow" @tap.stop="goSiteDetail" >查看详情</view>
  37. </view>
  38. <view class="nav-right num">
  39. <view class="text-grey">
  40. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 站点列表end -->
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. // name: 'listTest',
  52. props:{
  53. bindType:{
  54. type:Number,
  55. default: ''
  56. },
  57. bindData:{
  58. type:Array,
  59. default: ''
  60. },
  61. bindUrl:{
  62. type:String,
  63. default: ''
  64. },
  65. bindIcon:{
  66. type:String,
  67. default: ''
  68. },
  69. bindNum:{
  70. type:String,
  71. default: ''
  72. },
  73. },
  74. data() {
  75. return {
  76. modalName: null,
  77. nowData:this.bindData,
  78. nowUrl:this.bindUrl,
  79. nowIcon:this.bindIcon,
  80. nowNum:this.bindNum,
  81. nowType:this.bindType
  82. };
  83. },
  84. onPullDownRefresh() {
  85. console.log('refresh');
  86. setTimeout(function() {
  87. uni.stopPullDownRefresh();
  88. }, 1000);
  89. },
  90. methods:{
  91. // 页面跳转
  92. goNowUrl() {
  93. uni.navigateTo({
  94. url: this.nowUrl,
  95. success: res => {},
  96. fail: () => {},
  97. complete: () => {}
  98. });
  99. },
  100. InputFocus(e) {
  101. this.InputBottom = e.detail.height
  102. },
  103. InputBlur(e) {
  104. this.InputBottom = 0
  105. },
  106. }
  107. }
  108. </script>
  109. <style>
  110. </style>