index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <template>
  2. <Water></Water>
  3. <view class="detail-page">
  4. <view class="tabs">
  5. <view class="tab" v-for="(t, i) in tabs" :key="t.label" :class="{ active: category == t.value }"
  6. :style="{ opacity: isLoading ? 0.5 : 1 }" @click="selectTab(t)">
  7. {{ t.label }}
  8. </view>
  9. </view>
  10. <view class="grid-scroll">
  11. <scroll-view v-show="category == 1" scroll-y class="grid-scroll-view" @scrolltolower="onTableScrollToLower">
  12. <view>
  13. <view v-if="!loading && rows.length > 0" class="card-list">
  14. <view class="company-card" v-for="(company, cIdx) in rows" :key="cIdx">
  15. <view class="company-header" @click="toggleExpand(company)">
  16. <view class="company-title">
  17. <text class="company-name">{{ company.name }}</text>
  18. <view class="company-products" v-if="company.products && company.products.length">
  19. <text class="company-product-item" v-for="(prod, pIdx) in company.products" :key="pIdx">
  20. {{ prod.name }} {{ prod.spec }}
  21. </text>
  22. </view>
  23. <!-- <text class="company-total">总数量:{{ company.totalQty }}</text> -->
  24. </view>
  25. <uni-icons :type="company.expanded ? 'up' : 'down'" size="20" color="#999"></uni-icons>
  26. </view>
  27. <view v-if="company.expanded" class="company-body">
  28. <view class="exporter-section" v-for="(exp, eIdx) in company.exporters" :key="eIdx">
  29. <view class="exporter-title" @click="toggleSubExpand(exp)">
  30. <text>{{ category == 1 ? '出库方' : '入库方' }}:{{ exp.name }}</text>
  31. <uni-icons :type="exp.expanded ? 'up' : 'down'" size="16" color="#666"></uni-icons>
  32. </view>
  33. <view v-if="exp.expanded" class="product-group" v-for="(pg, pIdx) in exp.products" :key="pIdx">
  34. <!-- Product Header Removed as requested, info is now in company header -->
  35. <!-- <view class="product-header">
  36. <text class="product-name">{{ pg.name }}</text>
  37. <text class="product-spec">{{ pg.spec }}</text>
  38. </view> -->
  39. <scroll-view scroll-x class="batch-scroll">
  40. <view class="batch-table">
  41. <view class="batch-header-row">
  42. <text class="th-cell col-batch">批号</text>
  43. <text class="th-cell col-region">货源地区</text>
  44. <text class="th-cell col-qty">货源数量</text>
  45. <text class="th-cell col-qty">终端到达数量</text>
  46. <text class="th-cell col-time">出库时间</text>
  47. <text class="th-cell col-code">追溯码抽样</text>
  48. </view>
  49. <view class="batch-row" v-for="(batch, bIdx) in pg.batches" :key="bIdx">
  50. <text class="td-cell col-batch">{{ batch.produceBatchNo }}</text>
  51. <text class="td-cell col-region">{{ batch.regionName }}</text>
  52. <text class="td-cell col-qty">{{ batch.fromQty }}</text>
  53. <text class="td-cell col-qty">{{ batch.toQty }}</text>
  54. <text class="td-cell col-time">{{ batch.billTime }}</text>
  55. <text class="td-cell col-code">{{ batch.tracCode }}</text>
  56. </view>
  57. </view>
  58. </scroll-view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="loading-row" v-if="hasMore">
  64. <view class="loading-wrapper">
  65. <image class="loading-icon" src="../../../../static/images/loading.png" />
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </scroll-view>
  71. <scroll-view v-show="category == 2" class="grid-scroll" scroll-y="true" scroll-x="true" :show-scrollbar="false"
  72. enhanced @scrolltolower="onTableScrollToLower">
  73. <view>
  74. <view v-if="!_loading && _rows.length > 0" class="card-list">
  75. <view class="company-card" v-for="(company, cIdx) in _rows" :key="cIdx">
  76. <view class="company-header" @click="toggleExpand(company)">
  77. <view class="company-title">
  78. <text class="company-name">{{ company.name }}</text>
  79. <view class="company-products" v-if="company.products && company.products.length">
  80. <text class="company-product-item" v-for="(prod, pIdx) in company.products" :key="pIdx">
  81. {{ prod.name }} {{ prod.spec }}
  82. </text>
  83. </view>
  84. <!-- <text class="company-total">总数量:{{ company.totalQty }}</text> -->
  85. </view>
  86. <uni-icons :type="company.expanded ? 'up' : 'down'" size="20" color="#999"></uni-icons>
  87. </view>
  88. <view v-if="company.expanded" class="company-body">
  89. <view class="exporter-section" v-for="(exp, eIdx) in company.exporters" :key="eIdx">
  90. <view class="exporter-title" @click="toggleSubExpand(exp)">
  91. <text>{{ category == 1 ? '出库方' : '入库方' }}:{{ exp.name }}</text>
  92. <uni-icons :type="exp.expanded ? 'up' : 'down'" size="16" color="#666"></uni-icons>
  93. </view>
  94. <view v-if="exp.expanded" class="product-group" v-for="(pg, pIdx) in exp.products" :key="pIdx">
  95. <!-- <view class="product-header">
  96. <text class="product-name">{{ pg.name }}</text>
  97. <text class="product-spec">{{ pg.spec }}</text>
  98. </view> -->
  99. <scroll-view scroll-x class="batch-scroll">
  100. <view class="batch-table">
  101. <view class="batch-header-row">
  102. <text class="th-cell col-batch">批号</text>
  103. <text class="th-cell col-region">货源地区</text>
  104. <text class="th-cell col-qty">货源数量</text>
  105. <text class="th-cell col-qty">终端到达数量</text>
  106. <text class="th-cell col-time">入库时间</text>
  107. <text class="th-cell col-code">追溯码抽样</text>
  108. </view>
  109. <view class="batch-row" v-for="(batch, bIdx) in pg.batches" :key="bIdx">
  110. <text class="td-cell col-batch">{{ batch.produceBatchNo }}</text>
  111. <text class="td-cell col-region">{{ batch.regionName }}</text>
  112. <text class="td-cell col-qty">{{ batch.fromQty }}</text>
  113. <text class="td-cell col-qty">{{ batch.toQty }}</text>
  114. <text class="td-cell col-time">{{ batch.billTime }}</text>
  115. <text class="td-cell col-code">{{ batch.tracCode }}</text>
  116. </view>
  117. </view>
  118. </scroll-view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="loading-row" v-if="_hasMore">
  124. <view class="loading-wrapper">
  125. <image class="loading-icon" src="../../../../static/images/loading.png" />
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </scroll-view>
  131. <view v-if="isLoading" class="loading-wrap">
  132. <view class="loading-row">
  133. <view class="loading-wrapper">
  134. <image class="loading-icon" src="../../../../static/images/loading.png" />
  135. </view>
  136. </view>
  137. </view>
  138. <view v-if="showEmptyData" class="empty-data">
  139. <EmptyView text="无相关数据" />
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import EmptyView from "../../../../wigets/empty.vue";
  146. import Water from "@/components/water/water.vue";
  147. import request from "../../../../request/index.js";
  148. import { formatDate } from "../../../../utils/utils.js";
  149. export default {
  150. components: {
  151. EmptyView,
  152. Water,
  153. },
  154. data() {
  155. return {
  156. taskId: "",
  157. tableBodyHeight: 0,
  158. baseRowHeight: 76,
  159. tabs: [
  160. {
  161. label: "药品购进",
  162. value: "1",
  163. },
  164. {
  165. label: "药品销售",
  166. value: "2",
  167. },
  168. ],
  169. category: "1",
  170. loading: true,
  171. rows: [],
  172. totalCount: 0,
  173. fetchLoading: false,
  174. hasMore: true,
  175. pageNum: 1,
  176. pageSize: 10,
  177. _loading: true,
  178. _rows: [],
  179. _totalCount: 0,
  180. _fetchLoading: false,
  181. _hasMore: true,
  182. _pageNum: 1,
  183. _pageSize: 10,
  184. };
  185. },
  186. onLoad(options) {
  187. const title =
  188. options && options.title ? decodeURIComponent(options.title) : "报表详情";
  189. this.taskId = options && options.id ? options.id : "";
  190. uni.setNavigationBarTitle({ title });
  191. this.tableBodyHeight = 14 * 80;
  192. // this.rows = this.buildRows(this.genHierData());
  193. //this._rows = this.buildRows(this.genHierData());
  194. this.fetchList();
  195. },
  196. computed: {
  197. // isFixedHeight() {
  198. // const arr = Array.isArray(this.rows) ? this.rows : [];
  199. // const countLeaves = (node) => {
  200. // if (!node || !node.enterpriseList || node.enterpriseList.length === 0) return 1;
  201. // let sum = 0;
  202. // for (let i = 0; i < node.enterpriseList.length; i++) {
  203. // sum += countLeaves(node.enterpriseList[i]);
  204. // }
  205. // return sum;
  206. // };
  207. // let total = 0;
  208. // for (let i = 0; i < arr.length; i++) {
  209. // total += countLeaves(arr[i]);
  210. // }
  211. // return total >= 12;
  212. // },
  213. isLoading() {
  214. return (
  215. (this.loading && this.category == 1) ||
  216. (this._loading && this.category == 2)
  217. );
  218. },
  219. showEmptyData() {
  220. if (this.isLoading) return false;
  221. if (
  222. (this.category == 1 && this.rows.length === 0) ||
  223. (this.category == 2 && this._rows.length === 0)
  224. )
  225. return true;
  226. return false;
  227. },
  228. },
  229. methods: {
  230. selectTab(t) {
  231. if (this.isLoading) return;
  232. this.category = t.value;
  233. this.fetchList();
  234. },
  235. genHierData() {
  236. return [
  237. {
  238. enterpriseName: "上海海王星辰药房有限公司",
  239. enterpriseList: [
  240. {
  241. fromEntName: "福建广药洁达医药有限公司",
  242. enterpriseList: [
  243. {
  244. physicName: "感冲",
  245. produceBatchNo: "2502104H",
  246. fromRegionName: "广东",
  247. fromQuantity: 1000,
  248. toQuantity: 30,
  249. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  250. tracCode: "A",
  251. },
  252. {
  253. physicName: "皮炎平",
  254. produceBatchNo: "2502105H",
  255. fromRegionName: "广西",
  256. fromQuantity: 200,
  257. toQuantity: 20,
  258. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  259. tracCode: "B",
  260. },
  261. {
  262. physicName: "感冲",
  263. produceBatchNo: "2502105H",
  264. fromRegionName: "广西",
  265. fromQuantity: 200,
  266. toQuantity: 20,
  267. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  268. tracCode: "B",
  269. },
  270. {
  271. physicName: "感冲",
  272. produceBatchNo: "2502105H",
  273. fromRegionName: "广西",
  274. fromQuantity: 200,
  275. toQuantity: 20,
  276. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  277. tracCode: "B",
  278. },
  279. ],
  280. },
  281. {
  282. fromEntName: "B有限公司",
  283. enterpriseList: [
  284. {
  285. physicName: "感冲",
  286. produceBatchNo: "2502104H",
  287. fromRegionName: "广东",
  288. fromQuantity: 1000,
  289. toQuantity: 30,
  290. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  291. tracCode: "A",
  292. },
  293. ],
  294. },
  295. ],
  296. },
  297. {
  298. enterpriseName: "大参林连锁药店",
  299. enterpriseList: [
  300. {
  301. fromEntName: "C有限公司",
  302. enterpriseList: [
  303. {
  304. physicName: "感冲",
  305. produceBatchNo: "2502105H",
  306. fromRegionName: "广东",
  307. fromQuantity: 1000,
  308. toQuantity: 30,
  309. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  310. tracCode: "A",
  311. },
  312. {
  313. physicName: "皮炎平",
  314. produceBatchNo: "2502105H",
  315. fromRegionName: "广西",
  316. fromQuantity: 200,
  317. toQuantity: 20,
  318. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  319. tracCode: "B",
  320. },
  321. ],
  322. },
  323. {
  324. fromEntName: "D有限公司",
  325. enterpriseList: [
  326. {
  327. physicName: "皮炎平",
  328. produceBatchNo: "2502105H",
  329. fromRegionName: "广西",
  330. fromQuantity: 200,
  331. toQuantity: 20,
  332. billTime: "区间内第一次出库时间——区间内最后一次出库时间",
  333. tracCode: "B",
  334. },
  335. ],
  336. },
  337. ],
  338. },
  339. ];
  340. },
  341. computeLeafCount(node) {
  342. if (!node || !node.enterpriseList || !node.enterpriseList.length)
  343. return 1;
  344. let sum = 0;
  345. node.enterpriseList.forEach((c) => {
  346. sum += this.computeLeafCount(c);
  347. });
  348. node.leafCount = sum;
  349. return sum;
  350. },
  351. processData(list) {
  352. const res = [];
  353. if (!list || !list.length) return res;
  354. list.forEach((company) => {
  355. const companyNode = {
  356. name: company.enterpriseName,
  357. totalQty: 0,
  358. expanded: false, // Default collapsed
  359. exporters: [],
  360. products: [], // Collect unique products here
  361. };
  362. const uniqueProducts = {};
  363. (company.enterpriseList || []).forEach((exp) => {
  364. const expNode = {
  365. name: exp.fromEntName,
  366. expanded: false, // Default collapsed
  367. products: [],
  368. };
  369. const productGroups = {};
  370. (exp.enterpriseList || []).forEach((item) => {
  371. const key = (item.physicName || "") + "|" + (item.pkgSpec || "");
  372. // Collect global unique products for the company header
  373. if (!uniqueProducts[key]) {
  374. uniqueProducts[key] = {
  375. name: item.physicName,
  376. spec: item.pkgSpec || "",
  377. };
  378. }
  379. if (!productGroups[key]) {
  380. productGroups[key] = {
  381. name: item.physicName,
  382. spec: item.pkgSpec || "",
  383. batches: [],
  384. };
  385. }
  386. const { minBillTime, maxBillTime } = item;
  387. const billTime = `${formatDate(minBillTime, "YYYY-MM-DD")}——${formatDate(maxBillTime, "YYYY-MM-DD")}`;
  388. const qty = Number(item.toQty) || 0;
  389. companyNode.totalQty += qty;
  390. productGroups[key].batches.push({
  391. ...item,
  392. billTime,
  393. });
  394. });
  395. Object.values(productGroups).forEach((pg) => {
  396. expNode.products.push(pg);
  397. });
  398. companyNode.exporters.push(expNode);
  399. });
  400. companyNode.products = Object.values(uniqueProducts);
  401. res.push(companyNode);
  402. });
  403. return res;
  404. },
  405. toggleExpand(item) {
  406. this.$set(item, "expanded", !item.expanded);
  407. },
  408. toggleSubExpand(item) {
  409. this.$set(item, "expanded", !item.expanded);
  410. },
  411. onTableScrollToLower(e) {
  412. if (e?.detail?.direction === "right") return;
  413. // if (this.isLoading) return;
  414. // if (this.rows.length >= this.totalCount) return;
  415. // this.isLoading = true;
  416. // const remain = this.totalCount - this.rows.length;
  417. // const toAdd = Math.min(15, remain);
  418. // setTimeout(() => {
  419. // const more = this.rows.slice(0, toAdd);
  420. // this.rows = this.rows.concat(more);
  421. // this.isLoading = false;
  422. // }, 800);
  423. this.fetchList();
  424. },
  425. fetchList() {
  426. let obj = {
  427. pageNum: "pageNum",
  428. pageSize: "pageSize",
  429. totalCount: "totalCount",
  430. hasMore: "hasMore",
  431. fetchLoading: "fetchLoading",
  432. rows: "rows",
  433. loading: "loading",
  434. };
  435. if (this.category == 2) {
  436. obj.pageNum = "_pageNum";
  437. obj.pageSize = "_pageSize";
  438. obj.totalCount = "_totalCount";
  439. obj.hasMore = "_hasMore";
  440. obj.fetchLoading = "_fetchLoading";
  441. obj.rows = "_rows";
  442. obj.loading = "_loading";
  443. }
  444. if (this[obj.fetchLoading] || !this[obj.hasMore]) return;
  445. this[obj.fetchLoading] = true;
  446. let url = `/report/getTaskTableData`;
  447. try {
  448. request(url, {
  449. id: this.taskId,
  450. category: this.category,
  451. pageNum: this[obj.pageNum],
  452. pageSize: this[obj.pageSize],
  453. path: "/reportExport/detail/index.vue",
  454. }).then((res) => {
  455. if (res.code == 200) {
  456. const { total, list } = res.data || {};
  457. this[obj.totalCount] = total || 0;
  458. let _list = [];
  459. if (Array.isArray(list)) {
  460. _list = this.processData(list);
  461. }
  462. this[obj.rows] = [...this[obj.rows], ..._list];
  463. if (this[obj.rows].length < this[obj.totalCount]) {
  464. this[obj.hasMore] = true;
  465. this[obj.pageNum]++;
  466. } else {
  467. this[obj.hasMore] = false;
  468. }
  469. }
  470. this[obj.fetchLoading] = false;
  471. this[obj.loading] = false;
  472. });
  473. } catch (res) {
  474. console.log(res);
  475. this[obj.fetchLoading] = false;
  476. this[obj.loading] = false;
  477. }
  478. // this.rows = [];
  479. // setTimeout(() => {
  480. // const n = Math.min(15, this.totalCount);
  481. // this.rows = this.buildRows(this.genHierData()).slice(0, n);
  482. // this.fetchLoading = false;
  483. // }, 1000);
  484. },
  485. },
  486. };
  487. </script>
  488. <style scoped>
  489. .detail-page {
  490. box-sizing: border-box;
  491. padding: 24rpx;
  492. position: relative;
  493. min-height: 100vh;
  494. background: #f3f6f9;
  495. padding-bottom: calc(50rpx + env(safe-area-inset-bottom));
  496. }
  497. .tabs {
  498. display: flex;
  499. align-items: center;
  500. background: #fff;
  501. border-radius: 90rpx;
  502. padding: 10rpx;
  503. margin-bottom: 30rpx;
  504. }
  505. .tab {
  506. flex: 1;
  507. height: 70rpx;
  508. display: flex;
  509. align-items: center;
  510. justify-content: center;
  511. padding: 0 24rpx;
  512. border-radius: 70rpx;
  513. font-size: 28rpx;
  514. color: #333;
  515. }
  516. .tab+.tab {
  517. margin-left: 12rpx;
  518. }
  519. .tab.active {
  520. background: #2c69ff;
  521. color: #fff;
  522. }
  523. .card {
  524. position: relative;
  525. margin-top: 12rpx;
  526. font-size: 30rpx;
  527. overflow: hidden;
  528. }
  529. /* New Card Styles */
  530. .card-list {
  531. padding: 24rpx;
  532. background: #f5f7fa;
  533. min-height: 100vh;
  534. }
  535. .company-card {
  536. background: #fff;
  537. border-radius: 16rpx;
  538. margin-bottom: 24rpx;
  539. overflow: hidden;
  540. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
  541. }
  542. .company-header {
  543. padding: 24rpx 30rpx;
  544. background: #fff;
  545. display: flex;
  546. justify-content: space-between;
  547. align-items: center;
  548. border-bottom: 1rpx solid #f0f0f0;
  549. }
  550. .company-title {
  551. display: flex;
  552. flex-direction: column;
  553. }
  554. .company-name {
  555. font-size: 32rpx;
  556. font-weight: bold;
  557. color: #333;
  558. margin-bottom: 8rpx;
  559. }
  560. .company-products {
  561. margin-bottom: 8rpx;
  562. }
  563. .company-product-item {
  564. font-size: 26rpx;
  565. color: #666;
  566. margin-right: 16rpx;
  567. display: inline-block;
  568. }
  569. .company-total {
  570. font-size: 24rpx;
  571. color: #999;
  572. }
  573. .company-body {
  574. background: #fff;
  575. padding: 0 24rpx 24rpx;
  576. }
  577. .exporter-section {
  578. margin-top: 24rpx;
  579. border: 1rpx solid #eef0f4;
  580. border-radius: 12rpx;
  581. overflow: hidden;
  582. }
  583. .exporter-title {
  584. background: #f8f9fb;
  585. padding: 16rpx 24rpx;
  586. font-size: 28rpx;
  587. font-weight: 600;
  588. color: #333;
  589. display: flex;
  590. justify-content: space-between;
  591. align-items: center;
  592. border-bottom: 1rpx solid #eef0f4;
  593. }
  594. .product-group {
  595. padding: 0;
  596. }
  597. .product-header {
  598. padding: 16rpx 24rpx;
  599. display: flex;
  600. justify-content: space-between;
  601. font-size: 26rpx;
  602. color: #666;
  603. border-bottom: 1rpx solid #f0f0f0;
  604. }
  605. .batch-scroll {
  606. width: 100%;
  607. }
  608. .batch-table {
  609. min-width: 1300rpx;
  610. }
  611. .batch-header-row {
  612. display: flex;
  613. background: #f7f9fc;
  614. color: #2c69ff;
  615. }
  616. .batch-row {
  617. display: flex;
  618. border-bottom: 1rpx solid #f0f0f0;
  619. }
  620. .batch-row:nth-child(even) {
  621. background-color: #f7f9fc;
  622. }
  623. .batch-row:last-child {
  624. border-bottom: none;
  625. }
  626. .th-cell {
  627. padding: 16rpx 10rpx;
  628. font-size: 24rpx;
  629. text-align: center;
  630. flex-shrink: 0;
  631. font-weight: 600;
  632. }
  633. .td-cell {
  634. padding: 16rpx 10rpx;
  635. font-size: 24rpx;
  636. color: #333;
  637. text-align: center;
  638. flex-shrink: 0;
  639. word-break: break-all;
  640. display: flex;
  641. align-items: center;
  642. justify-content: center;
  643. }
  644. .col-batch {
  645. width: 220rpx;
  646. }
  647. .col-region {
  648. width: 180rpx;
  649. }
  650. .col-qty {
  651. width: 140rpx;
  652. }
  653. .col-time {
  654. width: 280rpx;
  655. }
  656. .col-code {
  657. width: 240rpx;
  658. }
  659. .loading-row {
  660. padding: 24rpx;
  661. display: flex;
  662. justify-content: center;
  663. }
  664. .loading-wrapper {
  665. position: sticky;
  666. top: 50%;
  667. left: 0;
  668. width: calc(100vw - 48rpx);
  669. height: 76rpx;
  670. display: flex;
  671. align-items: center;
  672. justify-content: center;
  673. }
  674. .loading-icon {
  675. width: 40rpx;
  676. height: 40rpx;
  677. animation: spin 1s linear infinite;
  678. }
  679. @keyframes spin {
  680. from {
  681. transform: rotate(0deg);
  682. }
  683. to {
  684. transform: rotate(360deg);
  685. }
  686. }
  687. .empty-data,
  688. .loading-wrap {
  689. position: absolute;
  690. left: 0;
  691. top: 85rpx;
  692. z-index: 91;
  693. width: 100%;
  694. background-color: #fff;
  695. border-bottom-left-radius: 16rpx;
  696. border-bottom-right-radius: 16rpx;
  697. }
  698. </style>