collect.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="collect-page">
  3. <view class="info">
  4. <view class="total-collect">
  5. 预计总收入: <text class="price">¥{{ moneyConverter(form.total) }}</text>
  6. </view>
  7. <view class="order">
  8. <view class="col">已完成: <text class="num">{{ form.completedNum }}</text>单</view>
  9. <view class="col">进行中: <text class="num">{{ form.progressNum }}</text>单</view>
  10. </view>
  11. <view class="income">
  12. <view class="col">预计收入: <text class="price">{{ moneyConverter(form.completedMoney) }}</text></view>
  13. <view class="col">预计收入: <text class="price">{{ moneyConverter(form.progressMoney) }}</text></view>
  14. </view>
  15. <view class="cancel">
  16. 已取消/退款: <text class="price">{{ form.refundNum }}</text>单
  17. </view>
  18. <view class="collect">
  19. 总计: <text class="price">¥{{ moneyConverter(form.refundMoney) }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {mapState} from 'vuex';
  26. export default {
  27. data () {
  28. return {
  29. summaryUrl: '/storeOrderApi/orderSummary',
  30. dateStr: '',
  31. form: {
  32. completedNum: 0,
  33. progressNum: 0,
  34. refundNum: 0,
  35. completedMoney: 0,
  36. progressMoney: 0,
  37. refundMoney: 0,
  38. total: 0,
  39. }
  40. }
  41. },
  42. computed: {
  43. ...mapState(['storeInfo'])
  44. },
  45. methods: {
  46. loadData() {
  47. var dateStr = (new Date()).getTime();
  48. var sign = this.getSign(dateStr);
  49. uni.showLoading({
  50. title: '加载中'
  51. });
  52. let that = this;
  53. this.requst({
  54. url: this.summaryUrl,
  55. data: {
  56. timestamp: dateStr,
  57. sign: sign,
  58. dateStr: this.dateStr,
  59. storeId: this.storeInfo.storeId
  60. },
  61. success: res => {
  62. if (res.data.rtnBean.rtnCode == 0) {
  63. uni.hideLoading();
  64. this.form = res.data.obj
  65. } else {
  66. if (res.data.rtnBean.rtnMsg != '') {
  67. uni.hideLoading();
  68. this.$api.msg(res.data.rtnBean.rtnMsg);
  69. }
  70. }
  71. },
  72. fail: (e) => {
  73. console.log("接口调用失败:" + JSON.stringify(e));
  74. uni.hideLoading();
  75. },
  76. })
  77. }
  78. },
  79. onLoad (opt) {
  80. if (!opt.day) return
  81. let date = opt.day.slice(0, 10);
  82. this.dateStr = date;
  83. this.loadData();
  84. uni.setNavigationBarTitle({
  85. title: date + ' 营业汇总'
  86. })
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .collect-page {
  92. background-color: #f5f5f5;
  93. min-height: 100vh;
  94. border-top: 2rpx solid #f5f5f5;
  95. }
  96. .info {
  97. width: calc(100vw - 40rpx);
  98. margin: 20rpx;
  99. background-color: #fff;
  100. border-radius: 20rpx;
  101. padding: 20rpx;
  102. box-sizing: border-box;
  103. }
  104. .price {
  105. font-size: 40rpx;
  106. margin: 0 20rpx;
  107. }
  108. .total-collect {
  109. margin: 30rpx 0 50rpx;
  110. font-size: 40rpx;
  111. .price {
  112. color: $uni-color-button;
  113. font-weight: bold;
  114. }
  115. }
  116. .order, .income {
  117. margin-top: 8rpx;
  118. @include between;
  119. .col {
  120. flex: 1;
  121. }
  122. .num {
  123. font-weight: bold;
  124. margin: 0 20rpx;
  125. font-size: 40rpx;
  126. margin-bottom: 20rpx;
  127. }
  128. .price {
  129. color: $uni-color-button;
  130. }
  131. }
  132. .cancel {
  133. margin: 40rpx 0 10rpx;
  134. .price {
  135. color: #000;
  136. font-weight: bold;
  137. }
  138. }
  139. .collect {
  140. margin-bottom: 40rpx;
  141. }
  142. </style>