index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <view class="container">
  3. <page-title>预警提醒({{listTotal}})</page-title>
  4. <view class="cards-list" style="padding-bottom: 50rpx;">
  5. <view class="card" v-for="(item,index) in itemList" :key="index">
  6. <view class="card-title">
  7. <text class="card-name-num">{{(index+1<10?'0'+(index+1):index+1)}}</text>
  8. <text class="card-name-text">{{item.subName}}</text>
  9. <view class="card-status-item status-day">
  10. <view class="over-days">
  11. <text class="status-item-highlight">{{item.overDays}}</text>
  12. <view class="yujing">预警天数</view>
  13. </view>
  14. <view class="up-arrow" @click="upFunc(index+1)">
  15. <image src="../../static/images/upArrow.svg" mode="" v-if="chooseId!==(index+1)"></image>
  16. <image src="../../static/images/downArrow.svg" mode="" v-if="chooseId==(index+1)"></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="card-up-item"
  21. :style="chooseId==(index+1) ? {height: '6rem', padding: '24rpx 16rpx 0rpx 24rpx',borderTop: '2rpx dashed #DDDDDD',marginTop: '24rpx'}:''">
  22. <view class="card-item">
  23. <view class="card-item-name">申报单位</view>
  24. <view class="card-item-content">{{item.sbdw||'--'}}</view>
  25. </view>
  26. <view class="card-item">
  27. <view class="card-item-name">阶段说明</view>
  28. <view class="card-item-content">{{item.title||'--'}}</view>
  29. </view>
  30. <view class="card-item">
  31. <view class="card-item-name">逾期类型</view>
  32. <view class="card-item-content">{{item.kindName||'--'}}</view>
  33. </view>
  34. <view class="card-item">
  35. <view class="card-item-name">计划日期</view>
  36. <view class="card-item-content">{{item.endDate||'--'}}</view>
  37. </view>
  38. <view class="card-item-ckeck">
  39. <view class="card-btn fat-btn" @click="gotoDetail(item.subId,item.subName)">查看</view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- <view class="card-status">
  44. <view class="card-status-item status-now">
  45. <view>预期类型</view>
  46. <view class="status-item-text">{{item.kindName}}</view>
  47. </view>
  48. <view class="card-status-item status-date">
  49. <view>计划日期</view>
  50. <view class="status-item-text">{{item.endDate}}</view>
  51. </view>
  52. <view class="card-status-item status-day">
  53. <view>预警天数</view>
  54. <view class="status-item-text"><text class="status-item-highlight">{{item.overDays}}</text>天
  55. </view>
  56. </view>
  57. </view> -->
  58. <!-- <view class="card-item">
  59. <view class="card-btn fat-btn" @click="gotoDetail(item.subId,item.subName)">项目查看</view>
  60. </view> -->
  61. <empty-show v-if="itemList.length===0"></empty-show>
  62. </view>
  63. <u-back-top :scroll-top="scrollTop"></u-back-top>
  64. <u-loading-page :loading="loading"></u-loading-page>
  65. </view>
  66. </template>
  67. <script setup>
  68. import {
  69. ref
  70. } from 'vue'
  71. import {
  72. onLoad,
  73. onPullDownRefresh,
  74. onReachBottom,
  75. onPageScroll
  76. } from "@dcloudio/uni-app"
  77. import {
  78. getOverdueList
  79. } from "@/api/work/overdue.js"
  80. function backToBefore() {
  81. uni.navigateBack({})
  82. };
  83. let scrollTop = ref(0)
  84. let loading = ref(true)
  85. // 参数
  86. let searchInfo = ref({
  87. pageNo: 1,
  88. pageSize: 10,
  89. overStatus: 2
  90. })
  91. function getList() {
  92. if (searchInfo.value.pageNo == 1) {
  93. loading.value = true
  94. }
  95. getOverdueList(searchInfo.value).then(res => {
  96. loading.value = false
  97. res.data.list.forEach(item => {
  98. if (Number(item.overDays) && Number(item.overDays) < 0) {
  99. item.overDays = Math.abs(item.overDays)
  100. }
  101. })
  102. itemList.value = itemList.value.concat(res.data.list)
  103. listTotal.value = res.data.total
  104. if (res.data.total == searchInfo.value.pageNo * searchInfo.value.pageSize - (10 - res.data.list
  105. .length)) moreListFlag = false;
  106. }).catch(() => {
  107. loading.value = false
  108. })
  109. }
  110. let itemList = ref([])
  111. let listTotal = ref(0)
  112. function gotoDetail(id, subName) {
  113. uni.navigateTo({
  114. url: `/pages/projectInfo/detail/index?id=${id}&subName=${subName}`
  115. })
  116. }
  117. let chooseId = ref(0)
  118. function upFunc(num) {
  119. if (chooseId.value === num) {
  120. chooseId.value = 0;
  121. } else {
  122. chooseId.value = num;
  123. }
  124. }
  125. // 触底加载flag
  126. let moreListFlag = true
  127. onLoad(() => {
  128. getList()
  129. })
  130. onPageScroll((e) => {
  131. scrollTop.value = e.scrollTop
  132. })
  133. onPullDownRefresh(() => {
  134. searchInfo.value.pageNo = 1;
  135. itemList.value = [];
  136. moreListFlag = true;
  137. try {
  138. getList();
  139. } finally {
  140. uni.stopPullDownRefresh()
  141. }
  142. })
  143. onReachBottom(() => {
  144. if (!moreListFlag) {
  145. return uni.showToast({
  146. title: "已经到底了。",
  147. icon: "none",
  148. duration: 2000
  149. })
  150. }
  151. searchInfo.value.pageNo++;
  152. getList();
  153. })
  154. </script>
  155. <style lang="scss" scoped>
  156. .line {
  157. width: 100%;
  158. }
  159. .card-index {
  160. position: absolute;
  161. top: 100rpx;
  162. right: 30rpx;
  163. width: 90rpx;
  164. display: flex;
  165. justify-content: center;
  166. white-space: nowrap;
  167. color: #ccc;
  168. font-size: 30rpx;
  169. }
  170. .car-btn {
  171. position: absolute;
  172. bottom: 40rpx;
  173. right: 30rpx;
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. width: 128rpx;
  178. height: 56rpx;
  179. background: #D6ECFF;
  180. border-radius: 30rpx;
  181. font-size: 22rpx;
  182. color: #002F69;
  183. font-weight: 500;
  184. }
  185. .cards-list {
  186. .card {
  187. box-shadow: 0rpx 0rpx 8rpx 0rpx #D8EEFF;
  188. border-radius: 12rpx;
  189. padding: 24rpx 0rpx 24rpx 8rpx !important;
  190. .card-title {
  191. width: 100%;
  192. display: flex;
  193. flex-direction: row;
  194. align-items: center;
  195. .card-name-num {
  196. width: 64rpx;
  197. height: 64rpx;
  198. border-radius: 4rpx;
  199. border: 4rpx solid #F4F4F4;
  200. font-size: 24rpx;
  201. color: #B5B5B5;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. }
  206. .card-name-text {
  207. width: calc(100% - 260rpx);
  208. height: 80rpx;
  209. font-weight: 500;
  210. font-size: 28rpx;
  211. color: #222222;
  212. text-align: left;
  213. display: flex;
  214. justify-content: flex-start;
  215. align-items: center;
  216. }
  217. .card-status {
  218. display: flex;
  219. justify-content: space-between;
  220. width: 100%;
  221. height: 128rpx;
  222. margin-top: 40rpx;
  223. .card-status-item {
  224. display: flex;
  225. flex-direction: column;
  226. justify-content: space-between;
  227. width: 190rpx;
  228. height: 128rpx;
  229. padding: 16rpx 0 30rpx;
  230. border-radius: 20rpx;
  231. text-align: center;
  232. font-size: 24rpx;
  233. font-weight: 400;
  234. color: #626266;
  235. .status-item-text {
  236. font-size: 28rpx;
  237. font-weight: 400;
  238. color: #343437;
  239. }
  240. .status-item-highlight {
  241. font-size: 36rpx;
  242. font-weight: 400;
  243. color: #FF530F;
  244. margin-right: 12rpx;
  245. }
  246. }
  247. .status-now {
  248. background-color: #C3E6FF;
  249. }
  250. .status-date {
  251. background-color: #C2CAFF;
  252. }
  253. .status-day {
  254. background-color: #FFD2C0;
  255. }
  256. }
  257. .status-day {
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. width: 144rpx;
  262. height: 80rpx;
  263. background: #FA6400;
  264. border-radius: 20rpx 0rpx 0rpx 20rpx;
  265. padding-left: 28rpx;
  266. .over-days {
  267. display: flex;
  268. flex-direction: column;
  269. align-items: center;
  270. gap: 5rpx;
  271. .status-item-highlight {
  272. font-weight: 500;
  273. font-size: 36rpx;
  274. color: #FFFF00;
  275. line-height: 38rpx;
  276. text-stroke: 2rpx #FFFFFF;
  277. display: flex;
  278. justify-content: center;
  279. font-style: normal;
  280. }
  281. .yujing {
  282. font-weight: 300;
  283. font-size: 32rpx;
  284. zoom: 0.5;
  285. color: #FFFFFF;
  286. line-height: 16rpx;
  287. text-align: left;
  288. white-space: nowrap;
  289. }
  290. }
  291. .up-arrow {
  292. width: 32rpx;
  293. height: 32rpx;
  294. image {
  295. width: 100%;
  296. height: 100%;
  297. }
  298. }
  299. }
  300. }
  301. .card-up-item {
  302. display: block !important;
  303. width: 100%;
  304. padding: 0rpx;
  305. position: relative;
  306. height: 0;
  307. overflow: hidden;
  308. transition: all .3s;
  309. border-top: 1rpx dashed transparent;
  310. padding: 0rpx 16rpx 0rpx 24rpx;
  311. .card-item {
  312. .card-item-name,
  313. .card-item-content {
  314. font-weight: 500;
  315. font-size: 24rpx;
  316. line-height: 40rpx;
  317. text-align: left;
  318. }
  319. .card-item-name {
  320. color: #999999;
  321. }
  322. .card-item-content {
  323. color: #444444;
  324. }
  325. }
  326. .card-item-ckeck {
  327. position: absolute;
  328. bottom: 16rpx;
  329. right: 16rpx;
  330. .fat-btn {
  331. width: 112rpx;
  332. height: 48rpx;
  333. background: #D6ECFF;
  334. border-radius: 30rpx;
  335. font-weight: 600;
  336. font-size: 28rpx;
  337. color: #002F69;
  338. line-height: 48rpx;
  339. text-align: center;
  340. font-style: normal;
  341. }
  342. }
  343. }
  344. }
  345. }
  346. </style>