orders.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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="ft16 line-1-txt mb5">暂无充值记录</p>
  28. <p class="ft16 line-2-txt">小充一笔,看更多好剧吧</p>
  29. <navigator url="/pages/pay/pay">
  30. <view class="ft16 btn-box"><text class="ft14 btn-cz">去充值</text> </view>
  31. </navigator>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. getOrderList
  38. } from "@/common/apis/recharge.js"
  39. export default {
  40. data() {
  41. return {
  42. page: 1,
  43. hasMore: true,
  44. list: [],
  45. show: false
  46. }
  47. },
  48. onLoad() {
  49. },
  50. onShow() {
  51. this.page = 1;
  52. this.hasMore = true;
  53. this.getList();
  54. uni.hideLoading();
  55. },
  56. onPullDownRefresh() {
  57. this.page = 1;
  58. this.list = [];
  59. this.getList();
  60. uni.stopPullDownRefresh();
  61. },
  62. onReachBottom() {
  63. if (!this.hasMore) {
  64. return false;
  65. }
  66. this.getList();
  67. },
  68. methods: {
  69. async getList() {
  70. if (this.page <= 1) {
  71. this.show = false;
  72. }
  73. let response = await getOrderList(this.page);
  74. let res = response.data;
  75. if (res) {
  76. if (this.page >= res.last_page) {
  77. this.hasMore = false;
  78. } else {
  79. this.page++;
  80. }
  81. res.data.forEach((item, index) => {
  82. this.list.push(item);
  83. })
  84. }
  85. this.show = true;
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. @import url("style/orders.css");
  92. </style>