rechargeList.vue 3.3 KB

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