order-detail.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="container">
  3. <smart-detail-tabs :tabsList="tabsList" v-model="active" :fixed="true" @change="scrollTo" />
  4. <view class="smart-detail">
  5. <OrderDetailBaseInfo id="detail0" />
  6. <DetailModelPath id="detail1" />
  7. <OrderDetailSettle id="detail2" />
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. import { ref } from 'vue';
  13. import SmartDetailTabs from '@/components/smart-detail-tabs/index.vue';
  14. import OrderDetailBaseInfo from './components/order-detail-base-info.vue';
  15. import DetailModelPath from './components/detail-model-path.vue';
  16. import OrderDetailSettle from './components/order-detail-settle.vue';
  17. const tabsList = [
  18. {
  19. label: '基本信息',
  20. value: 0,
  21. },
  22. {
  23. label: '物流信息',
  24. value: 1,
  25. },
  26. {
  27. label: '结算信息',
  28. value: 2,
  29. },
  30. ];
  31. const active = ref(0);
  32. function scrollTo(tab) {
  33. uni.pageScrollTo({
  34. selector: '#detail' + tab,
  35. duration: 300,
  36. success: console.log,
  37. fail: console.log,
  38. });
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .container {
  43. background-color: #f4f4f4;
  44. height: 100vh;
  45. overflow-y: scroll;
  46. }
  47. </style>