orders.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="body pd16_15">
  3. <view class="jilu-box" v-show="list.length > 0">
  4. <view class="pb10 jilu-item" v-for="(item, key) in list" :key="key">
  5. <view class="jilu-item-box">
  6. <text class="ft12 jilu-txt">订单号:{{ item.trade_no }}</text>
  7. <text class="ft12 jilu-txt">{{ item.status }}</text>
  8. </view>
  9. <view class="jilu-item-box">
  10. <view class="jilu-items">
  11. <image class="pay-icon" src="/static/img/orders/cj-icon.png" mode=""></image>
  12. <view class="lines">
  13. <text class="ft14" style="font-weight: bold;">{{ item.pay_name }}</text>
  14. <text class="ft12 jilu-txt">时间:{{ item.pay_end_at }}</text>
  15. </view>
  16. </view>
  17. <view class="lines">
  18. <text class="ft14 jilu-txt"
  19. style="text-align: right;font-weight: bold;color: #FF9800;">{{ item.pay_result }}K币</text>
  20. <text class="ft12 jilu-txt">实付金额:&yen;{{ item.price }}</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="empty-box" v-if="list.length < 1 && show">
  26. <image src="/static/img/orders/emty.png" mode=""></image>
  27. <p class="ft14 line-1-txt">暂无充值记录</p>
  28. <p class="ft14 line-2-txt">小充一笔,看更多好剧吧</p>
  29. <navigator url="/pages/pay/pay">
  30. <view class="ft16 btn-box"><text class="ft12 btn-cz">去充值</text> </view>
  31. </navigator>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { getOrderList } from "@/common/apis/recharge.js"
  37. export default {
  38. data() {
  39. return {
  40. page: 1,
  41. hasMore: true,
  42. list: [],
  43. show: false
  44. }
  45. }, onLoad() {
  46. }, onShow() {
  47. this.page = 1;
  48. this.hasMore = true;
  49. this.getList();
  50. uni.hideLoading();
  51. }, onPullDownRefresh() {
  52. this.page = 1;
  53. this.list = [];
  54. this.getList();
  55. uni.stopPullDownRefresh();
  56. }, onReachBottom() {
  57. if (!this.hasMore) {
  58. return false;
  59. }
  60. this.getList();
  61. },
  62. methods: {
  63. async getList() {
  64. if (this.page <= 1) {
  65. this.show = false;
  66. }
  67. let response = await getOrderList(this.page);
  68. let res = response.data;
  69. if (res) {
  70. if (this.page >= res.last_page) {
  71. this.hasMore = false;
  72. } else {
  73. this.page++;
  74. }
  75. res.data.forEach((item, index) => {
  76. this.list.push(item);
  77. })
  78. }
  79. this.show = true;
  80. },
  81. }
  82. }
  83. </script>
  84. <style>
  85. @import url("style/orders.css");
  86. </style>