consume.vue 2.1 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. <view class="jilu-items">
  7. <view class="lines">
  8. <text class="ft14" style="font-weight: bold;">{{item.video_name}}</text>
  9. <text class="ft12 jilu-txt">{{item.series_name}}</text>
  10. <text class="ft12 jilu-txt">{{item.created_at}}</text>
  11. </view>
  12. </view>
  13. <view class="lines">
  14. <text class="ft14 jilu-txt"
  15. style="text-align: right;font-weight: bold;color: #FF9800;">-{{item.charge_coin_cost}}K币</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="empty-box" v-if="list.length < 1 && show">
  21. <image src="/static/img/orders/emty.png" mode=""></image>
  22. <p class="ft14 line-1-txt">暂无消费记录</p>
  23. <!-- <p class="ft14 line-2-txt mt10">小充一笔,看更多好剧吧</p>
  24. <navigator url="/pages/client/pay/pay">
  25. <view class="ft16 btn-box mt10"><text class="ft12 btn-cz">去充值</text> </view>
  26. </navigator> -->
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. getUserConsumeRecord
  33. } from "@/common/apis/my.js"
  34. export default {
  35. data() {
  36. return {
  37. page: 1,
  38. hasMore: true,
  39. list: [],
  40. show: false
  41. }
  42. },
  43. onLoad() {
  44. },
  45. onShow() {
  46. this.page = 1;
  47. this.hasMore = true;
  48. this.getList();
  49. uni.hideLoading();
  50. },
  51. onPullDownRefresh() {
  52. this.page = 1;
  53. this.list = [];
  54. this.getList();
  55. uni.stopPullDownRefresh();
  56. },
  57. onReachBottom() {
  58. if (!this.hasMore) {
  59. return false;
  60. }
  61. this.getList();
  62. },
  63. methods: {
  64. async getList() {
  65. if (this.page <= 1) {
  66. this.show = false;
  67. }
  68. let res = await getUserConsumeRecord(this.page);
  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 scoped lang="scss">
  85. @import url("style/orders.css");
  86. </style>