house.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 mode="date" @change='bindDateChangea'>
  7. <view class="chekt flexc">
  8. <view>{{cxrq|| "选择日期"}}</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 class="tabtop flexc">
  20. <view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
  21. </view>
  22. </view>
  23. <!-- 列表 -->
  24. <view class="carlists">
  25. <car-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='comehouse'></car-list>
  26. </view>
  27. <view class="cdbtns">
  28. <view class="btna" @click="getAddFn">单个添加</view>
  29. <view class="btnb" @click="getReplyFn">一键导入</view>
  30. </view>
  31. <loading></loading>
  32. </view>
  33. </template>
  34. <script>
  35. import config from '@/config'
  36. const baseUrl = config.baseUrl
  37. import carList from "@/work/components/car/list.vue"
  38. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  39. export default{
  40. components:{carList},
  41. data(){
  42. return{
  43. reset:require('@/work/static/car/reset.png'),
  44. search:require('@/work/static/car/search.png'),
  45. up:require('@/work/static/car/up.png'),
  46. cxrq:"",
  47. text:'',
  48. list:[{tit:'皖A IC520',type:1},{tit:'晋E KD783',type:2},],
  49. pageSize: 10,
  50. pageNum: 1,
  51. reachflag: true,
  52. wtdt:'',
  53. ttopval:'0',
  54. ttoplist:[{tit:'全部',val:0},{tit:'业主',val:1},{tit:'租户',val:2}]
  55. }
  56. },
  57. onLoad: function() {
  58. },
  59. // 上拉触底加载更多触发事件
  60. onReachBottom() {
  61. if (this.reachflag) {
  62. this.pageNum++
  63. this.getDataFn()
  64. }
  65. },
  66. methods:{
  67. checkPermi, checkRole,
  68. getAddFn(){
  69. this.$tab.navigateTo("/work/pages/manage/houseadd")
  70. },
  71. getTabtop(val){
  72. this.ttopval=val
  73. },
  74. getConfirm(){
  75. this.getrefreshData()
  76. },
  77. getReset(){
  78. this.cxrq='';
  79. this.text='';
  80. this.getrefreshData()
  81. },
  82. getrefreshData(){
  83. this.pageNum=1;
  84. this.list=[];
  85. this.reachflag=true;
  86. this.getDataFn()
  87. },
  88. getTabFn(val){
  89. this.tabval=val
  90. },
  91. bindDateChangea(e){
  92. var val=e.detail.value;
  93. this.cxrq=val;
  94. },
  95. getDataFn(){
  96. var params={
  97. pageSize:this.pageSize,
  98. pageNum: this.pageNum,
  99. }
  100. params.noticeType=this.tabidx
  101. getNoticeList(params).then(res=>{
  102. if(res.code==200){
  103. if (res.rows.length < this.pageSize) {
  104. this.reachflag = false
  105. this.wtdt = '到底了~';
  106. } else {
  107. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  108. if (num < res.total) {
  109. this.reachflag = true
  110. this.wtdt = ''
  111. } else {
  112. this.reachflag = false
  113. this.wtdt = '到底了~';
  114. }
  115. }
  116. if (this.pageNum == 1) {
  117. this.list = res.rows;
  118. } else {
  119. this.list = this.list.concat(res.rows)
  120. }
  121. }else{
  122. this.$toast(res.msg)
  123. }
  124. })
  125. },
  126. }
  127. }
  128. </script>
  129. <style>
  130. page{background: #F3F3F0;}
  131. </style>
  132. <style lang="scss" scoped>
  133. .car{padding: 224rpx 0 110rpx;}
  134. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  135. .topa{padding: 20rpx ;
  136. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  137. .chekt{min-width: 180rpx;
  138. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  139. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  140. }
  141. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  142. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  143. input{flex: 1;font-size: 26rpx;color: #272727;}
  144. .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
  145. font-size: 26rpx;
  146. color: #FFFFFF;}
  147. }
  148. }
  149. .tabtop{padding-bottom: 40rpx;
  150. .tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;padding: 0 40rpx;margin-right: 6rpx;
  151. &.act{font-weight: bold;font-size: 32rpx;color: #272727;
  152. &::after{content: '';width: 40rpx;height: 10rpx;background: #0156FE;border-radius: 6rpx;position: absolute;left: 50%;margin-left: -20rpx;bottom: -10rpx;}
  153. }
  154. }
  155. }
  156. }
  157. .cdbtns{position: fixed;left: 0;right: 0;height: 98rpx;z-index: 2;display: flex;align-items: center;bottom: 0;
  158. view{flex: 1;display: flex;align-items: center;justify-content: center;font-weight: bold;font-size: 26rpx;height: 98rpx;
  159. &.btna{background: #FFFFFF;color: #0156FE;}
  160. &.btnb{background: #0156FE;color: #FFFFFF;}
  161. }
  162. }
  163. .carlists{padding: 0 18rpx;}
  164. </style>