rechargeListByPhone.vue 3.7 KB

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