index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="car">
  3. <view class="cartop">
  4. <view class="topa flexc">
  5. <!-- <image :src="reset" class="resetimg" @click="getReset"></image>
  6. <picker range-key='dictLabel' :range="jclxlist" @change='bindDateChangea'>
  7. <view class="chekt flexc">
  8. <view class="over">{{sfxx|| "选择身份"}}</view>
  9. <image :src="up"></image>
  10. </view>
  11. </picker> -->
  12. <view class="search flexc">
  13. <image :src="search"></image>
  14. <!-- confirm-type="search" @confirm="getConfirm" -->
  15. <input placeholder="请输入房号或人员姓名进行搜索" v-model="text"/>
  16. <view class="btn" @click="getConfirm">搜索</view>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 列表 -->
  21. <view class="carlists">
  22. <box-list :datainfo="list" :wtdt="wtdt" type='people' @getDetail="getDetail"></box-list>
  23. </view>
  24. <view class="rfbtn bg45">添加</view>
  25. <loading></loading>
  26. </view>
  27. </template>
  28. <script>
  29. import config from '@/config'
  30. const baseUrl = config.baseUrl
  31. import boxList from "@/health/components/box/list.vue"
  32. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  33. export default{
  34. components:{boxList},
  35. data(){
  36. return{
  37. // reset:require('@/car/static/car/reset.png'),
  38. // up:require('@/car/static/car/up.png'),
  39. // car:require('@/car/static/car/car.png'),
  40. // cara:require('@/car/static/car/cara.png'),
  41. // carb:require('@/car/static/car/carb.png'),
  42. search:require('@/health/static/health/search.png'),
  43. sfxx:"",
  44. text:'',
  45. jclxlist:[{dictLabel:'党员',dictValue:'0'}],
  46. list:[{tit:'皖A IC520',type:1,hzflag:true,sex:1,zhanflag:false},{tit:'晋E KD783',type:2,hzflag:false,sex:0,zhanflag:false},],
  47. pageSize: 10,
  48. pageNum: 1,
  49. reachflag: true,
  50. wtdt:'',
  51. }
  52. },
  53. onLoad: function() {
  54. },
  55. // 上拉触底加载更多触发事件
  56. onReachBottom() {
  57. if (this.reachflag) {
  58. this.pageNum++
  59. this.getDataFn()
  60. }
  61. },
  62. methods:{
  63. checkPermi, checkRole,
  64. getDetail(){
  65. this.$tab.navigateTo("/health/pages/health/detail")
  66. },
  67. getConfirm(){
  68. this.getrefreshData()
  69. },
  70. getReset(){
  71. this.sfxx='';
  72. this.text='';
  73. this.getrefreshData()
  74. },
  75. getrefreshData(){
  76. this.pageNum=1;
  77. this.list=[];
  78. this.reachflag=true;
  79. this.getDataFn()
  80. },
  81. getTabFn(val){
  82. this.tabval=val
  83. },
  84. bindDateChangea(e){
  85. var val=e.detail.value;
  86. this.sfxx=this.jclxlist[val].dictLabel;
  87. // this.orderFoodType=this.jclxlist[val].dictValue;
  88. },
  89. getDataFn(){
  90. var params={
  91. pageSize:this.pageSize,
  92. pageNum: this.pageNum,
  93. }
  94. params.noticeType=this.tabidx
  95. getNoticeList(params).then(res=>{
  96. if(res.code==200){
  97. if (res.rows.length < this.pageSize) {
  98. this.reachflag = false
  99. this.wtdt = '到底了~';
  100. } else {
  101. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  102. if (num < res.total) {
  103. this.reachflag = true
  104. this.wtdt = ''
  105. } else {
  106. this.reachflag = false
  107. this.wtdt = '到底了~';
  108. }
  109. }
  110. if (this.pageNum == 1) {
  111. this.list = res.rows;
  112. } else {
  113. this.list = this.list.concat(res.rows)
  114. }
  115. }else{
  116. this.$toast(res.msg)
  117. }
  118. })
  119. },
  120. }
  121. }
  122. </script>
  123. <style>
  124. page{background: #F3F3F0;}
  125. </style>
  126. <style lang="scss" scoped>
  127. .car{padding-top: 140rpx;}
  128. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  129. .topa{padding: 20rpx 20rpx 32rpx;
  130. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  131. .chekt{width: 150rpx;overflow: hidden;
  132. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  133. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  134. }
  135. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  136. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  137. input{flex: 1;font-size: 26rpx;color: #272727;}
  138. .btn{width: 100rpx;height: 64rpx;background: #45CB99;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;font-size: 26rpx;color: #FFFFFF;}
  139. }
  140. }
  141. }
  142. .carlists{padding: 0 18rpx;}
  143. </style>