complaintList.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view style="padding: 24rpx;">
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  4. <view class="list x-f" v-for="(item,index) in dataList" :key="index">
  5. <view class="image">
  6. <image :src="item.images?item.images.split(',')[0]:''" mode="aspectFill" style="width: 100%;height: 100%;"></image>
  7. <view class="tag" :style="{backgroundColor: item.isProcessCompleted==1? '#eee': item.isHandlePlatform==0&&item.isHandleStore==0 ? 'red':'#2583EB', color: item.isProcessCompleted==1? '#666':'#fff'}">
  8. {{item.isProcessCompleted==1? '已结束':item.isHandlePlatform==0&&item.isHandleStore==0 ? '待处理':'已处理'}}
  9. </view>
  10. </view>
  11. <view style="flex: 1;overflow: hidden;" @click="showDetail(item)">
  12. <view class="ellipsis2">{{item.title}}</view>
  13. <view class="x-bc">
  14. <view class="time">{{item.createTime}}</view>
  15. <view class="btn">查看</view>
  16. </view>
  17. </view>
  18. </view>
  19. </mescroll-body>
  20. </view>
  21. </template>
  22. <script>
  23. import {storeComplaintList} from "@/api/user.js"
  24. export default {
  25. data() {
  26. return {
  27. mescroll:null,
  28. // 上拉加载的配置
  29. downOption: { //下拉刷新
  30. use:true,
  31. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  32. },
  33. upOption: {
  34. onScroll:true,
  35. use: true, // 是否启用上拉加载; 默认true
  36. page: {
  37. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  38. size: 10 // 每页数据的数量,默认10
  39. },
  40. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  41. textNoMore: '没有更多了',
  42. empty: {
  43. icon:'/static/images/no_data.png',
  44. tip: '暂无数据'
  45. }
  46. },
  47. // 列表数据
  48. dataList: []
  49. }
  50. },
  51. onShow() {
  52. this.mescroll.resetUpScroll()
  53. },
  54. methods: {
  55. showDetail(item) {
  56. uni.navigateTo({
  57. url:'/pages_user/complaintListDetail?id='+item.id
  58. })
  59. },
  60. mescrollInit(mescroll) {
  61. this.mescroll = mescroll;
  62. },
  63. /*下拉刷新的回调 */
  64. downCallback(mescroll) {
  65. mescroll.resetUpScroll()
  66. },
  67. upCallback(page) {
  68. //联网加载数据
  69. var that = this;
  70. var data = {
  71. status:this.status,
  72. page: page.num,
  73. pageSize: page.size
  74. };
  75. storeComplaintList(data).then(res => {
  76. if(res.code==200){
  77. //设置列表数据
  78. if (page.num == 1) {
  79. that.dataList = res.rows;
  80. } else {
  81. that.dataList = that.dataList.concat(res.rows);
  82. }
  83. that.mescroll.endBySize(res.rows.length, res.total);
  84. }else{
  85. uni.showToast({
  86. icon:'none',
  87. title: "请求失败",
  88. });
  89. that.dataList = null;
  90. that.mescroll.endErr();
  91. }
  92. });
  93. },
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .time {
  99. font-size: 28rpx;
  100. color: #888;
  101. }
  102. .btn{
  103. margin-top: 16rpx;
  104. padding: 8rpx 20rpx;
  105. font-size: 26upx;
  106. font-family: PingFang SC;
  107. font-weight: 500;
  108. text-align: center;
  109. border-radius: 32upx;
  110. border: 1rpx solid #2583EB;
  111. color: #2583EB;
  112. }
  113. .list {
  114. background: #FFFFFF;
  115. border-radius: 16rpx 16rpx 16rpx 16rpx;
  116. padding: 24rpx;
  117. overflow: hidden;
  118. font-size: 30rpx;
  119. margin-bottom: 24rpx;
  120. .image {
  121. flex-shrink: 0;
  122. width: 150rpx;
  123. height: 150rpx;
  124. background-color: #eee;
  125. position: relative;
  126. border-radius: 16rpx 16rpx 16rpx 16rpx;
  127. overflow: hidden;
  128. margin-right: 24rpx;
  129. }
  130. .tag {
  131. position: absolute;
  132. top: 0;
  133. left: 0;
  134. padding: 5rpx 6rpx;
  135. font-size: 20rpx;
  136. color: #FFFFFF;
  137. background-color: red;
  138. border-radius: 16rpx 0 16rpx 0;
  139. }
  140. }
  141. </style>