vlist.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="car">
  3. <!-- 列表 -->
  4. <view class="carlists">
  5. <box-list :datainfo="list" :wtdt="wtdt" type='visitor' @getDetail="getDetail"></box-list>
  6. </view>
  7. <loading></loading>
  8. </view>
  9. </template>
  10. <script>
  11. import config from '@/config'
  12. const baseUrl = config.baseUrl
  13. import boxList from "@/work/components/box/list.vue"
  14. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  15. export default{
  16. components:{boxList},
  17. data(){
  18. return{
  19. // reset:require('@/work/static/car/reset.png'),
  20. // search:require('@/work/static/car/search.png'),
  21. // up:require('@/work/static/car/up.png'),
  22. cxrq:"",
  23. text:'',
  24. list:[{tit:'皖A IC520',type:1},{tit:'晋E KD783',type:2},],
  25. pageSize: 10,
  26. pageNum: 1,
  27. reachflag: true,
  28. wtdt:'',
  29. }
  30. },
  31. onLoad: function() {
  32. },
  33. // 上拉触底加载更多触发事件
  34. onReachBottom() {
  35. if (this.reachflag) {
  36. this.pageNum++
  37. this.getDataFn()
  38. }
  39. },
  40. methods:{
  41. checkPermi, checkRole,
  42. getDetail(){
  43. this.$tab.navigateTo("/work/pages/visitor/vdetail")
  44. },
  45. getConfirm(){
  46. this.getrefreshData()
  47. },
  48. getReset(){
  49. this.cxrq='';
  50. this.text='';
  51. this.getrefreshData()
  52. },
  53. getrefreshData(){
  54. this.pageNum=1;
  55. this.list=[];
  56. this.reachflag=true;
  57. this.getDataFn()
  58. },
  59. getTabFn(val){
  60. this.tabval=val
  61. },
  62. bindDateChangea(e){
  63. var val=e.detail.value;
  64. this.cxrq=val;
  65. },
  66. getDataFn(){
  67. var params={
  68. pageSize:this.pageSize,
  69. pageNum: this.pageNum,
  70. }
  71. params.noticeType=this.tabidx
  72. getNoticeList(params).then(res=>{
  73. if(res.code==200){
  74. if (res.rows.length < this.pageSize) {
  75. this.reachflag = false
  76. this.wtdt = '到底了~';
  77. } else {
  78. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  79. if (num < res.total) {
  80. this.reachflag = true
  81. this.wtdt = ''
  82. } else {
  83. this.reachflag = false
  84. this.wtdt = '到底了~';
  85. }
  86. }
  87. if (this.pageNum == 1) {
  88. this.list = res.rows;
  89. } else {
  90. this.list = this.list.concat(res.rows)
  91. }
  92. }else{
  93. this.$toast(res.msg)
  94. }
  95. })
  96. },
  97. }
  98. }
  99. </script>
  100. <style>
  101. page{background: #F3F3F0;}
  102. </style>
  103. <style lang="scss" scoped>
  104. .car{padding: 24rpx 0 10rpx;}
  105. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  106. .topa{padding: 20rpx ;
  107. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  108. .chekt{min-width: 180rpx;
  109. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  110. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  111. }
  112. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  113. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  114. input{flex: 1;font-size: 26rpx;color: #272727;}
  115. .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
  116. font-size: 26rpx;
  117. color: #FFFFFF;}
  118. }
  119. }
  120. .tabtop{padding-bottom: 40rpx;padding-top: 26rpx;
  121. .tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;padding: 0 40rpx;
  122. &.act{font-weight: bold;font-size: 32rpx;color: #272727;
  123. &::after{content: '';width: 40rpx;height: 10rpx;background: #0156FE;border-radius: 6rpx;position: absolute;left: 50%;margin-left: -20rpx;bottom: -10rpx;}
  124. }
  125. }
  126. }
  127. }
  128. .carlists{padding: 0 18rpx;}
  129. </style>