lifeOrder.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="content">
  3. <view class="order-wrap" v-for="item in list">
  4. <view class="tit">
  5. 订单号:{{item.order_id}}
  6. </view>
  7. <view class="tit">
  8. 支付方式:{{item.pay_type == 'yue'?'余额': (item.pay_price == '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. <empty v-else></empty>
  19. </view>
  20. </template>
  21. <script>
  22. import empty from '@/components/empty.vue'
  23. import { getLifeOrder } from '@/api/three.js'
  24. export default {
  25. components: {
  26. empty
  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. }).then(res => {
  58. let arr = res.data.data
  59. that.list = that.list.concat(arr)
  60. if(arr.length == that.limit) {
  61. that.loadingType = 'more'
  62. that.page++
  63. }else {
  64. that.loadingType = 'noMore'
  65. }
  66. that.loaded = true
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .content {
  74. padding-top: 20rpx;
  75. }
  76. .order-wrap {
  77. width: 690rpx;
  78. background-color: #fff;
  79. margin: 0 auto 20rpx;
  80. padding: 20rpx 34rpx;
  81. border-radius: 20rpx;
  82. .tit {
  83. font-size: 30rpx;
  84. font-weight: bold;
  85. }
  86. .price {
  87. text-align: right;
  88. }
  89. }
  90. </style>