selOrder.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="order-ul">
  3. <view class="order-li" v-for="(item, index) in order_list" :key="index" @click="changeData(item)">
  4. <view class="customer ellipsis">{{ item.customerName }}</view>
  5. <view class="list-other">
  6. <view class="other-li clearfix">
  7. <text class="float_left">{{ item.no }}</text>
  8. <text class="float_right price">{{ $utils.formattedNumber(item.payAmount) }}</text>
  9. </view>
  10. <view class="other-li">{{ $u.timeFormat(item.createTime) }}</view>
  11. <view class="other-li clearfix">
  12. <text class="float_left">{{ item.receiveData.realName }}</text>
  13. <view class="float_right mobile" @click="callPhone(item.receiveData.mobile || '')"><u-icon size="38" name="dianhua" custom-prefix="custom-icon"></u-icon></view>
  14. </view>
  15. </view>
  16. </view>
  17. <u-loadmore v-if="order_list.length" :status="load_status" />
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. load_status: 'nomore',
  25. page: 1,
  26. pageSize: 10,
  27. total: 0,
  28. order_list: []
  29. };
  30. },
  31. onLoad() {
  32. this.getAllOrder();
  33. },
  34. onPullDownRefresh() {
  35. this.page = 1;
  36. this.getAllOrder();
  37. },
  38. // 上拉加载
  39. onReachBottom() {
  40. if (this.total / this.pageSize > this.page) {
  41. this.page += 1;
  42. this.getAllOrder();
  43. }
  44. },
  45. methods: {
  46. changeData(item) {
  47. // 选择返回上一页
  48. this._prePage().orderData = item;
  49. uni.navigateBack();
  50. },
  51. getAllOrder() {
  52. this.load_status = 'loading';
  53. // 获取订单
  54. this.$u.api
  55. .getAllOrder({
  56. page: this.page,
  57. pageSize: this.pageSize,
  58. orderStatus: 5,
  59. returnStatus: [0, 1],
  60. outStatus: 5,
  61. search: { orderType: [1, 23, 24] }
  62. })
  63. .then(res => {
  64. uni.stopPullDownRefresh();
  65. if (this.page === 1) {
  66. this.order_list = res.data;
  67. } else {
  68. this.order_list = this.order_list.concat(res.data);
  69. }
  70. this.total = res.pageTotal;
  71. this.load_status = this.$utils.loadStatus(this.page,this.pageSize,this.total);
  72. });
  73. }
  74. }
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .order-ul {
  79. .order-li {
  80. width: 710rpx;
  81. background: #ffffff;
  82. margin: 20rpx auto;
  83. border-radius: 16rpx;
  84. padding: 0 24rpx;
  85. .customer {
  86. font-weight: bold;
  87. line-height: 80rpx;
  88. border-bottom: 1px solid #eeeeee;
  89. }
  90. .list-other {
  91. padding: 24rpx 0 14rpx;
  92. .other-li {
  93. font-size: 26rpx;
  94. padding-bottom: 10rpx;
  95. .mobile {
  96. color: $uni-color-primary;
  97. }
  98. .price {
  99. color: $uni-color-error;
  100. font-weight: bold;
  101. font-size: 28rpx;
  102. }
  103. }
  104. }
  105. }
  106. }
  107. </style>