complaintList.vue 3.8 KB

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