orders.vue 2.3 KB

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