rechargeRecord.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="content">
  3. <view class="recharge-box" v-for="pay in payList" :key='pay.id'>
  4. <view class="recharge-time-box">
  5. <view class="recharge-font">微信充值</view>
  6. <view class="recharge-time">{{pay.paytime || '-'}} · {{pay.times || '-'}}次</view>
  7. </view>
  8. <view class="recharge-money">
  9. <text>{{pay.money || '-'}}元</text>
  10. </view>
  11. </view>
  12. <view v-if='payList.length === 0' style="font-size: 14px;margin-top: 5%;">
  13. <p>暂无充值记录</p>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. var md5 = require("../../../common/md5.js");
  19. export default {
  20. data() {
  21. return {
  22. payList:[
  23. {
  24. paytime:'-',
  25. money:'-',
  26. id:'-',
  27. },
  28. ],
  29. }
  30. },
  31. onShow() {
  32. this.getRechargeList()
  33. },
  34. methods: {
  35. getRechargeList(){
  36. uni.showLoading({
  37. })
  38. let that = this;
  39. uni.request({
  40. url:getApp().globalData.shareUrl, //需要设置为全局
  41. method: 'POST',
  42. header: {
  43. 'content-type': 'application/x-www-form-urlencoded'
  44. },
  45. data: {
  46. method: 'charge_list',
  47. timestamp: getApp().globalData.globalTimestamp, //Date.now()
  48. uid:getApp().globalData.user_id,
  49. sign: md5('charge_list' + getApp().globalData.globalTimestamp),
  50. },
  51. success: res => {
  52. uni.hideLoading()
  53. that.payList = res.data.msg
  54. }
  55. });
  56. },
  57. }
  58. }
  59. </script>
  60. <style>
  61. page{
  62. height: 100%;
  63. }
  64. .content {
  65. height: 100%;
  66. display: flex;
  67. flex-direction: column;
  68. align-items: center;
  69. justify-content: flex-start;
  70. background: #f4f5f7;
  71. }
  72. .recharge-box {
  73. width:100%;
  74. height: 150upx;
  75. display: flex;
  76. align-items: center;
  77. justify-content: space-between;
  78. background: #fff;
  79. border-bottom: 1upx solid #D8D8D8;
  80. }
  81. .recharge-time-box {
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. justify-content: space-between;
  86. margin-left: 5%;
  87. height: 110upx;
  88. }
  89. .recharge-font {
  90. font-size: 30upx;
  91. margin-left: -65%;
  92. }
  93. .recharge-time {
  94. color:#D9D9D9;
  95. font-size: 26upx;
  96. }
  97. .recharge-money {
  98. margin-right: 5%;
  99. }
  100. .recharge-money text {
  101. font-size: 28upx;
  102. }
  103. </style>