order.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="sub-base-container">
  3. <view class="search-box">
  4. <v-search @searchCallback="searchCallback" @clearCallback="clearCallback"></v-search>
  5. </view>
  6. <view class="tabs">
  7. <view :class="['tab-item',{active:active === index}]" v-for="(item,index) in tabsList" :key="index"
  8. @click="handleTab(index)">{{item}}</view>
  9. </view>
  10. <shop-list :active="active"></shop-list>
  11. </view>
  12. </template>
  13. <script setup>
  14. import {
  15. ref
  16. } from "vue"
  17. import shopList from "../components/shopList.vue"
  18. const searchCallback = (e) => {
  19. console.log('搜索', e)
  20. }
  21. const clearCallback = () => {
  22. console.log('clear')
  23. }
  24. const active = ref(0)
  25. const tabsList = ["全部", "待付款", "待发货", "待收货", "待评价", "退款/售后"]
  26. const handleTab = (index) => {
  27. active.value = index
  28. }
  29. // const shopList = [
  30. // {
  31. // status:0,
  32. // }
  33. // ]
  34. </script>
  35. <style lang="scss" scoped>
  36. .sub-base-container {
  37. padding: 0;
  38. .search-box{
  39. padding: 16rpx 24rpx 20rpx;
  40. background: #fff;
  41. }
  42. .tabs {
  43. width: 100%;
  44. padding: 0 24rpx 16rpx;
  45. box-sizing: border-box;
  46. display: flex;
  47. overflow-x: auto;
  48. background: #fff;
  49. .tab-item {
  50. // flex: 1;
  51. width: 150px;
  52. text-align: center;
  53. color: #000;
  54. font-size: 28rpx;
  55. padding: 10rpx 0;
  56. white-space: nowrap;
  57. &.active {
  58. border-radius: 10rpx;
  59. background: rgba(243, 193, 29, 0.2);
  60. }
  61. }
  62. }
  63. }
  64. </style>