list.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="settle-page">
  3. <view style="font-size:36upx;margin-top:20upx;">累计已结账:¥{{totalAmount}}</view>
  4. <view scroll-y class="settle-list">
  5. <block v-if="!$util.isEmpty(list.data)">
  6. <SettleItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetail(item)"></SettleItem>
  7. </block>
  8. <block v-else>
  9. <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
  10. </block>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import SettleItem from "./settleOrderItem";
  16. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  17. import { list } from "@/mixins";
  18. import { getList } from "@/api/settle";
  19. export default {
  20. components: {
  21. SettleItem,
  22. AppWrapperEmpty
  23. },
  24. mixins: [list],
  25. data() {
  26. return {
  27. totalAmount:0
  28. }
  29. },
  30. onPullDownRefresh() {
  31. this.resetList();
  32. this.getSettleList().then(res => {
  33. uni.stopPullDownRefresh();
  34. });
  35. },
  36. onReachBottom() {
  37. if (!this.list.finished) {
  38. this.getSettleList().then((res) => {
  39. uni.stopPullDownRefresh();
  40. });
  41. } else {
  42. uni.stopPullDownRefresh();
  43. }
  44. },
  45. methods: {
  46. async init() {
  47. this.getSettleList();
  48. },
  49. getSettleList() {
  50. let options = {
  51. page: this.list.page,
  52. pageSize: this.list.pageSize,
  53. customId:this.option.customId
  54. };
  55. return getList(options).then(res => {
  56. this.totalAmount = res.data.totalAmount ? parseFloat(res.data.totalAmount) : 0
  57. this.completes(res);
  58. })
  59. },
  60. gotoDetail(item) {
  61. uni.navigateTo({
  62. url: `/admin/settle/detail?id=${item.id}`,
  63. success: result => {},
  64. fail: () => {},
  65. complete: () => {}
  66. });
  67. }
  68. }
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .settle-page {
  73. height: 100%;
  74. display: flex;
  75. flex-direction: column;
  76. background-color: #f9fbfc;
  77. .settle-list {
  78. padding-top: 20upx;
  79. padding-bottom: 80upx;
  80. flex: 1;
  81. .settle-item {
  82. margin-bottom: 1upx;
  83. padding: 30upx;
  84. display: flex;
  85. align-items: center;
  86. box-shadow: 0upx 1upx 0upx 0upx #eeeeee;
  87. background-color: #fff;
  88. .info {
  89. flex: 1;
  90. margin-right: 20upx;
  91. .info-order {
  92. font-size: 32upx;
  93. font-weight: 600;
  94. color: #333333;
  95. }
  96. .info-name {
  97. margin: 40upx 0 20upx;
  98. font-size: 28upx;
  99. font-weight: 400;
  100. color: #666666;
  101. }
  102. .info-time {
  103. margin-right: 30upx;
  104. font-size: 28upx;
  105. font-weight: 400;
  106. color: #666666;
  107. }
  108. }
  109. .status {
  110. display: flex;
  111. flex-direction: column;
  112. align-items: center;
  113. flex-shrink: 0;
  114. width: 100upx;
  115. color: #cccccc;
  116. .status-name {
  117. margin-top: 10upx;
  118. font-size: 24upx;
  119. }
  120. .iconfont {
  121. font-size: 46upx;
  122. }
  123. &.primary {
  124. color: #3385ff;
  125. }
  126. &.gray {
  127. color: #cccccc;
  128. }
  129. &.warn {
  130. color: #ffaf1d;
  131. }
  132. }
  133. }
  134. }
  135. .bar-view {
  136. flex-shrink: 0;
  137. display: flex;
  138. justify-content: flex-end;
  139. align-items: center;
  140. padding: 0 30upx;
  141. width: 100%;
  142. height: 100upx;
  143. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  144. .btn-view {
  145. display: flex;
  146. .admin-button-com {
  147. margin: 0 10upx;
  148. width: 140upx;
  149. }
  150. }
  151. }
  152. }
  153. </style>