rechargeList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. }).then((res) => {
  80. uni.hideLoading();
  81. this.accountList = res.data.data;
  82. }).catch(error => {
  83. uni.showToast({
  84. title: error,
  85. icon: "none"
  86. })
  87. })
  88. },
  89. confirmTime(params) {
  90. this.dateMonth = params.year + '-' + params.month + '-01';
  91. if(params.month.slice(0,1) == '0') {
  92. this.month = params.month.slice(1);
  93. } else {
  94. this.month = params.month;
  95. }
  96. this.getAccountRecordData();
  97. this.show = false;
  98. },
  99. cancelTime() {
  100. this.show = false;
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .slot-wrap{
  107. flex: 1;
  108. }
  109. .navBtn{
  110. float: right;
  111. margin-right: 15px;
  112. color:#3fbd70;
  113. }
  114. .carNone{
  115. display: flex;
  116. flex-direction: column;
  117. justify-content: center;
  118. align-items: center;
  119. img{
  120. width: 100%;
  121. height: 100%;
  122. }
  123. p{
  124. margin-top: -60px;
  125. }
  126. }
  127. .rechargeTime{
  128. background-color: #fff;
  129. height: 44px;
  130. display: flex;
  131. align-items: center;
  132. padding: 12px 16px;
  133. border-bottom: 1px solid #f7f7f7;
  134. span{
  135. margin-right: 4px;
  136. }
  137. }
  138. .rechargeList{
  139. background-color: #fff;
  140. padding-left: 16px;
  141. .rechargeList-item{
  142. padding: 12px 16px 12px 0;
  143. border-bottom: 1px solid #f7f7f7;
  144. &:last-child{
  145. border-bottom: none;
  146. }
  147. }
  148. .rechargeList-row{
  149. display: flex;
  150. align-items: center;
  151. justify-content: space-between;
  152. h4{
  153. font-size: 16px;
  154. }
  155. p{
  156. font-size: 12px;
  157. margin-top: 4px;
  158. color:#888;
  159. }
  160. }
  161. }
  162. </style>