hexiao_detail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view class="page-container">
  3. <view class="info-card">
  4. <view class="info-row">
  5. <text class="info-label">申请时间</text>
  6. <text class="info-value">{{ detail.applyTime }}</text>
  7. </view>
  8. <view class="info-row">
  9. <text class="info-label">单号</text>
  10. <text class="info-value">{{ detail.orderNo }}</text>
  11. </view>
  12. <view class="info-row" v-if="detail.status == 0">
  13. <text class="info-label">状态</text>
  14. <text class="info-value">审核中</text>
  15. </view>
  16. <view class="info-row" v-if="detail.status == 1">
  17. <text class="info-label">状态</text>
  18. <text class="info-value">已核销</text>
  19. </view>
  20. <!-- <view class="info-row" v-if="detail.status == 1">-->
  21. <!-- <text class="info-label">核销时间</text>-->
  22. <!-- <text class="info-value">{{ detail.finishTime }}</text>-->
  23. <!-- </view>-->
  24. </view>
  25. <view class="info-card" v-for="item in detail.items">
  26. <view class="info-row">
  27. <text class="info-label">核销业务员</text>
  28. <text class="info-value">{{ item.ywyName }}</text>
  29. </view>
  30. <view class="info-row" v-if="detail.status == 3">
  31. <text class="info-label">审核时间</text>
  32. <text class="info-value">{{ detail.finishTime }}</text>
  33. </view>
  34. <view class="info-row" v-for="shiwu in item.shiwuDetails">
  35. <text class="info-label">{{ shiwu.categoryName }}</text>
  36. <text class="info-value">{{ shiwu.num }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {queryAddJxsRecordDetail} from "@/api/hexiao";
  43. export default {
  44. data() {
  45. return {
  46. id:"",
  47. // 总览信息
  48. recordInfo: {
  49. storeName: '湖南长沙超吉炫旗舰店',
  50. verificationTime: '2025-08-11 09:30:00',
  51. },
  52. // 分类汇总数据
  53. summaryData: [
  54. ],
  55. // 所有明细的列表
  56. detailsList: [],
  57. // 分页加载相关
  58. pagination: { page: 1, limit: 15 },
  59. loadStatus: 'more', // 'more', 'loading', 'noMore'
  60. isLoading: false,
  61. detail:{totals:[]}
  62. };
  63. },
  64. onLoad(opt) {
  65. // 页面加载时,获取第一页数据
  66. // options.id 可以用来从上个页面传递记录ID
  67. this.id = opt.id
  68. this.getDetail(true);
  69. },
  70. onPullDownRefresh() {
  71. this.fetchDetails(true);
  72. },
  73. methods: {
  74. getDetail(){
  75. let data = {orderId:this.id};
  76. queryAddJxsRecordDetail(data).then(res=>{
  77. this.detail = res.data;
  78. })
  79. },
  80. // 模拟从API获取明细数据
  81. async fetchDetails(isRefresh = false) {
  82. if (this.isLoading || (this.loadStatus === 'noMore' && !isRefresh)) {
  83. return;
  84. }
  85. if (isRefresh) {
  86. this.pagination.page = 1;
  87. this.detailsList = [];
  88. this.loadStatus = 'more';
  89. }
  90. this.isLoading = true;
  91. this.loadStatus = 'loading';
  92. console.log(`请求第 ${this.pagination.page} 页明细...`);
  93. await new Promise(resolve => setTimeout(resolve, 1000));
  94. const mockData = Array.from({ length: this.pagination.limit }, (_, i) => {
  95. const id = (this.pagination.page - 1) * this.pagination.limit + i + 1;
  96. return {
  97. name: `超吉炫10元精制槟榔 - ${id}`,
  98. code: `BH2025010020${String(id).padStart(3, '0')}`
  99. };
  100. });
  101. const noMoreData = this.pagination.page >= 5; // 模拟加载4页后没有更多
  102. uni.stopPullDownRefresh();
  103. if (mockData.length > 0 && !noMoreData) {
  104. this.detailsList = [...this.detailsList, ...mockData];
  105. this.pagination.page++;
  106. this.loadStatus = 'more';
  107. } else {
  108. this.loadStatus = 'noMore';
  109. }
  110. this.isLoading = false;
  111. },
  112. // 滚动到底部加载更多
  113. loadMore() {
  114. this.fetchDetails();
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .page-container {
  121. display: flex;
  122. flex-direction: column;
  123. height: 100vh;
  124. background-color: #f5f6fa;
  125. }
  126. .info-card {
  127. background-color: #ffffff;
  128. border-radius: 16rpx;
  129. margin: 20rpx;
  130. padding: 20rpx 30rpx;
  131. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  132. }
  133. .info-row {
  134. display: flex;
  135. justify-content: space-between;
  136. align-items: center;
  137. font-size: 28rpx;
  138. padding: 15rpx 0;
  139. .info-label { color: #666; }
  140. .info-value { color: #333; }
  141. }
  142. .summary-card {
  143. display: flex;
  144. justify-content: space-around;
  145. background: linear-gradient(to right, #6ca1ff, #3c82f8);
  146. border-radius: 16rpx;
  147. margin: 0 20rpx 20rpx;
  148. padding: 20rpx 10rpx;
  149. color: #ffffff;
  150. }
  151. .summary-tab {
  152. display: flex;
  153. flex-direction: column;
  154. align-items: center;
  155. padding: 10rpx;
  156. .tab-category {
  157. font-size: 26rpx;
  158. opacity: 0.9;
  159. }
  160. .tab-count {
  161. font-size: 28rpx;
  162. font-weight: bold;
  163. margin-top: 10rpx;
  164. }
  165. }
  166. .details-list {
  167. flex: 1;
  168. height: 100%;
  169. padding: 0 20rpx;
  170. }
  171. .empty-tip {
  172. text-align: center;
  173. color: #999;
  174. padding-top: 100rpx;
  175. }
  176. .detail-item-card {
  177. background-color: #ffffff;
  178. border-radius: 16rpx;
  179. padding: 30rpx;
  180. margin-bottom: 20rpx;
  181. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  182. .item-name {
  183. display: block;
  184. font-size: 30rpx;
  185. font-weight: bold;
  186. color: #333;
  187. }
  188. .item-code {
  189. display: block;
  190. font-size: 26rpx;
  191. color: #999;
  192. margin-top: 15rpx;
  193. }
  194. }
  195. </style>