index.vue 4.1 KB

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