complaintList.vue 3.3 KB

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