readlist.vue 5.1 KB

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