complaint.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="content">
  3. <view class="tab-menu">
  4. <view :class="orderState==0?'tab-item active':'tab-item'" @click="orderStatus(0)">全部</view>
  5. <view :class="orderState==1?'tab-item active':'tab-item'" @click="orderStatus(1)">已受理</view>
  6. <view :class="orderState==2?'tab-item active':'tab-item'" @click="orderStatus(2)">已回复</view>
  7. </view>
  8. <view class="order-body">
  9. <z-paging ref="paging" show-refresher-update-time v-model="dataList" @query="queryList" :fixed="false">
  10. <navigator hover-class="none" :url="'/pages/user/complaint/detail?id='+item.id" class="order-item" v-for="(item,indx) in dataList" :key="indx">
  11. <view class="order-info">
  12. <view class="info-item">
  13. <view class="name">订单编号</view>
  14. <view class="item-content">{{ item.order_sn }}</view>
  15. </view>
  16. <view class="info-item">
  17. <view class="name">投诉事项</view>
  18. <view class="item-content">{{ item.question }}</view>
  19. </view>
  20. <view class="order-status" v-if="item.status == 0">
  21. <image src="https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/complaint-2.svg"></image>
  22. </view>
  23. <view class="order-status" v-if="item.status == 1">
  24. <image src="https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/complaint-3.svg"></image>
  25. </view>
  26. </view>
  27. <view class="order-footer">
  28. <view class="footer-l">{{item.create_at}}</view>
  29. <view class="footer-r">
  30. <view class="btn danger">查看详情</view>
  31. </view>
  32. </view>
  33. </navigator>
  34. </z-paging>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. var app;
  40. import * as Api from "@/static/api/complaint.js";
  41. export default {
  42. data() {
  43. return {
  44. listState:false,
  45. orderState:0,
  46. dataList:[],
  47. storeData:null
  48. }
  49. },
  50. onLoad() {
  51. app = this;
  52. app.storeData = uni.getStorageSync("contact");
  53. },
  54. methods: {
  55. orderStatus(state) {
  56. app.orderState = state;
  57. app.dataList = [];
  58. app.queryList(1,10)
  59. },
  60. queryList(pageNo, pageSize){
  61. var formData = {};
  62. var token = uni.getStorageSync("user_token")
  63. if (!token) {
  64. return false;
  65. }
  66. var poiId = uni.getStorageSync("poiId");
  67. formData.page = pageNo;
  68. formData.size = pageSize;
  69. formData.status = app.orderState;
  70. formData.poi = poiId;
  71. app.listState = true;
  72. Api.list(formData).then((res)=>{
  73. app.listState = false;
  74. uni.hideLoading();
  75. if (res.code !== 1) {
  76. this.$refs.paging.complete(false);
  77. return app.$dialog.showSuccess(res.msg);
  78. }
  79. app.$refs.paging.complete(res.data.rows);
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style>
  86. .order-info{position: relative;}
  87. .order-info .order-status{position: absolute;right: 20upx;top: 20upx;}
  88. .order-info .order-status image{width: 120upx;height: 120upx;transform: rotate(45deg);}
  89. .order-info .name{font-size: 28upx;color: #666;padding: 20upx 0;}
  90. .order-info .item-content{font-size: 28upx;color: #000;}
  91. .order-info .item-content .order-status{font-size: 28upx;color: #f00;}
  92. .order-info .item-content .order-status.success{color: #007aff;}
  93. .content{height: 100vh;background-color: #f8f8f8;}
  94. .content .tab-menu{height: 80upx;line-height: 80upx;background-color: #fff;display: flex;align-items: center;font-size: 28upx;color: #666;justify-content: space-around;}
  95. .content .tab-menu .tab-item{position: relative;}
  96. .content .tab-menu .tab-item.active{color: #007aff;}
  97. .content .tab-menu .tab-item.active::after{position: absolute;content: "";width: 30%;left: 35%;height: 4upx;bottom: 0;background-color: #007aff;}
  98. .content .order-body{height: calc(100vh - 100upx); }
  99. .order-item{background-color: #fff;padding: 0 20upx;border-radius: 10upx;width: calc(95% - 40upx);margin: 20upx auto;}
  100. .order-item .item-header{display: flex;align-items: center;height: 60upx;line-height: 60upx;}
  101. .order-item .item-header .order-status{font-size: 28upx;color: #f00;}
  102. .order-item .item-header .order-status.success{color: #007aff;}
  103. .order-item .item-header .order-time{font-size: 24upx;color: #999;margin-left: auto;margin-right: 0;}
  104. .order-footer{display: flex;text-align: right;padding: 20upx 0;border-top: 2upx solid #f8f8f8;align-items: center;}
  105. .order-footer .footer-l{font-size: 28upx;color: #666;}
  106. .order-footer .footer-r{display: flex;margin-left: auto;margin-right: 0;flex: 1;justify-content: end;gap: 20upx;}
  107. .order-footer .btn{width: 160upx;height: 60upx;line-height: 60upx;text-align: center;border: 2upx solid #ccc;color: #333;font-size: 28upx;border-radius: 10upx;}
  108. .order-footer .btn.danger{border:2upx solid #f00;color: #f00;}
  109. .order-footer .btn.blue{border:2upx solid #007aff;color: #007aff;}
  110. .empty-body{display: flex;align-items: center;justify-content: center;flex-direction: column;height: calc(100vh - 100upx);}
  111. .empty-body .img{text-align: center;font-size: 28upx;color: #666;}
  112. .empty-body .img image{height: 160upx;width: 160upx;}
  113. .empty-body .img .tip{margin-top: 20upx;}
  114. .empty-body .re-btn{width: 180upx;height: 80upx;line-height: 80upx;text-align: center;font-size: 28upx;color: #fff;background-color: #007aff;border-radius: 10upx;margin-top: 60upx;}
  115. </style>