history.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="page">
  3. <view class="date-selecter">
  4. <view class="date" @click="show = true">{{ year }}年{{ month }}月</view>
  5. <u-icon class="icon" size="10" color="#333333" style="margin-left: 8rpx" name="arrow-down"></u-icon>
  6. </view>
  7. <view class="card">
  8. <view class="item" v-for="item in list">
  9. <view class="avatar">
  10. <u-avatar text="提现" size="80rpx"></u-avatar>
  11. </view>
  12. <view class="content">
  13. <view class="info">
  14. <view class="info-title">提现</view>
  15. <view class="amount">{{ currency(item.total, {
  16. symbol: '¥',
  17. fromCents: true
  18. }).format() }}</view>
  19. </view>
  20. <view class="type">
  21. <view class="desc">提现至微信</view>
  22. <view class="bill-type">{{ status[item.transferStatus] }}</view>
  23. </view>
  24. <view class="date">
  25. {{ $u.timeFormat(new Date(item.createTime), 'yyyy-mm-dd hh:MM') }}
  26. </view>
  27. <view style="color:red;font-size:20rpx;margin-top: 10rpx;" v-if="item.transferStatus == 'FAIL'">提现失败请一个小时后再次尝试</view>
  28. </view>
  29. </view>
  30. </view>
  31. <u-empty iconSize="90px" textSize="14px" v-if="list.length == 0"></u-empty>
  32. <u-datetime-picker :show="show" v-model="time" mode="year-month" @cancel="show = false" @close="show = false"
  33. @confirm="confirm"></u-datetime-picker>
  34. </view>
  35. </template>
  36. <script>
  37. import { queryTransfer } from '@/api/wallet'
  38. import currency from "@/utils/currency"
  39. export default {
  40. data() {
  41. return {
  42. list: [],
  43. show: false,
  44. year: new Date().getFullYear(),
  45. month: new Date().getMonth() + 1,
  46. walletId: '',
  47. time: new Date(),
  48. currency,
  49. status: {
  50. 'PROCESSING': '提现处理中',
  51. 'SUCCESS': "提现成功",
  52. 'FAIL': "提现失败",
  53. 'CLOSE': "提现关闭"
  54. }
  55. };
  56. },
  57. methods: {
  58. queryTransfer() {
  59. queryTransfer({
  60. year: this.year,
  61. month: this.month,
  62. walletId: this.walletId
  63. }).then(({ content }) => {
  64. if (content) {
  65. this.list = content
  66. }
  67. })
  68. },
  69. confirm({ value }) {
  70. this.year = new Date(value).getFullYear()
  71. this.month = new Date(value).getMonth() + 1
  72. this.queryTransfer()
  73. this.show = false
  74. }
  75. },
  76. onShow() {
  77. const walletId = uni.getStorageSync('walletId')
  78. this.walletId = walletId
  79. queryTransfer(
  80. {
  81. year: this.year,
  82. month: this.month,
  83. walletId
  84. }
  85. ).then(({ content }) => {
  86. if (content) {
  87. this.list = content
  88. }
  89. })
  90. }
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .page {
  95. background: #f9f9f9;
  96. min-height: 100vh;
  97. .date-selecter {
  98. color: #333333;
  99. display: flex;
  100. align-items: center;
  101. padding: 20rpx;
  102. .date {
  103. font-size: 28rpx;
  104. }
  105. }
  106. .card {
  107. background: #ffffff;
  108. .item {
  109. display: flex;
  110. padding: 30rpx;
  111. border-bottom: 1px solid #f0f0f0;
  112. .avatar {
  113. width: 15%;
  114. }
  115. .content {
  116. width: 85%;
  117. display: flex;
  118. flex-direction: column;
  119. .info {
  120. display: flex;
  121. justify-content: space-between;
  122. margin-bottom: 15rpx;
  123. .info-title {
  124. font-size: 30rpx;
  125. color: #181818;
  126. font-weight: bold;
  127. }
  128. .amount {
  129. font-size: 32rpx;
  130. color: #181818;
  131. font-weight: bold;
  132. }
  133. }
  134. .type {
  135. display: flex;
  136. justify-content: space-between;
  137. margin-bottom: 15rpx;
  138. .desc {
  139. font-size: 24rpx;
  140. color: #999999;
  141. }
  142. .bill-type {
  143. font-size: 24rpx;
  144. color: #999999;
  145. }
  146. }
  147. .date {
  148. font-size: 24rpx;
  149. color: #999999;
  150. }
  151. }
  152. }
  153. }
  154. }
  155. </style>