123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <view class="container">
- <uni-nav-bar title="理赔进度" backgroundColor='#03803B' color="#fff" left-icon="left" fixed statusBar
- @clickLeft='goBack()' @clickRight="addDetails">
- <block slot="right">
- <view>
- <image class="nav-right" src="@/static/images/home/claim/add.png" />
- </view>
- </block>
- </uni-nav-bar>
- <scroll-view scroll-y="true" :refresher-enabled="true" :refresher-triggered="triggered"
- @scrolltolower="loadMore" @refresherrefresh="onRefresh" class="scroll-view" :scroll-top="scrollTop"
- @scroll="handleScroll" enable-back-to-top>
- <view class="list">
- <u-empty v-if='dataList.length==0' mode="list">
- </u-empty>
- <view class="tab-bar-item" v-for="(item, index) in dataList" :key="index" @click="inEdit(item)">
- <view class="list-item">
- <view style="font-weight: 800;">
- {{item.claimNo}}
- </view>
- <view style="color: #B5B4B4;">
- {{item.submitTime}}
- </view>
- </view>
- <view class="list-item">
- <view style="font-weight: 800;color: #03803B;">
- {{item.vehicleNumber||'暂无车牌'}}
- </view>
- <view class="">
- 轮胎规格: {{item.tyreSpecs||'-'}}
- </view>
- </view>
- <view class="list-item-end">
- <view class="">
- 轮胎:{{item.tireQuantity||0}}条
- </view>
- <view style="display: flex;align-items: center;color: #03803B;">
- <image style="width: 32rpx;height: 32rpx;margin-right: 18rpx;"
- src="@/static/images/home/claim/ap.png" />
- <text v-if="item.auditStatus==0" style="color:#e6a23c">
- 待审核
- </text>
- <text v-if="item.auditStatus==1" style="color:#409EFF">
- 审核中
- </text>
- <text v-if="item.auditStatus==2" style="color:#67c23a">
- 已通过
- </text>
- <text v-if="item.auditStatus==3" style="color:#f56c6c">
- 已拒绝
- </text>
- </view>
- </view>
- </view>
- <view v-if="loading" class="loading">加载中...</view>
- <view v-if="noMore" class="no-more">没有更多数据了</view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- getList
- } from '@/api/home/claim.js'
- export default {
- data() {
- return {
- triggered: false,
- searchValue: null,
- page: {
- current: 1,
- size: 10,
- total: 0,
- },
- dataList: [],
- loading: false,
- noMore: false,
- scrollTop: 0,
- oldScrollTop: 0
- }
- },
- onLoad() {
- this.getList()
- },
- // onReachBottom() {
- // console.log(this.noMore)
- // if (!this.noMore) {
- // this.page.current += 1
- // this.getList()
- // }
- // },
- filters: {
- statusMap(value) {
- const statusList = ['待审核', '审核中', '已通过', '已拒绝']
- return statusList[value] || '未知状态'
- }
- },
- methods: {
- handleScroll(e) {
- this.oldScrollTop = e.detail.scrollTop
- },
- loadMore() {
- if (!this.noMore) {
- this.page.current += 1
- this.getList()
- }
- },
- onRefresh() {
- if (this.triggered) return;
- this.triggered = true;
- this.noMore = false;
- // 模拟异步请求
- setTimeout(() => {
- this.page.current = 1
- this.dataList = []
- this.getList()
- }, 500);
- },
- addDetails() {
- uni.navigateTo({
- url: '/pages/home/claim/details'
- });
- },
- inEdit(row) {
- uni.navigateTo({
- url: '/pages/home/claim/details?id=' + row.id,
- });
- },
- getList() {
- const obj = {
- current: this.page.current,
- size: this.page.size
- }
- this.loading = true
- uni.showLoading({
- title: '加载中',
- mask: true
- });
- getList(obj).then(res => {
- this.dataList = [...this.dataList, ...res.data.records]
- console.log(this.dataList.length)
- if (res.data.total <= this.dataList.length) {
- this.noMore = true
- }
- })
- .finally(() => {
- uni.hideLoading()
- this.loading = false
- this.triggered = false
- });
- },
- goBack() {
- uni.navigateBack({
- delta: 1,
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .scroll-view {
- flex: 1;
- height: 100%;
- /* 关键样式:防止内容被裁剪 */
- overflow-anchor: none;
- }
- .container {
- height: 100vh;
- display: flex;
- flex-direction: column;
- }
- .loading,
- .no-more {
- text-align: center;
- padding: 20px;
- color: #999;
- }
- .uni-lastmsg {
- width: 80rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- display: block;
- /* 需明确设置display */
- }
- .uni-lastmsg2 {
- width: 140rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- display: block;
- /* 需明确设置display */
- }
- .nav-right {
- width: 37rpx;
- height: 42rpx;
- }
- .list {
- width: 100%;
- .tab-bar-item {
- background-color: #fff;
- margin-top: 30rpx;
- padding: 0rpx 62rpx;
- font-size: 28rpx;
- line-height: 32rpx;
- color: #5F5F5F;
- font-weight: 400;
- .list-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- height: 100rpx;
- border-bottom: 2px solid #F6F6F6;
- }
- .list-item-end {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- height: 100rpx;
- }
- }
- }
- </style>
|