123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <template>
- <view class="container">
- <page-title>预警提醒({{listTotal}})</page-title>
- <view class="cards-list" style="padding-bottom: 50rpx;">
- <view class="card" v-for="(item,index) in itemList" :key="index">
- <view class="card-title">
- <text class="card-name-num">{{(index+1<10?'0'+(index+1):index+1)}}</text>
- <text class="card-name-text">{{item.subName}}</text>
- <view class="card-status-item status-day">
- <view class="over-days">
- <text class="status-item-highlight">{{item.overDays}}</text>
- <view class="yujing">预警天数</view>
- </view>
- <view class="up-arrow" @click="upFunc(index+1)">
- <image src="../../static/images/upArrow.svg" mode="" v-if="chooseId!==(index+1)"></image>
- <image src="../../static/images/downArrow.svg" mode="" v-if="chooseId==(index+1)"></image>
- </view>
- </view>
- </view>
- <view class="card-up-item"
- :style="chooseId==(index+1) ? {height: '6rem', padding: '24rpx 16rpx 0rpx 24rpx',borderTop: '2rpx dashed #DDDDDD',marginTop: '24rpx'}:''">
- <view class="card-item">
- <view class="card-item-name">申报单位</view>
- <view class="card-item-content">{{item.sbdw||'--'}}</view>
- </view>
- <view class="card-item">
- <view class="card-item-name">阶段说明</view>
- <view class="card-item-content">{{item.title||'--'}}</view>
- </view>
- <view class="card-item">
- <view class="card-item-name">逾期类型</view>
- <view class="card-item-content">{{item.kindName||'--'}}</view>
- </view>
- <view class="card-item">
- <view class="card-item-name">计划日期</view>
- <view class="card-item-content">{{item.endDate||'--'}}</view>
- </view>
- <view class="card-item-ckeck">
- <view class="card-btn fat-btn" @click="gotoDetail(item.subId,item.subName)">查看</view>
- </view>
- </view>
- </view>
- <!-- <view class="card-status">
- <view class="card-status-item status-now">
- <view>预期类型</view>
- <view class="status-item-text">{{item.kindName}}</view>
- </view>
- <view class="card-status-item status-date">
- <view>计划日期</view>
- <view class="status-item-text">{{item.endDate}}</view>
- </view>
- <view class="card-status-item status-day">
- <view>预警天数</view>
- <view class="status-item-text"><text class="status-item-highlight">{{item.overDays}}</text>天
- </view>
- </view>
- </view> -->
- <!-- <view class="card-item">
- <view class="card-btn fat-btn" @click="gotoDetail(item.subId,item.subName)">项目查看</view>
- </view> -->
- <empty-show v-if="itemList.length===0"></empty-show>
- </view>
- <u-back-top :scroll-top="scrollTop"></u-back-top>
- <u-loading-page :loading="loading"></u-loading-page>
- </view>
- </template>
- <script setup>
- import {
- ref
- } from 'vue'
- import {
- onLoad,
- onPullDownRefresh,
- onReachBottom,
- onPageScroll
- } from "@dcloudio/uni-app"
- import {
- getOverdueList
- } from "@/api/work/overdue.js"
- function backToBefore() {
- uni.navigateBack({})
- };
- let scrollTop = ref(0)
- let loading = ref(true)
- // 参数
- let searchInfo = ref({
- pageNo: 1,
- pageSize: 10,
- overStatus: 2
- })
- function getList() {
- if (searchInfo.value.pageNo == 1) {
- loading.value = true
- }
- getOverdueList(searchInfo.value).then(res => {
- loading.value = false
- res.data.list.forEach(item => {
- if (Number(item.overDays) && Number(item.overDays) < 0) {
- item.overDays = Math.abs(item.overDays)
- }
- })
- itemList.value = itemList.value.concat(res.data.list)
- listTotal.value = res.data.total
- if (res.data.total == searchInfo.value.pageNo * searchInfo.value.pageSize - (10 - res.data.list
- .length)) moreListFlag = false;
- }).catch(() => {
- loading.value = false
- })
- }
- let itemList = ref([])
- let listTotal = ref(0)
- function gotoDetail(id, subName) {
- uni.navigateTo({
- url: `/pages/projectInfo/detail/index?id=${id}&subName=${subName}`
- })
- }
- let chooseId = ref(0)
- function upFunc(num) {
- if (chooseId.value === num) {
- chooseId.value = 0;
- } else {
- chooseId.value = num;
- }
- }
- // 触底加载flag
- let moreListFlag = true
- onLoad(() => {
- getList()
- })
- onPageScroll((e) => {
- scrollTop.value = e.scrollTop
- })
- onPullDownRefresh(() => {
- searchInfo.value.pageNo = 1;
- itemList.value = [];
- moreListFlag = true;
- try {
- getList();
- } finally {
- uni.stopPullDownRefresh()
- }
- })
- onReachBottom(() => {
- if (!moreListFlag) {
- return uni.showToast({
- title: "已经到底了。",
- icon: "none",
- duration: 2000
- })
- }
- searchInfo.value.pageNo++;
- getList();
- })
- </script>
- <style lang="scss" scoped>
- .line {
- width: 100%;
- }
- .card-index {
- position: absolute;
- top: 100rpx;
- right: 30rpx;
- width: 90rpx;
- display: flex;
- justify-content: center;
- white-space: nowrap;
- color: #ccc;
- font-size: 30rpx;
- }
- .car-btn {
- position: absolute;
- bottom: 40rpx;
- right: 30rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 128rpx;
- height: 56rpx;
- background: #D6ECFF;
- border-radius: 30rpx;
- font-size: 22rpx;
- color: #002F69;
- font-weight: 500;
- }
- .cards-list {
- .card {
- box-shadow: 0rpx 0rpx 8rpx 0rpx #D8EEFF;
- border-radius: 12rpx;
- padding: 24rpx 0rpx 24rpx 8rpx !important;
- .card-title {
- width: 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- .card-name-num {
- width: 64rpx;
- height: 64rpx;
- border-radius: 4rpx;
- border: 4rpx solid #F4F4F4;
- font-size: 24rpx;
- color: #B5B5B5;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .card-name-text {
- width: calc(100% - 260rpx);
- height: 80rpx;
- font-weight: 500;
- font-size: 28rpx;
- color: #222222;
- text-align: left;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .card-status {
- display: flex;
- justify-content: space-between;
- width: 100%;
- height: 128rpx;
- margin-top: 40rpx;
- .card-status-item {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- width: 190rpx;
- height: 128rpx;
- padding: 16rpx 0 30rpx;
- border-radius: 20rpx;
- text-align: center;
- font-size: 24rpx;
- font-weight: 400;
- color: #626266;
- .status-item-text {
- font-size: 28rpx;
- font-weight: 400;
- color: #343437;
- }
- .status-item-highlight {
- font-size: 36rpx;
- font-weight: 400;
- color: #FF530F;
- margin-right: 12rpx;
- }
- }
- .status-now {
- background-color: #C3E6FF;
- }
- .status-date {
- background-color: #C2CAFF;
- }
- .status-day {
- background-color: #FFD2C0;
- }
- }
- .status-day {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 144rpx;
- height: 80rpx;
- background: #FA6400;
- border-radius: 20rpx 0rpx 0rpx 20rpx;
- padding-left: 28rpx;
- .over-days {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 5rpx;
- .status-item-highlight {
- font-weight: 500;
- font-size: 36rpx;
- color: #FFFF00;
- line-height: 38rpx;
- text-stroke: 2rpx #FFFFFF;
- display: flex;
- justify-content: center;
- font-style: normal;
- }
- .yujing {
- font-weight: 300;
- font-size: 32rpx;
- zoom: 0.5;
- color: #FFFFFF;
- line-height: 16rpx;
- text-align: left;
- white-space: nowrap;
- }
- }
- .up-arrow {
- width: 32rpx;
- height: 32rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .card-up-item {
- display: block !important;
- width: 100%;
- padding: 0rpx;
- position: relative;
- height: 0;
- overflow: hidden;
- transition: all .3s;
- border-top: 1rpx dashed transparent;
- padding: 0rpx 16rpx 0rpx 24rpx;
- .card-item {
- .card-item-name,
- .card-item-content {
- font-weight: 500;
- font-size: 24rpx;
- line-height: 40rpx;
- text-align: left;
- }
- .card-item-name {
- color: #999999;
- }
- .card-item-content {
- color: #444444;
- }
- }
- .card-item-ckeck {
- position: absolute;
- bottom: 16rpx;
- right: 16rpx;
- .fat-btn {
- width: 112rpx;
- height: 48rpx;
- background: #D6ECFF;
- border-radius: 30rpx;
- font-weight: 600;
- font-size: 28rpx;
- color: #002F69;
- line-height: 48rpx;
- text-align: center;
- font-style: normal;
- }
- }
- }
- }
- }
- </style>
|