hexiao_record.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. <template>
  2. <view class="page-container">
  3. <view class="sticky-header">
  4. <view class="tabs-wrapper">
  5. <view
  6. v-for="tab in tabs"
  7. :key="tab.key"
  8. class="tab-item"
  9. :class="{ 'active': currentTab === tab.id }"
  10. @click="changeTab(tab.id)"
  11. >
  12. {{ tab.name }}
  13. </view>
  14. </view>
  15. </view>
  16. <view class="search-wrapper" v-if="currentTab === 5">
  17. <view class="query">
  18. <u-row customStyle="margin-bottom: 10px" gutter="20">
  19. <u-col span="9">
  20. <u--input
  21. @focus="timeShow = true"
  22. v-model="startTimeXd"
  23. placeholder="开始日期 ~ 结束日期"
  24. prefixIcon="calendar"
  25. prefixIconStyle="font-size: 22px;color: #909399"
  26. @clear="handleSearch"
  27. ></u--input>
  28. </u-col>
  29. <u-col span="3">
  30. <view class="query-btn" @click="clearSearch">
  31. <view class="query-btn-text">清空</view>
  32. </view>
  33. </u-col>
  34. </u-row>
  35. <u-row customStyle="margin-bottom: 10px" gutter="20">
  36. <u-col span="12">
  37. <u--input
  38. v-model="storeNameQuery"
  39. placeholder="请输入门店名称"
  40. prefixIcon="search"
  41. prefixIconStyle="font-size: 22px;color: #909399"
  42. @confirm="handleSearch"
  43. @clear="handleSearch"
  44. clearable
  45. ></u--input>
  46. </u-col>
  47. </u-row>
  48. </view>
  49. </view>
  50. <view v-if="currentTab == 1">
  51. <scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore" >
  52. <view v-if="pendingList.length === 0 && loadStatus !== 'loading'" class="empty-list">
  53. <text>暂无相关记录</text>
  54. </view>
  55. <view v-for="(pendInfo) in pendingList" :key="pendInfo.ywyId" class="record-card">
  56. <view class="card-header" @click="detail(pendInfo.ywyId,1)">
  57. <uni-icons type="paperclip" size="20" color="#3c82f8"></uni-icons>
  58. <text class="record-id" style="text-decoration: underline">{{ pendInfo.ywyName }}</text>
  59. <view class="status-badge pending">
  60. {{ getStatusText(0) }}
  61. </view>
  62. </view>
  63. <view class="card-body">
  64. <view class="detail-row product-item" v-for="(item, index) in pendInfo.detail" :key="index">
  65. <text class="detail-label">{{ item.categoryName }}</text>
  66. <text class="detail-value">{{ item.num }}</text>
  67. </view>
  68. </view>
  69. <view class="card-footer">
  70. <button class="verify-btn" @click="verify(pendInfo.ywyId)">核销</button>
  71. </view>
  72. </view>
  73. <uni-load-more :status="loadStatus"></uni-load-more>
  74. </scroll-view>
  75. <view class="fixed-footer" v-if="pendingList.length>0">
  76. <button class="add-btn" @click="verify(-1)">一键核销</button>
  77. </view>
  78. </view>
  79. <view v-if="currentTab === 5" class="store-summary-container">
  80. <scroll-view class="summary-list" scroll-y="true">
  81. <view v-if="summaryList.length === 0" class="empty-list">
  82. <text>暂无汇总数据</text>
  83. </view>
  84. <view v-else class="summary-table-wrapper">
  85. <view class="table-header">
  86. <view class="header-cell store-col">门店</view>
  87. <view class="header-cell product-col">品相</view>
  88. <view class="header-cell number-col">数量</view>
  89. </view>
  90. <view class="table-body">
  91. <view class="table-row" v-for="(store, storeIndex) in summaryList" :key="storeIndex">
  92. <view class="table-cell store-col">
  93. <view class="store-name-cell">
  94. <uni-icons type="shop" size="16" color="#3c82f8"></uni-icons>
  95. <text class="store-name-text">{{ store.storeName }}</text>
  96. </view>
  97. </view>
  98. <view>
  99. <view class="table-row-cl2" v-for="(item, itemIndex) in store.writeOffRecordDetailVos" :key="itemIndex">
  100. <view class="table-cell product-col">
  101. <text>{{ item.item }}</text>
  102. </view>
  103. <view class="table-cell number-col">
  104. <text>{{ item.writeOffAmount }}</text>
  105. </view>
  106. </view>
  107. <view class="table-row-cl2">
  108. <view class="table-cell product-col">
  109. <text>汇总</text>
  110. </view>
  111. <view class="table-cell number-col">
  112. <text style="color: orange;">{{ store.summaryCount }}</text>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </scroll-view>
  120. </view>
  121. <scroll-view class="list-container" scroll-y="true" @scrolltolower="loadMore" v-if="currentTab>1 && currentTab<4">
  122. <view v-if="recordList.length === 0 && loadStatus !== 'loading'" class="empty-list">
  123. <text>暂无相关记录</text>
  124. </view>
  125. <view v-for="record in recordList" :key="record.orderNo" class="record-card">
  126. <view class="card-header">
  127. <uni-icons type="paperclip" size="20" color="#3c82f8"></uni-icons>
  128. <text class="record-id" @click="detail(record.id)" style="text-decoration: underline">{{ record.orderNo }}</text>
  129. <view class="status-badge verifying" v-if="record.status === 0">
  130. {{ getStatusText(record.status) }}
  131. </view>
  132. <view class="status-badge verified" style="background-color: #54CFAB" v-if="record.status === 1">
  133. {{ getStatusText(record.status) }}
  134. </view>
  135. </view>
  136. <view class="card-body">
  137. <!-- <view class="detail-row">-->
  138. <!-- <text class="detail-label">业务员名称</text>-->
  139. <!-- <text class="detail-value">{{ record.ywyName }}</text>-->
  140. <!-- </view>-->
  141. <view class="detail-row" >
  142. <text class="detail-label">提交时间</text>
  143. <text class="detail-value">{{ record. dealerApplyTime }}</text>
  144. </view>
  145. <!-- <view class="detail-row" v-if="record.status === 1">-->
  146. <!-- <text class="detail-label">审核时间</text>-->
  147. <!-- <text class="detail-value">{{ record.finishTime }}</text>-->
  148. <!-- </view>-->
  149. <view class="detail-row">
  150. <text class="detail-label">商品总数</text>
  151. <text class="detail-value">{{ record.writeOffNum }}</text>
  152. </view>
  153. <view class="detail-row product-item" v-for="(item, index) in record.writeOffRecordDetailVos" :key="index">
  154. <text class="detail-label">{{ item.categoryName }}</text>
  155. <text class="detail-value">{{ item.num }}</text>
  156. </view>
  157. </view>
  158. </view>
  159. <uni-load-more :status="loadStatus"></uni-load-more>
  160. </scroll-view>
  161. <view v-if="currentTab == 4" style="
  162. padding-top: 17px;
  163. padding-right: 17px;">
  164. <view class="query-btn" style="width: 25%;float: right" @click="toHistory()">
  165. <view class="query-btn-icon">
  166. </view>
  167. <view class="query-btn-text">详情记录</view>
  168. </view>
  169. </view>
  170. <scroll-view v-if="currentTab == 4">
  171. <view class="data-display-container">
  172. <view class="header-row">
  173. <view class="header-item">项目</view>
  174. <view class="header-item">已核销</view>
  175. <view class="header-item">未核销</view>
  176. </view>
  177. <view class="data-body">
  178. <view class="data-row" v-for="(item, index) in hexiaoList" :key="index">
  179. <view class="data-cell item-column">{{ item.itemName }}</view>
  180. <view class="data-cell">{{ item.writeOffCount }}</view>
  181. <view class="data-cell">{{ item.waitWriteOffCount }}</view>
  182. </view>
  183. </view>
  184. </view>
  185. </scroll-view>
  186. <u-calendar min-date="2025-07-01" max-date="2030-07-01" @close="timeShow = false" :show="timeShow" :mode="mode" @confirm="confirm"></u-calendar>
  187. </view>
  188. </template>
  189. <script>
  190. import {queryJxsAddRecord,doCommitToJxs,doCommitToChang, queryHexiaoRecord,queryPendingWriteOffRecord,queryWriteOffDetailByItem,queryStoreSummary} from "@/api/hexiao";
  191. export default {
  192. data() {
  193. return {
  194. startTime: '',
  195. endTime: '',
  196. timeShow: false,
  197. startTimeXd:"",
  198. mode: 'range',
  199. searchQuery: '',
  200. storeNameQuery: '',
  201. tabs: [
  202. { name: '待审核', key: 'pending',id: 1 },
  203. // { name: '核销中', key: 'verifying', id: 2},
  204. { name: '已提交', key: 'verified' , id :3},
  205. { name: '我的账户', key: 'zhanghu' , id :4},
  206. { name: '门店汇总', key: 'storeSummary' , id :5},
  207. ],
  208. currentTab: 1,
  209. recordList: [],
  210. hexiaoList:[],
  211. summaryList: [],
  212. pendingList:[],
  213. grandTotal: 0,
  214. pagination: { page: 1, limit: 10 },
  215. loadStatus: 'more', // 'more', 'loading', 'noMore'
  216. isLoading: false,
  217. };
  218. },
  219. onLoad() {
  220. this.getReadyData(true);
  221. },
  222. onPullDownRefresh() {
  223. if (this.currentTab === 1) {
  224. this.getReadyData(true);
  225. return;
  226. }
  227. if (this.currentTab === 4) {
  228. this.itemByDetail();
  229. return;
  230. }
  231. if (this.currentTab === 5) {
  232. this.fetchStoreSummary(true);
  233. return;
  234. }
  235. this.fetchRecords(true);
  236. },
  237. methods: {
  238. toHistory(){
  239. uni.navigateTo({ url: `/pages/hexiao/jxs/hexiao_record_history`});
  240. },
  241. confirm(e) {
  242. this.startTime = e[0];
  243. this.endTime = e[e.length-1];
  244. this.startTimeXd = e[0]+' ~ '+e[e.length-1];
  245. if(!this.show){
  246. this.handleSearch()
  247. }
  248. this.timeShow = false;
  249. },
  250. getStatusClass(status){
  251. const statusMap = {
  252. 1: 'pending',
  253. 2: 'verifying',
  254. 3: 'verified',
  255. };
  256. return statusMap[status] || '';
  257. },
  258. getStatusText(status) {
  259. const statusMap = {
  260. 0: '核销中',
  261. 1: '已提交'
  262. };
  263. return statusMap[status] || '未知';
  264. },
  265. changeTab(tabKey) {
  266. if (this.currentTab === tabKey) return;
  267. this.currentTab = tabKey;
  268. if(this.currentTab ==1){
  269. this.getReadyData(true);
  270. }else{
  271. if(this.currentTab == 4){
  272. this.itemByDetail();
  273. return;
  274. }
  275. if (this.currentTab === 5) {
  276. this.fetchStoreSummary(true);
  277. return;
  278. }
  279. this.fetchRecords(true); // 切换tab时重新加载数据
  280. }
  281. },
  282. getReadyData(isRefresh = false) {
  283. queryPendingWriteOffRecord({pageIndex:this.pagination.page,pageSize:100,ywyName:this.searchQuery}).then(res=>{
  284. this.pendingList = res.data.records?res.data.records:[];
  285. })
  286. },
  287. async fetchRecords(isRefresh = false) {
  288. if (this.isLoading || (this.loadStatus === 'noMore' && !isRefresh)) {
  289. return;
  290. }
  291. if (isRefresh) {
  292. this.pagination.page = 1;
  293. this.recordList = [];
  294. this.loadStatus = 'more';
  295. }
  296. this.isLoading = true;
  297. this.loadStatus = 'loading';
  298. let data = {};
  299. if(this.currentTab !== -1){
  300. data.status = this.currentTab-2;
  301. }
  302. data.startTime = this.startTime;
  303. data.endTime = this.endTime;
  304. data.pageIndex = this.pagination.page
  305. data.pageSize = this.pagination.limit
  306. queryHexiaoRecord(data).then(res=>{
  307. let finalData = res.data.records;
  308. if(!finalData){
  309. finalData = [];
  310. }
  311. if (finalData.length > 0) {
  312. this.recordList = [...this.recordList, ...finalData];
  313. this.pagination.page++;
  314. this.loadStatus = 'more';
  315. } else {
  316. this.loadStatus = 'noMore';
  317. }
  318. this.isLoading = false;
  319. uni.stopPullDownRefresh();
  320. });
  321. },
  322. detail(id,type){
  323. if(type == 1){
  324. uni.navigateTo({ url: `/pages/hexiao/jxs/hexiao_pending_detail?id=`+id });
  325. return;
  326. }
  327. uni.navigateTo({ url: `/pages/hexiao/jxs/hexiao_detail?id=`+id });
  328. },
  329. loadMore() {
  330. this.fetchRecords();
  331. },
  332. clearSearch(){
  333. this.startTime = "";
  334. this.endTime = "";
  335. this.startTimeXd = "";
  336. this.storeNameQuery = "";
  337. this.handleSearch()
  338. },
  339. handleSearch() {
  340. if (this.currentTab === 5) {
  341. this.fetchStoreSummary(true);
  342. return;
  343. }
  344. this.fetchRecords(true);
  345. },
  346. verify(id) {
  347. let title = "确认核销该订单吗?";
  348. if(id == -1){
  349. title = "一键核销";
  350. }
  351. uni.showModal({
  352. title: '提示',
  353. content: title,
  354. success: (res) => {
  355. if (res.confirm) {
  356. doCommitToChang(id).then(res=>{
  357. if(res.code === 0){
  358. this.getReadyData(true);
  359. uni.showToast({ title: '核销成功' });
  360. }else{
  361. uni.showToast({ title: '核销失败' });
  362. }
  363. });
  364. }
  365. }
  366. });
  367. },
  368. itemByDetail() {
  369. queryWriteOffDetailByItem({}).then(res=>{
  370. this.hexiaoList = res.data;
  371. })
  372. },
  373. async fetchStoreSummary(isRefresh = false) {
  374. if (this.isLoading) return;
  375. this.isLoading = true;
  376. try {
  377. const params = {
  378. startTime: this.startTime,
  379. endTime: this.endTime,
  380. storeName: this.storeNameQuery
  381. };
  382. const res = await queryStoreSummary(params);
  383. if (res.code === 0) {
  384. this.summaryList = res.data || [];
  385. this.grandTotal = res.data.grandTotal || 0;
  386. } else {
  387. this.summaryList = [];
  388. this.grandTotal = 0;
  389. uni.showToast({ title: '获取汇总数据失败', icon: 'none' });
  390. }
  391. } catch (error) {
  392. this.summaryList = [];
  393. this.grandTotal = 0;
  394. } finally {
  395. this.isLoading = false;
  396. uni.stopPullDownRefresh();
  397. }
  398. }
  399. }
  400. }
  401. </script>
  402. <style lang="scss" scoped>
  403. .page-container {
  404. display: flex;
  405. flex-direction: column;
  406. height: 100vh;
  407. background-color: #f5f6fa;
  408. }
  409. .sticky-header {
  410. position: sticky;
  411. top: 0;
  412. z-index: 100;
  413. background-color: #f5f6fa;
  414. }
  415. .search-wrapper {
  416. padding: 20rpx;
  417. background-color: #ffffff;
  418. }
  419. .search-bar {
  420. display: flex;
  421. align-items: center;
  422. background-color: #f5f6fa;
  423. border-radius: 50rpx;
  424. padding: 0 25rpx;
  425. height: 70rpx;
  426. }
  427. .search-input { flex: 1; font-size: 28rpx; margin-left: 15rpx; }
  428. .placeholder { color: #b0b0b0; }
  429. .tabs-wrapper {
  430. display: flex;
  431. background-color: #ffffff;
  432. border-bottom: 1rpx solid #f0f0f0;
  433. .tab-item {
  434. flex: 1;
  435. text-align: center;
  436. padding: 25rpx 0;
  437. font-size: 28rpx;
  438. color: #666;
  439. position: relative;
  440. &.active {
  441. color: #3c82f8;
  442. font-weight: 500;
  443. &::after {
  444. content: '';
  445. position: absolute;
  446. bottom: 0;
  447. left: 50%;
  448. transform: translateX(-50%);
  449. width: 60rpx;
  450. height: 6rpx;
  451. background-color: #3c82f8;
  452. border-radius: 3rpx;
  453. }
  454. }
  455. }
  456. }
  457. .list-container {
  458. flex: 1;
  459. height: 100%;
  460. }
  461. .empty-list { text-align: center; color: #999; padding-top: 150rpx; }
  462. .record-card {
  463. background-color: #ffffff;
  464. border-radius: 16rpx;
  465. margin: 20rpx;
  466. padding: 30rpx;
  467. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  468. position: relative;
  469. }
  470. .card-header {
  471. display: flex;
  472. align-items: center;
  473. padding-bottom: 20rpx;
  474. border-bottom: 1rpx solid #f5f5f5;
  475. .record-id {
  476. font-size: 30rpx;
  477. font-weight: bold;
  478. color: #333;
  479. margin-left: 15rpx;
  480. }
  481. }
  482. .status-badge {
  483. position: absolute;
  484. top: 0;
  485. right: 0;
  486. padding: 8rpx 20rpx;
  487. font-size: 24rpx;
  488. color: #fff;
  489. border-top-right-radius: 16rpx;
  490. border-bottom-left-radius: 16rpx;
  491. &.pending { background-color: #3c82f8; }
  492. &.verifying { background-color: #ff9900; }
  493. &.verified { background-color: #909399; }
  494. }
  495. .card-body {
  496. padding-top: 10rpx;
  497. }
  498. .detail-row {
  499. display: flex;
  500. justify-content: space-between;
  501. align-items: center;
  502. padding: 12rpx 0;
  503. font-size: 28rpx;
  504. .detail-label { color: #666; }
  505. .detail-value { color: #333; }
  506. &.product-item {
  507. .detail-label { color: #333; }
  508. .detail-value { color: #999; }
  509. }
  510. }
  511. .card-footer {
  512. display: flex;
  513. justify-content: flex-end;
  514. margin-top: 20rpx;
  515. }
  516. .verify-btn {
  517. background-color: #3c82f8;
  518. color: #fff;
  519. font-size: 26rpx;
  520. padding: 0 30rpx;
  521. height: 60rpx;
  522. line-height: 60rpx;
  523. border-radius: 30rpx;
  524. margin: 0;
  525. &::after { border: none; }
  526. }
  527. .query-btn {
  528. background-color: #409eff;
  529. color: #fff;
  530. padding: 20rpx;
  531. border-radius: 10rpx;
  532. height: 34rpx;
  533. display: flex;
  534. justify-content: center;
  535. align-items: center;
  536. }
  537. .query-btn-icon {
  538. height: 32rpx;
  539. width: 32rpx;
  540. background-image:
  541. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/queryIoc.png");
  542. background-size: cover;
  543. background-position: center;
  544. background-repeat: no-repeat;
  545. }
  546. .query-btn-text {
  547. font-weight: 400;
  548. font-size: 30rpx;
  549. color: #F5F5F5;
  550. }
  551. .store-summary-container {
  552. background-color: #f5f6fa;
  553. overflow: auto;
  554. height: 100%;
  555. }
  556. .summary-list {
  557. height: 100%;
  558. }
  559. .summary-table-wrapper {
  560. background-color: #ffffff;
  561. border-radius: 16rpx;
  562. margin: 20rpx;
  563. overflow: hidden;
  564. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  565. }
  566. .table-header {
  567. display: flex;
  568. background-color: #f8f9fa;
  569. padding: 24rpx 20rpx;
  570. border-bottom: 1rpx solid #e8e8e8;
  571. .header-cell {
  572. font-size: 28rpx;
  573. font-weight: 600;
  574. color: #333;
  575. text-align: center;
  576. &.store-col {
  577. width: 220rpx;
  578. flex-shrink: 0;
  579. }
  580. &.product-col {
  581. flex: 1;
  582. }
  583. &.number-col {
  584. width: 150rpx;
  585. flex-shrink: 0;
  586. text-align: center;
  587. }
  588. }
  589. }
  590. .table-body {
  591. .table-row {
  592. display: flex;
  593. align-items: center;
  594. padding: 0 20rpx;
  595. min-height: 100rpx;
  596. border-bottom: 1rpx solid #a5a5a5;
  597. .table-cell {
  598. font-size: 28rpx;
  599. color: #333;
  600. display: flex;
  601. align-items: center;
  602. padding: 20rpx 0;
  603. min-height: 100rpx;
  604. box-sizing: border-box;
  605. &.store-col {
  606. width: 220rpx;
  607. flex-shrink: 0;
  608. .store-name-cell {
  609. display: flex;
  610. align-items: center;
  611. uni-icons {
  612. margin-right: 10rpx;
  613. }
  614. .store-name-text {
  615. font-weight: 500;
  616. }
  617. }
  618. }
  619. &.product-col {
  620. flex: 1;
  621. }
  622. &.number-col {
  623. width: 150rpx;
  624. flex-shrink: 0;
  625. text-align: right;
  626. justify-content: flex-end;
  627. }
  628. }
  629. }
  630. }
  631. .table-row-cl2{
  632. display: flex;
  633. }
  634. .fixed-footer {
  635. position: fixed;
  636. bottom: 0;
  637. left: 0;
  638. width: 100%;
  639. background-color: #f5f6fa;
  640. padding: 20rpx 30rpx;
  641. padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
  642. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  643. box-sizing: border-box;
  644. z-index: 100;
  645. }
  646. .add-btn {
  647. background-color: #3c82f8;
  648. color: white;
  649. border-radius: 50rpx;
  650. font-size: 32rpx;
  651. height: 90rpx;
  652. line-height: 90rpx;
  653. &::after { border: none; }
  654. }
  655. .data-display-container {
  656. padding: 30rpx;
  657. font-size: 28rpx;
  658. color: #333;
  659. min-height: 100vh; /* 确保内容撑满整个视口高度 */
  660. box-sizing: border-box; /* 边框和内边距包含在元素的总宽度和高度内 */
  661. }
  662. .card {
  663. background-color: #ffffff;
  664. border-radius: 16rpx;
  665. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08); /* 更柔和的阴影 */
  666. overflow: hidden; /* 确保圆角显示 */
  667. display: flex;
  668. flex-direction: column;
  669. max-height: calc(100vh - 60rpx); /* 卡片最大高度,留出上下padding */
  670. }
  671. .header-row {
  672. display: flex;
  673. flex-direction: row;
  674. background-color: #4A90E2; /* 品牌蓝色 */
  675. color: #ffffff;
  676. font-weight: bold;
  677. padding: 24rpx 0; /* 上下内边距增加 */
  678. border-bottom: 1rpx solid rgba(255, 255, 255, 0.2); /* 浅色边框 */
  679. position: sticky; /* 头部固定 */
  680. top: 0;
  681. z-index: 10;
  682. }
  683. .header-item {
  684. flex: 1;
  685. text-align: center;
  686. padding: 0 10rpx; /* 左右内边距 */
  687. font-size: 28rpx;
  688. }
  689. .data-body-scroll {
  690. flex: 1; /* 占据剩余空间 */
  691. overflow-y: auto; /* 允许滚动 */
  692. -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
  693. }
  694. .data-row {
  695. display: flex;
  696. flex-direction: row;
  697. align-items: center; /* 垂直居中对齐 */
  698. padding: 20rpx 0; /* 上下内边距 */
  699. border-bottom: 1rpx solid #f0f0f0; /* 更细的分割线 */
  700. transition: background-color 0.2s ease; /* 鼠标悬停或点击的平滑过渡 */
  701. }
  702. .data-row:last-child {
  703. border-bottom: none; /* 最后一行没有底部边框 */
  704. }
  705. .data-row.even-row {
  706. background-color: #f9f9f9; /* 隔行变色 */
  707. }
  708. .data-row:hover {
  709. background-color: #eef7ff; /* 悬停效果 */
  710. }
  711. .data-cell {
  712. flex: 1;
  713. padding: 0 10rpx; /* 左右内边距 */
  714. text-align: center;
  715. font-size: 26rpx; /* 数据字体略小 */
  716. color: #555;
  717. word-break: break-word; /* 允许长文本在任何地方换行 */
  718. line-height: 1.4; /* 增加行高 */
  719. }
  720. .item-column {
  721. text-align: left;
  722. padding-left: 20rpx; /* 品项左边距 */
  723. color: #333;
  724. font-weight: 500;
  725. }
  726. .no-data {
  727. text-align: center;
  728. padding: 40rpx;
  729. color: #999;
  730. font-size: 30rpx;
  731. }
  732. </style>