myComplaint.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="container">
  3. <!-- 投诉列表区域 -->
  4. <view class="body">
  5. <!-- 每一个投诉订单区域 -->
  6. <view class="box" v-for="item in list" :key="item.id" @click="handleGoPage(item)">
  7. <!-- 标题区域 -->
  8. <view class="box_header">
  9. <view class="header_left">{{ item.title }}</view>
  10. <view class="header_right">{{ item.progressType }}</view>
  11. </view>
  12. <!-- 信息区域 -->
  13. <view class="box_info">
  14. <img mode="aspectFill" :src="item.url" />
  15. <view class="info_center">
  16. <view class="center_name">{{ item.hotelName }}</view>
  17. <view class="center_time">{{ item.orderStartTime.slice(0, 10) }} - {{ item.orderEndTime.slice(0, 10) }}</view>
  18. <view class="center_tags">{{ item.houseOrderNumber }}间 {{ item.houseName }}</view>
  19. <view class="center_price">¥{{ item.payAccount }}</view>
  20. </view>
  21. <view class="info_right">{{ item.orderStatus }}</view>
  22. </view>
  23. <!-- 反馈时间区域 -->
  24. <view class="box_time">
  25. <view class="time_left">反馈时间</view>
  26. <view class="time_right">{{ item.dateTime }}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="noData" v-if="list.length === 0">
  31. <img lazy-load :lazy-load-margin="0" src="../../static/images/noData.png" />
  32. 暂无数据
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. // 投诉列表数据
  41. list: [],
  42. // 当前页
  43. page: 1,
  44. // 每页多少条
  45. rows: 6,
  46. // 总条数
  47. total: null
  48. }
  49. },
  50. onLoad() {
  51. this.getData()
  52. },
  53. onReachBottom() {
  54. if (this.list.length < this.total) {
  55. this.page++
  56. this.getData()
  57. } else {
  58. uni.showToast({
  59. title: '没有更多数据了',
  60. icon: 'none'
  61. })
  62. }
  63. },
  64. methods: {
  65. async getData() {
  66. const res = await this.$myRequest({
  67. url: '/mhotel/complaintcomplaintPage.action',
  68. data: {
  69. usersId: uni.getStorageSync('userInfo').id,
  70. page: this.page,
  71. rows: this.rows
  72. }
  73. })
  74. // console.log(res)
  75. if (res.code === 200 && res.page.pageList) {
  76. this.total = res.page.total
  77. this.list = [...this.list, ...res.page.pageList]
  78. }
  79. },
  80. // 点击每一个投诉订单的回调
  81. handleGoPage(item) {
  82. uni.navigateTo({
  83. url: `/pages/complaintProgress/complaintProgress?id=${item.id}`
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .container {
  91. box-sizing: border-box;
  92. padding: 20rpx;
  93. min-height: 100vh;
  94. overflow-y: auto;
  95. background-color: #f7f7f7;
  96. .body {
  97. .box {
  98. box-sizing: border-box;
  99. padding: 0 20rpx 0 30rpx;
  100. margin-bottom: 20rpx;
  101. width: 710rpx;
  102. height: 390rpx;
  103. border-radius: 15rpx;
  104. background-color: #fff;
  105. .box_header {
  106. display: flex;
  107. justify-content: space-between;
  108. align-items: center;
  109. height: 98rpx;
  110. border-bottom: 1rpx solid #e6e6e6;
  111. .header_left {
  112. flex: 4;
  113. font-size: 32rpx;
  114. font-weight: bold;
  115. overflow: hidden;
  116. text-overflow: ellipsis;
  117. white-space: nowrap;
  118. }
  119. .header_right {
  120. flex: 1;
  121. font-size: 28rpx;
  122. color: #808080;
  123. text-align: end;
  124. }
  125. }
  126. .box_info {
  127. display: flex;
  128. margin: 34rpx 0 27rpx 0;
  129. height: 143rpx;
  130. img {
  131. width: 143rpx;
  132. height: 143rpx;
  133. border-radius: 9rpx;
  134. }
  135. .info_center {
  136. flex: 1;
  137. display: flex;
  138. flex-direction: column;
  139. justify-content: space-between;
  140. margin-top: -5rpx;
  141. margin-left: 17rpx;
  142. height: 150rpx;
  143. color: #808080;
  144. font-size: 24rpx;
  145. overflow: hidden;
  146. .center_name {
  147. font-size: 28rpx;
  148. font-weight: bold;
  149. color: #000;
  150. overflow: hidden;
  151. text-overflow: ellipsis;
  152. white-space: nowrap;
  153. }
  154. .center_time {
  155. }
  156. .center_tags {
  157. }
  158. .center_price {
  159. }
  160. }
  161. .info_right {
  162. width: 185rpx;
  163. text-align: end;
  164. font-size: 24rpx;
  165. color: #808080;
  166. }
  167. }
  168. .box_time {
  169. display: flex;
  170. align-items: center;
  171. height: 58rpx;
  172. font-size: 24rpx;
  173. border-radius: 9rpx;
  174. background-color: #f2f2f2;
  175. .time_left {
  176. margin: 0 20rpx;
  177. }
  178. .time_right {
  179. color: #808080;
  180. }
  181. }
  182. }
  183. }
  184. .noData {
  185. display: flex;
  186. flex-direction: column;
  187. justify-content: center;
  188. align-items: center;
  189. padding-bottom: 20rpx;
  190. img {
  191. margin-top: 160rpx;
  192. width: 600rpx;
  193. height: 600rpx;
  194. }
  195. }
  196. }
  197. </style>