index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <script setup>
  2. import {
  3. ref
  4. } from "vue";
  5. import {
  6. onLoad,
  7. onPullDownRefresh,
  8. onReachBottom,
  9. onPageScroll,
  10. } from "@dcloudio/uni-app";
  11. import {
  12. getIntermediaryList,
  13. } from "@/api/work/intermediaryService.js";
  14. // 页面标题
  15. let pageName = ref(null);
  16. // 滚动
  17. let scrollTop = ref(0);
  18. // 搜索条件
  19. let searchInfo = ref({
  20. pageNo: 1,
  21. pageSize: 10,
  22. type: null
  23. });
  24. // 列表
  25. let policyList = ref([]);
  26. let listTotal = ref(0);
  27. // 获取列表
  28. let loading = ref(true);
  29. const getList = function() {
  30. if (searchInfo.value.pageNo == 1) {
  31. loading.value = true
  32. };
  33. getIntermediaryList(searchInfo.value).then(res => {
  34. loading.value = false;
  35. policyList.value = policyList.value.concat(res.data.list);
  36. listTotal.value = res.data.total;
  37. if (res.data.total == searchInfo.value.pageNo * searchInfo.value.pageSize - (10 - res.data.list.length))
  38. moreListFlag = false;
  39. console.log(policyList.value);
  40. }).catch(() => {
  41. loading.value = false;
  42. })
  43. };
  44. let itemIndex = ref(-1);
  45. function openFold(index) {
  46. if (itemIndex.value == index) {
  47. itemIndex.value = -1;
  48. } else {
  49. itemIndex.value = index;
  50. }
  51. }
  52. // 折叠/展开
  53. const changeFoldItem = (status, id) => {
  54. let item = policyList.value.find(item => item.id === id);
  55. item.unfold = status;
  56. }
  57. // 去详情
  58. const gotoDetail = id => {
  59. uni.navigateTo({
  60. url: `/pages/intermediaryService/detail/index?id=${id}`
  61. })
  62. }
  63. // 触底加载flag
  64. let moreListFlag = true
  65. onLoad(options => {
  66. pageName = options.title;
  67. searchInfo.value.type = options.id;
  68. getList();
  69. });
  70. onPullDownRefresh(() => {
  71. searchInfo.value.pageNo = 1;
  72. policyList.value = [];
  73. moreListFlag = true;
  74. try {
  75. getList();
  76. } finally {
  77. uni.stopPullDownRefresh();
  78. }
  79. });
  80. onReachBottom(() => {
  81. if (!moreListFlag) {
  82. return uni.showToast({
  83. title: "已经到底了。",
  84. icon: "none",
  85. duration: 2000
  86. })
  87. }
  88. searchInfo.value.pageNo++;
  89. getList();
  90. });
  91. onPageScroll((e) => {
  92. scrollTop.value = e.scrollTop
  93. })
  94. </script>
  95. <template>
  96. <view class="container">
  97. <page-title>{{pageName}}({{listTotal}})</page-title>
  98. <view class="items-list" style="padding-top: 0 !important;">
  99. <view class="policy-item" v-for="(item,index) in policyList" :key="index">
  100. <view class="un-fold">
  101. <text class="card-name-num">{{(index+1<10?'0'+(index+1):index+1)}}</text>
  102. <view class="search-item-text">{{item.title??"--"}}</view>
  103. <view class="detail-fold">
  104. <view class="card-btn fat-btn" @click="gotoDetail(item.id)">查看</view>
  105. <image src="../../static/images/interArrow.svg" mode="" :class="itemIndex===index?'over-turn':''"
  106. @click="openFold(index)"></image>
  107. <!-- <image src="../../static/images/interArrow.png" mode="" :class="itemIndex===index?'over-turn':''" @click=openFold(index)""></image> -->
  108. </view>
  109. </view>
  110. <view class="fold" :style="itemIndex!==index?{height:'0',overflow:'hidden',paddingBottom:'0'}:''">
  111. <view class="card-item item-special">
  112. <view class="card-item-name name-special">统一社会信用代码</view>
  113. <view class="card-item-content content-special">{{item.groupCode ?? "--"}}</view>
  114. </view>
  115. <view class="card-item">
  116. <view class="card-item-name">业务负责人</view>
  117. <view class="card-item-content">{{item.businessOwner || "--"}}</view>
  118. </view>
  119. <view class="card-item">
  120. <view class="card-item-name">负责人职务</view>
  121. <view class="card-item-content">{{item.businessJob || "--"}}</view>
  122. </view>
  123. <view class="card-item">
  124. <view class="card-item-name">负责人电话</view>
  125. <view class="card-item-content">{{item.businessPhone || "--"}}</view>
  126. </view>
  127. </view>
  128. <!-- 未折叠卡片
  129. <view class="card" v-if="item.unfold">
  130. <view class="card-item">
  131. <view class="card-item-name">企业名称</view>
  132. <view class="card-item-content">{{item.title ?? "--"}}</view>
  133. </view>
  134. <view class="card-item">
  135. <view class="card-item-name">业务负责人</view>
  136. <view class="card-item-content">{{item.businessOwner || "--"}}</view>
  137. </view>
  138. <view class="card-item">
  139. <view class="card-item-name">业务负责人联系电话</view>
  140. <view class="card-item-content">{{item.businessPhone || "--"}}</view>
  141. </view>
  142. <view class="card-item">
  143. <view class="card-item-name">备注</view>
  144. <view class="card-item-content">{{item.remark || "--"}}</view>
  145. </view>
  146. <view class="card-item bottom-item">
  147. <view class="card-btn fat-btn" @click="gotoDetail(item.id)">详情</view>
  148. </view>
  149. <view class="card-fold-option">
  150. <view class="card-fold-count">{{index + 1}} / {{listTotal}}</view>
  151. <view class="card-fold-center" @click.stop="changeFoldItem(false,item.id)">
  152. <view class="card-fold-btn card-unfold-btn"></view>
  153. </view>
  154. <view class="card-fold-chaos"></view>
  155. </view>
  156. </view>
  157. 折叠卡片
  158. <view class="card-fold" v-else>
  159. {{item.title ?? "--"}}
  160. <view class="card-fold-option">
  161. <view class="card-fold-count">{{index + 1}} / {{listTotal}}</view>
  162. <view class="card-fold-center" @click.stop="changeFoldItem(true, item.id)">
  163. <view class="card-fold-btn"></view>
  164. </view>
  165. <view class="card-fold-chaos"></view>
  166. </view>
  167. </view>
  168. -->
  169. </view>
  170. </view>
  171. <u-back-top :scroll-top="scrollTop"></u-back-top>
  172. <u-loading-page :loading="loading"></u-loading-page>
  173. </view>
  174. </template>
  175. <style lang="scss" scoped>
  176. .items-list {
  177. position: absolute;
  178. margin-top: calc(var(--status-bar-height) + 0rpx);
  179. left: 0;
  180. width: 100%;
  181. min-height: 95%;
  182. padding: 50rpx 4%;
  183. // background: #F9FBFF;
  184. display: flex;
  185. flex-direction: column;
  186. flex-wrap: wrap;
  187. gap: 20rpx;
  188. // margin-top: 32rpx;
  189. // border-radius: 40rpx 40rpx 0 0;
  190. }
  191. .item {
  192. margin-top: 20rpx;
  193. display: flex;
  194. align-items: center;
  195. width: 100%;
  196. min-height: 140rpx;
  197. padding: 26rpx 28rpx;
  198. box-sizing: border-box;
  199. background: #FFFFFF;
  200. box-shadow: 0rpx 18rpx 48rpx -4rpx rgba(150, 176, 220, 0.2);
  201. border-radius: 24rpx;
  202. .item-icon {
  203. width: 82rpx;
  204. height: 82rpx;
  205. margin-right: 32rpx;
  206. // background-image: url("@/static/policy-icon.png");
  207. // background-size: 100% 100%;
  208. }
  209. .item-text {
  210. width: 70%;
  211. height: 100%;
  212. word-break: break-all;
  213. .item-title {
  214. width: 100%;
  215. color: #343437;
  216. font-size: 28rpx;
  217. margin-bottom: 30rpx;
  218. }
  219. .item-kind {
  220. width: fit-content;
  221. min-height: 38rpx;
  222. padding: 10rpx;
  223. box-sizing: border-box;
  224. text-align: center;
  225. color: #1763E7;
  226. font-size: 24rpx;
  227. line-height: 38rpx;
  228. background: #DEEAFF;
  229. border-radius: 12rpx;
  230. }
  231. .item-rptDate {
  232. width: 100%;
  233. color: #343437;
  234. font-size: 28rpx;
  235. margin-bottom: 30rpx;
  236. }
  237. }
  238. .item-btn {
  239. width: 106rpx;
  240. height: 58rpx;
  241. background: #1763E7;
  242. border-radius: 16rpx;
  243. color: #FFF;
  244. font-size: 28rpx;
  245. text-align: center;
  246. line-height: 58rpx;
  247. margin-left: 20rpx;
  248. }
  249. }
  250. .card-fold {
  251. position: relative;
  252. width: 100%;
  253. min-height: 152rpx;
  254. margin-bottom: 20rpx;
  255. padding: 24rpx 30rpx 52rpx;
  256. box-sizing: border-box;
  257. background: #FFFFFF;
  258. border-radius: 40rpx;
  259. overflow: hidden;
  260. }
  261. .card-fold-option {
  262. position: absolute;
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: center;
  266. left: 0;
  267. bottom: 0;
  268. width: 100%;
  269. height: 38rpx;
  270. padding: 0 40rpx;
  271. box-sizing: border-box;
  272. background: linear-gradient(270deg, #CADDFF 4%, rgba(219, 232, 255, 0) 100%);
  273. z-index: 999;
  274. .card-fold-count {
  275. flex: 1;
  276. font-size: 28rpx;
  277. color: #1869F6;
  278. }
  279. .card-fold-center {
  280. flex: 1;
  281. .card-fold-btn {
  282. width: 32rpx;
  283. height: 20rpx;
  284. margin: 0 auto;
  285. background-image: url("@/static/icon-fold.png");
  286. background-size: 100% 100%;
  287. }
  288. .card-unfold-btn {
  289. transform: rotate(180deg);
  290. }
  291. }
  292. .card-fold-chaos {
  293. flex: 1;
  294. }
  295. }
  296. .bottom-item {
  297. margin-bottom: 20rpx;
  298. }
  299. .policy-item {
  300. width: 696rpx;
  301. // height: 44px;
  302. background: #FFFFFF;
  303. box-shadow: 0px 0px 8rpx 0px #D8EEFF;
  304. border-radius: 10rpx;
  305. margin: 0 auto;
  306. // height: 188rpx;
  307. display: flex;
  308. flex-direction: column;
  309. align-items: center;
  310. padding-right: 16rpx;
  311. padding-left: 10rpx;
  312. .un-fold {
  313. display: flex;
  314. flex-direction: row;
  315. align-items: center;
  316. height: 128rpx;
  317. padding: 0 8rpx;
  318. width: 100%;
  319. .search-item-icon {
  320. width: 96rpx;
  321. height: 78rpx;
  322. margin: 38rpx auto 40rpx;
  323. background-image: url('@/static/policy-file.png');
  324. background-size: 100% 100%;
  325. }
  326. }
  327. .fold {
  328. width: 100%;
  329. padding-bottom: 24rpx;
  330. transition: all .3s;
  331. height: auto;
  332. .card-item {
  333. width: 100%;
  334. display: flex;
  335. flex-direction: row;
  336. line-height: 44rpx;
  337. padding-left: 30rpx;
  338. .card-item-name {
  339. font-weight: 500;
  340. font-size: 24rpx;
  341. color: #B5B5B5;
  342. margin-right: 16rpx;
  343. }
  344. .card-item-content {
  345. font-weight: 500;
  346. font-size: 24rpx;
  347. color: #333333;
  348. }
  349. }
  350. .item-special {
  351. width: 634rpx;
  352. height: 56rpx;
  353. border-radius: 30rpx;
  354. border: 2rpx solid #EBEBEB;
  355. margin: 0 auto;
  356. line-height: 56rpx;
  357. margin-bottom: 24rpx;
  358. .name-special,
  359. .content-special {
  360. font-weight: 500;
  361. font-size: 24rpx;
  362. color: #7A85E0;
  363. }
  364. }
  365. }
  366. .search-item-text {
  367. width: 520rpx;
  368. // max-width: 146rpx;
  369. // min-height: 40rpx;
  370. margin: 0 auto;
  371. text-align: center;
  372. line-height: 40rpx;
  373. font-weight: 500;
  374. font-size: 28rpx;
  375. color: #222222;
  376. // background: #E2ECFF;
  377. border-radius: 8rpx;
  378. display: flex;
  379. justify-content: flex-start;
  380. }
  381. .detail-fold {
  382. display: flex;
  383. flex-direction: row;
  384. align-items: center;
  385. width: auto;
  386. background-color: transparent;
  387. box-shadow: none;
  388. .fat-btn {
  389. display: block;
  390. width: 100rpx;
  391. min-width: 100rpx;
  392. height: 48rpx;
  393. background: #D6ECFF;
  394. border-radius: 30rpx;
  395. }
  396. image {
  397. width: 32rpx;
  398. height: 32rpx;
  399. // margin-left: 16rpx;
  400. }
  401. }
  402. }
  403. .card-name-num {
  404. width: 64rpx;
  405. height: 64rpx;
  406. border-radius: 4rpx;
  407. border: 2rpx solid #F4F4F4;
  408. font-size: 24rpx;
  409. color: #B5B5B5;
  410. display: flex;
  411. align-items: center;
  412. justify-content: center;
  413. }
  414. .fat-btn {
  415. width: 112rpx;
  416. height: 48rpx;
  417. background: #D6ECFF;
  418. border-radius: 30rpx;
  419. font-weight: 500;
  420. font-size: 28rpx;
  421. color: #002F69;
  422. line-height: 48rpx;
  423. text-align: center;
  424. font-style: normal;
  425. }
  426. .over-turn {
  427. transform: rotate(180deg);
  428. }
  429. </style>