order.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view>
  3. <van-tabs :active="active" @change="onChange" swipeable sticky :ellipsis="false">
  4. <van-tab title="全部"><order-all></order-all></van-tab>
  5. <van-tab title="待付款"><order-type :OrderData="[1,2,3]"></order-type></van-tab>
  6. <van-tab title="待收货"></van-tab>
  7. <van-tab title="退款/售后">内容 4</van-tab>
  8. <van-tab title="待评价">内容 4</van-tab>
  9. </van-tabs>
  10. </view>
  11. </template>
  12. <script>
  13. import OrderAll from "@/components/orders/order-all/order-all.vue";
  14. export default {
  15. components: {OrderAll},
  16. data() {
  17. return {
  18. active: this.query.pagetype ? parseInt(this.query.pagetype): 0,
  19. };
  20. },
  21. props: {
  22. },
  23. methods: {
  24. onLoad(options) {
  25. // console.log(options.pagetype,"pagetype")
  26. if(options.pagetype){
  27. this.active = parseInt(options.pagetype)
  28. }
  29. },
  30. onChange(event) {
  31. console.log(event)
  32. this.active = event.detail.index
  33. // console.log(this.query().pagetype,'eeeee')
  34. },
  35. query() {
  36. return this.$route.query
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. page { background-color: #8f8f94; }
  43. </style>