index.vue 3.8 KB

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