order.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="content">
  3. <view class="order-wrap" v-for="item in list">
  4. <view class="tit">
  5. 名称:{{item.goods_name}}
  6. </view>
  7. <view class="tit">
  8. 支付方式:{{item.pay_type == 'yue'?'余额': (item.pay_type == 'weixin'?'微信':'支付宝')}}
  9. </view>
  10. <view class="tit">
  11. 充值号码:{{item.rechargeno}}
  12. </view>
  13. <view class="tit">
  14. 实付: {{item.pay_price}}
  15. </view>
  16. </view>
  17. <!-- <uni-load-more v-if="!(list.length == 0 && loaded)" :status="loadingType" ></uni-load-more> -->
  18. <emptyPage title="暂无充值记录~" v-if="list.length == 0 && loaded"></emptyPage>
  19. </view>
  20. </template>
  21. <script>
  22. import emptyPage from '@/components/emptyPage.vue'
  23. import { getLifeOrder } from '@/api/three.js'
  24. export default {
  25. components: {
  26. emptyPage
  27. },
  28. data() {
  29. return {
  30. list: [],
  31. page: 1,
  32. limit: 10,
  33. loaded: false,
  34. loadingType: 'more'
  35. }
  36. },
  37. onLoad() {
  38. },
  39. onShow() {
  40. this.getLifeOrder()
  41. },
  42. onReachBottom() {
  43. this.getLifeOrder()
  44. },
  45. onReady() {
  46. },
  47. methods: {
  48. getLifeOrder() {
  49. let that = this
  50. if(that.loadingType == 'loading' || that.loadingType == 'noMore') {
  51. return
  52. }
  53. that.loadingType = 'loading'
  54. getLifeOrder({
  55. page: that.page,
  56. limit: that.limit,
  57. status: 2
  58. }).then(res => {
  59. let arr = res.data.list
  60. that.list = that.list.concat(arr)
  61. if(arr.length == that.limit) {
  62. that.loadingType = 'more'
  63. that.page++
  64. }else {
  65. that.loadingType = 'noMore'
  66. }
  67. that.loaded = true
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .content {
  75. padding-top: 20rpx;
  76. }
  77. .order-wrap {
  78. width: 690rpx;
  79. background-color: #fff;
  80. margin: 0 auto 20rpx;
  81. padding: 20rpx 34rpx;
  82. border-radius: 20rpx;
  83. .tit {
  84. font-size: 30rpx;
  85. font-weight: bold;
  86. }
  87. .price {
  88. text-align: right;
  89. }
  90. }
  91. </style>