feedback.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view>
  3. <!-- 头部 -->
  4. <view class="head">
  5. <view class="location">
  6. 评价信箱<image class="loc" src="../../static/letter.svg" mode=""></image>
  7. </view>
  8. </view>
  9. <!-- 订单 -->
  10. <view class="main">
  11. <view class="content-list" v-for="(item,index) in feedbackList" :key="index">
  12. <text class="num">订单号:{{item.orderId}}</text>
  13. <view class="list">
  14. <view class="">
  15. 故障类型:{{item.repairsFault.faultName}}
  16. </view>
  17. <view class="p">
  18. 来自 {{item.repairsStudent.dormNumber}} 的评价:
  19. </view>
  20. <view class="text">
  21. {{item.orderAdvice}}
  22. </view>
  23. </view>
  24. </view>
  25. <view class="isOver" v-if="flag">
  26. ----我是有底线的----
  27. </view>
  28. <view class="isOver" v-if="feedbackList.length==0">
  29. ----暂无评价----
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. feedbackList: [],
  39. pageNum: 1,
  40. pageSize: 4,
  41. total: "",
  42. flag: false,
  43. }
  44. },
  45. onLoad() {
  46. this.getfeedback()
  47. },
  48. methods: {
  49. // 获取评价列表数据
  50. async getfeedback() {
  51. let res = await this.$myRequest({
  52. method: "post",
  53. url: `/order/queryAllOrderByUserAdvice?pageNum=${this.pageNum}&pageSize=${this.pageSize}`,
  54. })
  55. // console.log(res)
  56. if (res.status == 200) {
  57. this.total = res.data.total
  58. this.feedbackList = [...this.feedbackList, ...res.data.list]
  59. uni.hideLoading()
  60. } else {
  61. uni.hideLoading()
  62. }
  63. },
  64. // 下拉页面刷新函数
  65. onPullDownRefresh() {
  66. this.flag = false
  67. this.feedbackList = []
  68. this.pageNum = 1
  69. this.getfeedback()
  70. setTimeout(() => {
  71. uni.stopPullDownRefresh();
  72. }, 1000);
  73. },
  74. // 上拉触底加载更多数据
  75. onReachBottom() {
  76. if (this.feedbackList.length < this.total) {
  77. uni.showLoading({
  78. title: "数据加载中"
  79. })
  80. this.pageNum++
  81. this.getfeedback()
  82. } else {
  83. this.flag = true
  84. }
  85. },
  86. }
  87. }
  88. </script>
  89. <style>
  90. template {
  91. position: relative;
  92. }
  93. .main {
  94. position: relative;
  95. top: -192rpx;
  96. }
  97. .head {
  98. height: 300rpx;
  99. border-radius: 0rpx 0rpx 20rpx 20rpx;
  100. background-color: rgba(42, 130, 228, 1);
  101. }
  102. .head .location {
  103. padding-top: 36rpx;
  104. font-size: 30rpx;
  105. font-weight: bold;
  106. text-align: center;
  107. color: rgba(255, 255, 255, 1);
  108. }
  109. .loc {
  110. width: 40rpx;
  111. height: 40rpx;
  112. font-size: 42rpx;
  113. vertical-align: middle;
  114. }
  115. .num {
  116. float: left;
  117. margin-left: 20rpx;
  118. margin-top: 18rpx;
  119. font-size: 22rpx;
  120. font-weight: 700;
  121. color: rgba(42, 130, 228, 1);
  122. }
  123. .got {
  124. float: right;
  125. margin-top: 18rpx;
  126. margin-right: 18rpx;
  127. color: rgba(212, 48, 48, 1);
  128. }
  129. .list {
  130. float: left;
  131. margin-left: 42rpx;
  132. margin-top: 18rpx;
  133. font-size: 22rpx;
  134. color: rgba(80, 80, 80, 1);
  135. }
  136. .p {
  137. margin-top: 16rpx;
  138. }
  139. .list .text {
  140. width: 484rpx;
  141. height: 108rpx;
  142. margin-top: 30rpx;
  143. margin-left: 50rpx;
  144. text-align: center;
  145. line-height: 108rpx;
  146. background-color: rgba(255, 255, 255, 1);
  147. }
  148. .content-list {
  149. width: 720rpx;
  150. height: 346rpx;
  151. float: left;
  152. margin-left: 16rpx;
  153. margin-top: 22rpx;
  154. border-radius: 28rpx 28rpx 0rpx 0rpx;
  155. background-color: rgba(229, 229, 229, 1);
  156. }
  157. .isOver {
  158. width: 100%;
  159. height: 120rpx;
  160. line-height: 120rpx;
  161. text-align: center;
  162. font-size: 28rpx;
  163. color: rgba(80, 80, 80, 0.27);
  164. }
  165. </style>