readcount.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <input placeholder="请输入姓名进行搜索" v-model="text"/>
  15. <view class="btn" @click="getConfirm">搜索</view>
  16. </view>
  17. </view>
  18. <view class="flexcj conttips">
  19. <view class="toptip">当前统计人数共<text>274</text>人</view>
  20. <view class="topsort" @click="tallflag=!tallflag">
  21. {{tallflag?"从高到低":"从低到高"}}
  22. <view class="imgs" v-if="tallflag">
  23. <image :src="up"></image><image :src="downa"></image>
  24. </view>
  25. <view class="imgs" v-else>
  26. <image :src="upa"></image><image :src="down"></image>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- <view class="tabtop flexc">
  31. <view class="tabt" :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx" @click="getTabFn(ite.val)">{{ite.tit}}</view>
  32. </view> -->
  33. </view>
  34. <!-- 列表 -->
  35. <view class="carlists">
  36. <car-list :datainfo="list" :topval="tabval" :wtdt="wtdt" type='readcount' @getDetail="getDetail"></car-list>
  37. </view>
  38. <loading></loading>
  39. </view>
  40. </template>
  41. <script>
  42. import config from '@/config'
  43. const baseUrl = config.baseUrl
  44. import carList from "@/manage/components/car/list.vue"
  45. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  46. export default{
  47. components:{carList},
  48. data(){
  49. return{
  50. reset:require('@/car/static/car/reset.png'),
  51. search:require('@/car/static/car/search.png'),
  52. up:require('@/manage/static/community/up.png'),
  53. upa:require('@/manage/static/community/upa.png'),
  54. down:require('@/manage/static/community/down.png'),
  55. downa:require('@/manage/static/community/downa.png'),
  56. cxrq:"",
  57. text:'',
  58. list:[{tit:'皖A IC520',type:1,right:0},{tit:'晋E KD783',type:2,right:0},],
  59. pageSize: 10,
  60. pageNum: 1,
  61. reachflag: true,
  62. wtdt:'',
  63. tallflag:true,
  64. tabval:'0',
  65. tablist:[{tit:'全部',val:0},{tit:'待回复',val:1},{tit:'已回复',val:2},{tit:'已完成',val:2}]
  66. }
  67. },
  68. onLoad: function() {
  69. },
  70. // 上拉触底加载更多触发事件
  71. onReachBottom() {
  72. if (this.reachflag) {
  73. this.pageNum++
  74. this.getDataFn()
  75. }
  76. },
  77. methods:{
  78. checkPermi, checkRole,
  79. getDetail(){
  80. this.$tab.navigateTo("/service/pages/service/complaintdetail")
  81. },
  82. getConfirm(){
  83. this.getrefreshData()
  84. },
  85. getReset(){
  86. this.cxrq='';
  87. this.text='';
  88. this.getrefreshData()
  89. },
  90. getrefreshData(){
  91. this.pageNum=1;
  92. this.list=[];
  93. this.reachflag=true;
  94. this.getDataFn()
  95. },
  96. getTabFn(val){
  97. this.tabval=val
  98. },
  99. bindDateChangea(e){
  100. var val=e.detail.value;
  101. this.cxrq=val;
  102. },
  103. getDataFn(){
  104. var params={
  105. pageSize:this.pageSize,
  106. pageNum: this.pageNum,
  107. }
  108. params.noticeType=this.tabidx
  109. getNoticeList(params).then(res=>{
  110. if(res.code==200){
  111. if (res.rows.length < this.pageSize) {
  112. this.reachflag = false
  113. this.wtdt = '到底了~';
  114. } else {
  115. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  116. if (num < res.total) {
  117. this.reachflag = true
  118. this.wtdt = ''
  119. } else {
  120. this.reachflag = false
  121. this.wtdt = '到底了~';
  122. }
  123. }
  124. var newArr=JSON.parse(JSON.stringify(res.rows))
  125. newArr.forEach(ite=>{
  126. ite.right=0;
  127. })
  128. // console.log(newArr,555)
  129. if (this.pageNum == 1) {
  130. this.list = newArr;
  131. } else {
  132. this.list = this.list.concat(newArr)
  133. }
  134. }else{
  135. this.$toast(res.msg)
  136. }
  137. })
  138. },
  139. }
  140. }
  141. </script>
  142. <style>
  143. page{background: #F3F3F0;}
  144. </style>
  145. <style lang="scss" scoped>
  146. .car{padding: 172rpx 0 0rpx;}
  147. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  148. .topa{padding: 20rpx;padding-bottom: 30rpx;
  149. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  150. .chekt{min-width: 180rpx;
  151. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  152. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  153. }
  154. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  155. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  156. input{flex: 1;font-size: 26rpx;color: #272727;}
  157. .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
  158. font-size: 26rpx;
  159. color: #FFFFFF;}
  160. }
  161. }
  162. .tabtop{padding-bottom: 40rpx;padding-top: 24rpx;
  163. .tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;padding: 0 40rpx;
  164. &.act{font-weight: bold;font-size: 32rpx;color: #272727;
  165. &::after{content: '';width: 40rpx;height: 10rpx;background: #0156FE;border-radius: 6rpx;position: absolute;left: 50%;margin-left: -20rpx;bottom: -10rpx;}
  166. }
  167. }
  168. }
  169. }
  170. .conttips{padding: 18rpx 32rpx;background: #F3F3F0;}
  171. .toptip{font-weight: 500;font-size:26rpx;color: #666666; line-height: 36rpx;
  172. text{color: #4671ED;display: inline-block;font-weight: bold;padding: 0 6rpx;}
  173. }
  174. .topsort{font-size: 26rpx;color: #FE5A0E;display: flex;align-items: center;
  175. .imgs{margin-left: 8rpx;height: 34rpx;display: flex;align-items: center;
  176. image{width: 12rpx;height: 20rpx;margin-left: 4rpx;}
  177. }
  178. }
  179. .carlists{padding: 0 18rpx;}
  180. </style>