settle.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="settle-page">
  3. <view class="settle-info">
  4. <view class="label">未结算金额</view>
  5. <view class="not-settle-price">¥{{moneyConverter(form.unSettleMoney)}}</view>
  6. <view class="label yjs">已结算金额: ¥{{moneyConverter(form.settledMoney)}}</view>
  7. </view>
  8. <view class="settle-tabs">
  9. <view class="tabs-wrap">
  10. <u-tabs
  11. class="tabs"
  12. :list="tabs"
  13. :activeStyle="{ color: '#1A78F6' }"
  14. :itemStyle="itemStyle"
  15. :is-scroll="false"
  16. @change="activeChange"
  17. :current="active">
  18. </u-tabs>
  19. </view>
  20. <scroll-view class="settle-list" :scroll-y="true">
  21. <view class="line"></view>
  22. <view class="item" v-for="item in settleList" :key="item.accountDate" @click="handItemInfo(item)">
  23. <view class="label">{{ item.accountDate }}</view>
  24. <view class="value">
  25. <view class="price" :class="{ sr: item.actualIncom > 0 }">{{ item.actualIncom > 0 ? '+¥' : '-¥' }}{{ moneyConverter(Math.abs(item.actualIncom)) }}</view>
  26. <u-icon class="more" name="arrow-right" size="22" color="#6c6c6c"></u-icon>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {mapState} from 'vuex';
  35. export default {
  36. data () {
  37. return {
  38. listUrl: '/storeSettlementApi/getStoreStatementListForStore',
  39. active: 0,
  40. itemStyle: {
  41. width: 'calc(50vw - 20rpx)',
  42. height: '80rpx'
  43. },
  44. tabs: [
  45. {
  46. name: '未结算金额'
  47. },
  48. {
  49. name: '已结算金额'
  50. }
  51. ],
  52. form: {
  53. settledMoney: 0,
  54. unSettleMoney: 0
  55. },
  56. settleList: []
  57. }
  58. },
  59. computed: {
  60. ...mapState(['storeInfo'])
  61. },
  62. methods: {
  63. handItemInfo (item) {
  64. uni.navigateTo({
  65. url: `/pages/tools/settle-info?time=${item.accountDate}&money=${item.actualIncom}&orderNum=${item.orderNum}`
  66. });
  67. },
  68. activeChange(e) {
  69. this.active = e.index
  70. this.loadData()
  71. },
  72. loadData() {
  73. uni.showLoading({
  74. title: '加载中'
  75. });
  76. var dateStr = (new Date()).getTime();
  77. var sign = this.getSign(dateStr);
  78. let that = this;
  79. this.requst({
  80. url: this.listUrl,
  81. data: {
  82. timestamp: dateStr,
  83. sign: sign,
  84. storeId: this.storeInfo.storeId,
  85. status: this.active,
  86. },
  87. success: res => {
  88. if (res.data.rtnBean.rtnCode == 0) {
  89. uni.hideLoading();
  90. this.settleList = res.data.list;
  91. this.form = res.data.obj;
  92. } else {
  93. uni.hideLoading();
  94. if (res.data.rtnBean.rtnMsg != '') {
  95. this.$api.msg(res.data.rtnBean.rtnMsg);
  96. return;
  97. }
  98. }
  99. },
  100. fail: (e) => {
  101. console.log("接口调用失败:" + JSON.stringify(e));
  102. uni.hideLoading();
  103. },
  104. })
  105. }
  106. },
  107. onLoad () {
  108. this.loadData()
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .settle-page {
  114. min-height: 100vh;
  115. background-color: #f5f5f5;
  116. }
  117. .settle-info {
  118. background-color: $theme-color;
  119. height: 324rpx;
  120. color: #fff;
  121. padding: 40rpx 40rpx 70rpx;
  122. box-sizing: border-box;
  123. border-radius: 0 0 20rpx 20rpx;
  124. .not-settle-price {
  125. font-weight: bold;
  126. font-size: 56rpx;
  127. text-align: center;
  128. margin: 10rpx 0 42rpx;
  129. }
  130. .yjs {
  131. font-size: $font-base;
  132. }
  133. }
  134. .settle-tabs {
  135. width: calc(100vw - 40rpx);
  136. height: calc(100vh - 324rpx - constant(safe-area-inset-bottom));
  137. height: calc(100vh - 324rpx - env(safe-area-inset-bottom));
  138. margin-left: 20rpx;
  139. border-radius: 10rpx;
  140. position: relative;
  141. top: -40rpx;
  142. background-color: #fff;
  143. }
  144. .settle-list {
  145. width: 100%;
  146. height: calc(100vh - 444rpx - constant(safe-area-inset-bottom));
  147. height: calc(100vh - 444rpx - env(safe-area-inset-bottom));
  148. padding: 0 20rpx;
  149. box-sizing: border-box;
  150. margin-top: 20rpx;
  151. .line {
  152. height: 2rpx;
  153. width: 100%;
  154. background-color: #ececec;
  155. }
  156. .item {
  157. border-bottom: 2rpx solid #ececec;
  158. height: 100rpx;
  159. @include between;
  160. }
  161. .value {
  162. @include between(flex-end);
  163. }
  164. .price {
  165. margin-right: 10rpx;
  166. }
  167. .price.sr {
  168. color: $uni-color-button;
  169. }
  170. }
  171. </style>