orders.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <script lang='ts' setup>
  2. const activeName = ref()
  3. const router = useRouter()
  4. const route = useRoute()
  5. function handleClick(tab: any) {
  6. const tabName = tab.paneName
  7. activeName.value = tabName
  8. router.push({
  9. path: '/account/orders',
  10. query: {
  11. tab: tabName,
  12. },
  13. })
  14. }
  15. onMounted(() => {
  16. activeName.value = route.query.tab as string
  17. })
  18. </script>
  19. <template>
  20. <div>
  21. <div class="py-18px px-24px bg-#FAFAFA b-rd-10px text-#000 text-20px fw-500 mb-20px">
  22. Wish Orders
  23. </div>
  24. <el-tabs v-model="activeName" class="favorite-tabs" @tab-click="handleClick">
  25. <el-tab-pane label="Submitted" name="submitted">
  26. <Business-account-orders-submitted v-if="activeName === 'submitted'" />
  27. </el-tab-pane>
  28. <el-tab-pane label="Cancelled" name="cancelled">
  29. <Business-account-orders-cancelled v-if="activeName === 'cancelled'" />
  30. </el-tab-pane>
  31. <el-tab-pane label="All" name="all">
  32. <Business-account-orders-all v-if="activeName === 'all'" />
  33. </el-tab-pane>
  34. </el-tabs>
  35. </div>
  36. </template>
  37. <style lang='less' scoped>
  38. .favorite-tabs {
  39. background-color: #FAFAFA;
  40. border-radius: 10px;
  41. padding: 20px;
  42. padding-top: 0px;
  43. ::v-deep(.el-tabs__header){
  44. .el-tabs__item{
  45. color: #333;
  46. &.is-active {
  47. color: #C58C64!important;
  48. }
  49. }
  50. .el-tabs__active-bar{
  51. background-color: #C58C64!important;
  52. }
  53. }
  54. }
  55. </style>