order-list.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <view class="bg min100 ptb-30 plr-35">
  4. <empty v-if="list.length==0" text="暂无订单"></empty>
  5. <view class="mb-20" v-for="(item,i) in list" :key="i">
  6. <view @click="goDetail(item.id)" class="ptb-30 plr-30 radius-10 bg-white" style="box-shadow: 0px 0px 8px 0px rgba(105, 70, 255, 0.15);">
  7. <view class="flex">
  8. <view class="">
  9. 顺风车 {{item.start_time}}
  10. <text v-if="item.status != '-2' && item.status != '-1' && item.status != '99'" class="white size-26 ptb-5 plr-15 mlr-15 bg-green white">
  11. {{item.statusText}}
  12. </text>
  13. <text v-else class="gray-2 size-26 ptb-5 plr-15 mlr-15" style="background: #eee;">{{item.statusText}}</text>
  14. </view>
  15. <u-icon name="arrow-right" color="rgba(51,51,51,0.3)" size="40"></u-icon>
  16. </view>
  17. <view class="mt-30 flex1 flex-middle">
  18. <view class="bg-green" style="width: 16rpx;height: 16rpx;border-radius: 50%;"></view>
  19. <text class="ml-20">{{item.start_city}}--{{item.start_name}}</text>
  20. </view>
  21. <view class="mt-30 flex1 flex-middle">
  22. <view class="bg-orange" style="width: 16rpx;height: 16rpx;border-radius: 50%;"></view>
  23. <text class="ml-20">{{item.end_city}}--{{item.end_name}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. <u-loadmore v-show="list.length>9" :status="status" icon-type="flower" bg-color="transperant" margin-top="30"
  28. margin-bottom="30" />
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. list: [],
  37. page: 1,
  38. status: 'loadmore',
  39. };
  40. },
  41. onPullDownRefresh() {
  42. this.page = 1
  43. this.list = []
  44. this.init()
  45. },
  46. onReachBottom() {
  47. //避免多次触发
  48. if (this.status == 'loading' || this.status == 'nomore') {
  49. return;
  50. }
  51. this.status = "loading";
  52. this.init()
  53. },
  54. onLoad() {
  55. this.init()
  56. },
  57. methods: {
  58. goDetail(id){
  59. uni.navigateTo({
  60. url:'/pages/shunfeng/order-detail?id=' + id
  61. })
  62. },
  63. init() {
  64. this.$http('/addons/ddrive/sforder/user_order', {
  65. type: 1,
  66. page: this.page
  67. }, "POST").then(data => {
  68. if (data.length < 10) {
  69. this.status = "nomore"
  70. } else {
  71. this.page = this.page + 1
  72. this.status = "loadmore"
  73. }
  74. this.list = this.list.concat(data)
  75. uni.stopPullDownRefresh();
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. // .list {
  83. // box-shadow: 0px 0px 8px 0px rgba(105, 70, 255, 0.15);
  84. // }
  85. </style>