index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="container">
  3. <uni-nav-bar title="理赔进度" backgroundColor='#03803B' color="#fff" left-icon="left" fixed statusBar
  4. @clickLeft='goBack()' @clickRight="addDetails">
  5. <block slot="right">
  6. <view>
  7. <image class="nav-right" src="@/static/images/home/claim/add.png" />
  8. </view>
  9. </block>
  10. </uni-nav-bar>
  11. <scroll-view scroll-y="true" :refresher-enabled="true" :refresher-triggered="triggered"
  12. @scrolltolower="loadMore" @refresherrefresh="onRefresh" class="scroll-view" :scroll-top="scrollTop"
  13. @scroll="handleScroll" enable-back-to-top>
  14. <view class="list">
  15. <u-empty v-if='dataList.length==0' mode="list">
  16. </u-empty>
  17. <view class="tab-bar-item" v-for="(item, index) in dataList" :key="index" @click="inEdit(item)">
  18. <view class="list-item">
  19. <view style="font-weight: 800;">
  20. {{item.claimNo}}
  21. </view>
  22. <view style="color: #B5B4B4;">
  23. {{item.submitTime}}
  24. </view>
  25. </view>
  26. <view class="list-item">
  27. <view style="font-weight: 800;color: #03803B;">
  28. {{item.vehicleNumber||'暂无车牌'}}
  29. </view>
  30. <view class="">
  31. 轮胎规格: {{item.tyreSpecs||'-'}}
  32. </view>
  33. </view>
  34. <view class="list-item-end">
  35. <view class="">
  36. 轮胎:{{item.tireQuantity||0}}条
  37. </view>
  38. <view style="display: flex;align-items: center;color: #03803B;">
  39. <image style="width: 32rpx;height: 32rpx;margin-right: 18rpx;"
  40. src="@/static/images/home/claim/ap.png" />
  41. <text v-if="item.auditStatus==0" style="color:#e6a23c">
  42. 待审核
  43. </text>
  44. <text v-if="item.auditStatus==1" style="color:#409EFF">
  45. 审核中
  46. </text>
  47. <text v-if="item.auditStatus==2" style="color:#67c23a">
  48. 已通过
  49. </text>
  50. <text v-if="item.auditStatus==3" style="color:#f56c6c">
  51. 已拒绝
  52. </text>
  53. </view>
  54. </view>
  55. </view>
  56. <view v-if="loading" class="loading">加载中...</view>
  57. <view v-if="noMore" class="no-more">没有更多数据了</view>
  58. </view>
  59. </scroll-view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. getList
  65. } from '@/api/home/claim.js'
  66. export default {
  67. data() {
  68. return {
  69. triggered: false,
  70. searchValue: null,
  71. page: {
  72. current: 1,
  73. size: 10,
  74. total: 0,
  75. },
  76. dataList: [],
  77. loading: false,
  78. noMore: false,
  79. scrollTop: 0,
  80. oldScrollTop: 0
  81. }
  82. },
  83. onLoad() {
  84. this.getList()
  85. },
  86. // onReachBottom() {
  87. // console.log(this.noMore)
  88. // if (!this.noMore) {
  89. // this.page.current += 1
  90. // this.getList()
  91. // }
  92. // },
  93. filters: {
  94. statusMap(value) {
  95. const statusList = ['待审核', '审核中', '已通过', '已拒绝']
  96. return statusList[value] || '未知状态'
  97. }
  98. },
  99. methods: {
  100. handleScroll(e) {
  101. this.oldScrollTop = e.detail.scrollTop
  102. },
  103. loadMore() {
  104. if (!this.noMore) {
  105. this.page.current += 1
  106. this.getList()
  107. }
  108. },
  109. onRefresh() {
  110. if (this.triggered) return;
  111. this.triggered = true;
  112. this.noMore = false;
  113. // 模拟异步请求
  114. setTimeout(() => {
  115. this.page.current = 1
  116. this.dataList = []
  117. this.getList()
  118. }, 500);
  119. },
  120. addDetails() {
  121. uni.navigateTo({
  122. url: '/pages/home/claim/details'
  123. });
  124. },
  125. inEdit(row) {
  126. uni.navigateTo({
  127. url: '/pages/home/claim/details?id=' + row.id,
  128. });
  129. },
  130. getList() {
  131. const obj = {
  132. current: this.page.current,
  133. size: this.page.size
  134. }
  135. this.loading = true
  136. uni.showLoading({
  137. title: '加载中',
  138. mask: true
  139. });
  140. getList(obj).then(res => {
  141. this.dataList = [...this.dataList, ...res.data.records]
  142. console.log(this.dataList.length)
  143. if (res.data.total <= this.dataList.length) {
  144. this.noMore = true
  145. }
  146. })
  147. .finally(() => {
  148. uni.hideLoading()
  149. this.loading = false
  150. this.triggered = false
  151. });
  152. },
  153. goBack() {
  154. uni.navigateBack({
  155. delta: 1,
  156. });
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .scroll-view {
  163. flex: 1;
  164. height: 100%;
  165. /* 关键样式:防止内容被裁剪 */
  166. overflow-anchor: none;
  167. }
  168. .container {
  169. height: 100vh;
  170. display: flex;
  171. flex-direction: column;
  172. }
  173. .loading,
  174. .no-more {
  175. text-align: center;
  176. padding: 20px;
  177. color: #999;
  178. }
  179. .uni-lastmsg {
  180. width: 80rpx;
  181. white-space: nowrap;
  182. overflow: hidden;
  183. text-overflow: ellipsis;
  184. display: block;
  185. /* 需明确设置display */
  186. }
  187. .uni-lastmsg2 {
  188. width: 140rpx;
  189. white-space: nowrap;
  190. overflow: hidden;
  191. text-overflow: ellipsis;
  192. display: block;
  193. /* 需明确设置display */
  194. }
  195. .nav-right {
  196. width: 37rpx;
  197. height: 42rpx;
  198. }
  199. .list {
  200. width: 100%;
  201. .tab-bar-item {
  202. background-color: #fff;
  203. margin-top: 30rpx;
  204. padding: 0rpx 62rpx;
  205. font-size: 28rpx;
  206. line-height: 32rpx;
  207. color: #5F5F5F;
  208. font-weight: 400;
  209. .list-item {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. width: 100%;
  214. height: 100rpx;
  215. border-bottom: 2px solid #F6F6F6;
  216. }
  217. .list-item-end {
  218. display: flex;
  219. justify-content: space-between;
  220. align-items: center;
  221. width: 100%;
  222. height: 100rpx;
  223. }
  224. }
  225. }
  226. </style>