rechargeList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view>
  3. <ujp-navbar title="充值记录">
  4. <view class="slot-wrap">
  5. <span class="navBtn " @click="toRefundList">退余额</span>
  6. </view>
  7. </ujp-navbar>
  8. <view class="rechargeTime" @click="show = true">
  9. <u-picker mode="time" v-model="show" :params="params"
  10. :default-time="dateMonth"
  11. @confirm="confirmTime" @cancel="cancelTime"></u-picker>
  12. <span>{{month}}月</span>
  13. <u-icon name="arrow-down-s-fill" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  14. </view>
  15. <view style="text-align: center;margin-top: 100px" v-if="!accountList.length">
  16. <img src="@/assets/img/blankpage.png">
  17. <p>暂无充值记录</p>
  18. </view>
  19. <!-- <view class="carNone" v-if="accountList.length == 0">
  20. <img src="static/img/暂无数据-缺省页.png" alt="">
  21. <p>暂无充值记录</p>
  22. </view> -->
  23. <view class="rechargeList" v-if="accountList.length > 0">
  24. <view class="rechargeList-item" v-for="(item,index) in accountList" :key="item.id" @click="gotoUrl('pages/user/finance/rechargeDet?id=' + item.id)">
  25. <view class="rechargeList-row"><span>充值金额</span><h4>{{item.amount}}元</h4></view>
  26. <view class="rechargeList-row"><p>{{item.payNameStr}}</p><p>{{item.createTime}}</p></view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import * as API from '@/apis/index.js'
  33. export default {
  34. data() {
  35. return {
  36. userId: '',
  37. params: {
  38. year: true,
  39. month: true,
  40. day: false,
  41. hour: false,
  42. minute: false,
  43. second: false,
  44. timestamp: true,
  45. },
  46. show: false,
  47. month: '',
  48. dateMonth: '',
  49. accountList: [],
  50. }
  51. },
  52. onReady() {
  53. if(this.carhelp.getPersonInfo()) {
  54. this.userId = this.carhelp.getPersonInfo().id;
  55. }
  56. var date = new Date();
  57. this.month = date.getMonth() + 1;
  58. var year = date.getFullYear();
  59. var monthN = this.month;
  60. if(monthN >= 1 && monthN <= 9) {
  61. monthN = "0" + monthN;
  62. }
  63. this.dateMonth = year + '-' + monthN + '-01';
  64. this.getAccountRecordData();
  65. },
  66. methods: {
  67. toRefundList() {
  68. uni.navigateTo({
  69. url: '/pages/user/refundList'
  70. })
  71. },
  72. getAccountRecordData() {
  73. uni.showLoading({
  74. title: "加载中",
  75. mask: true,
  76. })
  77. API.accountRecordData({
  78. queryDate: this.dateMonth,
  79. pageSize: 50,
  80. }).then((res) => {
  81. uni.hideLoading();
  82. this.accountList = res.data.data;
  83. }).catch(error => {
  84. uni.showToast({
  85. title: error,
  86. icon: "none"
  87. })
  88. })
  89. },
  90. confirmTime(params) {
  91. this.dateMonth = params.year + '-' + params.month + '-01';
  92. if(params.month.slice(0,1) == '0') {
  93. this.month = params.month.slice(1);
  94. } else {
  95. this.month = params.month;
  96. }
  97. this.getAccountRecordData();
  98. this.show = false;
  99. },
  100. cancelTime() {
  101. this.show = false;
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .slot-wrap{
  108. flex: 1;
  109. }
  110. .navBtn{
  111. float: right;
  112. margin-right: 15px;
  113. color:#3fbd70;
  114. }
  115. .carNone{
  116. display: flex;
  117. flex-direction: column;
  118. justify-content: center;
  119. align-items: center;
  120. img{
  121. width: 100%;
  122. height: 100%;
  123. }
  124. p{
  125. margin-top: -60px;
  126. }
  127. }
  128. .rechargeTime{
  129. background-color: #fff;
  130. height: 44px;
  131. display: flex;
  132. align-items: center;
  133. padding: 12px 16px;
  134. border-bottom: 1px solid #f7f7f7;
  135. span{
  136. margin-right: 4px;
  137. }
  138. }
  139. .rechargeList{
  140. background-color: #fff;
  141. padding-left: 16px;
  142. .rechargeList-item{
  143. padding: 12px 16px 12px 0;
  144. border-bottom: 1px solid #f7f7f7;
  145. &:last-child{
  146. border-bottom: none;
  147. }
  148. }
  149. .rechargeList-row{
  150. display: flex;
  151. align-items: center;
  152. justify-content: space-between;
  153. h4{
  154. font-size: 16px;
  155. }
  156. p{
  157. font-size: 12px;
  158. margin-top: 4px;
  159. color:#888;
  160. }
  161. }
  162. }
  163. </style>