recharge.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view>
  3. <ujp-navbar :is-back="false" title="充值明细">
  4. <view class="navbar-screen" slot="right" @click="showdate = true"><span>筛选</span>
  5. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  6. </view>
  7. </ujp-navbar>
  8. <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
  9. <view class="topBodyMain" v-if="list.length">
  10. <view class="topBody1">
  11. <view>{{form.startDate}}</view>
  12. <view>充值人次:{{recordsTotal}}</view>
  13. </view>
  14. <view class="topBody2">
  15. <view>充值:{{topBody.totalFee}}元</view>
  16. <view>退款:{{topBody.refundFee}}元</view>
  17. <view>汇总:{{topBody.sumFee}}元</view>
  18. </view>
  19. </view>
  20. <view class="detailed">
  21. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  22. <img src="@/assets/img/blankpage.png">
  23. <view>查询为空</view>
  24. </view>
  25. <view class="detailed-list" v-for="(item ,index) in list" :key="index">
  26. <view class="detailed-item detailed-item-body">
  27. <view class="nickNameBody">
  28. <view class="line1">
  29. <view class="span nickName">{{item.nickName}} </view>
  30. <view class="span">{{item.phone}} </view>
  31. </view>
  32. <view class="line2">
  33. <view class="span">充值:{{item.totalFee}}</view>
  34. <view class="span" :class="{
  35. refundFee:item.refundFee
  36. }">退款:{{item.refundFee}}</view>
  37. </view>
  38. <view class="line3">
  39. <view class="span">
  40. <u-icon name="clock"></u-icon>{{item.payTime?item.payTime.slice(11):''}}
  41. </view>
  42. <view class="span">
  43. {{item.outOrderNo}}
  44. </view>
  45. </view>
  46. </view>
  47. <view class="totalFee" :class="{
  48. refundFee:item.refundFee
  49. }">
  50. {{item.showFee?item.showFee.toFixed(2):0}}元
  51. </view>
  52. </view>
  53. </view>
  54. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;"
  55. bg-color="#f7f7f7">已经到底了</u-divider>
  56. </view>
  57. <Tabbar :current="2" ref="tabbarMain"></Tabbar>
  58. </view>
  59. </template>
  60. <script>
  61. import Tabbar from '@/components/TabbarFinance.vue'
  62. import * as API from '@/apis/finance.js'
  63. import {
  64. beforeTimeStamp,
  65. currentTimeStamp,
  66. parseUnixTime
  67. } from '@/utils'
  68. export default {
  69. data() {
  70. return {
  71. showdate: false,
  72. form: {
  73. },
  74. pageIndex: 1,
  75. recordsTotal: 0,
  76. list: [],
  77. topBody: {
  78. totalFee: 0,
  79. refundFee: 0,
  80. sumFee: 0
  81. }
  82. }
  83. },
  84. components: {
  85. Tabbar
  86. },
  87. onReachBottom() {
  88. this.myLoadmore();
  89. },
  90. onShow() {
  91. if (this.$refs.tabbarMain) {
  92. this.$refs.tabbarMain.setcount(1);
  93. }
  94. },
  95. onLoad() {
  96. },
  97. onReady() {
  98. this.info = this.carhelp.getPersonInfo()
  99. this.form.startDate = parseUnixTime(new Date(), '{y}-{m}-{d}')
  100. this.form.endDate = parseUnixTime(new Date(), '{y}-{m}-{d}')
  101. this.getList()
  102. //this.getStation()
  103. },
  104. methods: {
  105. changedate(e) {
  106. // this.queryDate = e.result
  107. this.form.startDate = e.result
  108. this.form.endDate = e.result
  109. this.getList()
  110. },
  111. getList() {
  112. uni.showLoading({
  113. title: "加载中",
  114. mask: true,
  115. })
  116. this.form.pageIndex = this.pageIndex
  117. this.form.pageSize = 999
  118. API.rechargeList(this.form).then((res) => {
  119. this.list = res.data.data;
  120. this.topBody.totalFee = 0
  121. this.topBody.refundFee = 0
  122. this.list.forEach(item => {
  123. item.showFee = item.totalFee - item.refundFee
  124. this.topBody.totalFee += item.totalFee
  125. this.topBody.refundFee += item.refundFee
  126. })
  127. this.topBody.totalFee = this.topBody.totalFee.toFixed(2)
  128. this.topBody.refundFee = this.topBody.refundFee.toFixed(2)
  129. this.topBody.sumFee = this.topBody.totalFee - this.topBody.refundFee;
  130. this.topBody.sumFee = this.topBody.sumFee.toFixed(2)
  131. this.recordsTotal = res.data.recordsTotal
  132. uni.hideLoading()
  133. }).catch(error => {
  134. uni.showToast({
  135. title: error
  136. })
  137. })
  138. },
  139. myLoadmore() {
  140. if (this.list.length < this.recordsTotal) {
  141. this.pageIndex += 1;
  142. this.getList()
  143. }
  144. },
  145. }
  146. }
  147. </script>
  148. <style>
  149. page {
  150. background-color: #F7F7F7;
  151. }
  152. </style>
  153. <style lang="scss" scoped>
  154. .topBodyMain {
  155. padding: 20rpx 40rpx;
  156. display: flex;
  157. justify-content: space-between;
  158. position: fixed;
  159. top: 90rpx;
  160. width: 100%;
  161. background: #dbd9d9;
  162. z-index: 999;
  163. }
  164. .detailed {
  165. padding-top: 160rpx;
  166. .detailed-list {
  167. padding: 20rpx 40rpx;
  168. border-bottom: 1px solid #d6c0c0;
  169. background-color: #fff;
  170. .detailed-item-body {
  171. display: flex;
  172. justify-content: space-between;
  173. align-items: center;
  174. .refundFee {
  175. color: #fd8008;
  176. }
  177. .nickNameBody {
  178. .line1,
  179. .line2 {
  180. display: flex;
  181. font-size: 32rpx;
  182. .span {
  183. margin-right: 20rpx;
  184. }
  185. }
  186. .line1 {
  187. color: #777777
  188. }
  189. .line2 {
  190. margin: 8rpx 0;
  191. }
  192. .line3 {
  193. display: flex;
  194. color: #777777;
  195. .span {
  196. margin-right: 20rpx;
  197. }
  198. }
  199. .nickName {
  200. width: 200rpx;
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. white-space: nowrap;
  204. }
  205. }
  206. .totalFee {
  207. font-weight: bold;
  208. font-size: 48rpx;
  209. white-space: pre;
  210. // margin-left: 40rpx;
  211. }
  212. }
  213. }
  214. }
  215. </style>