order.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. import {
  19. onLoad
  20. } from '@dcloudio/uni-app'
  21. onLoad(({
  22. status
  23. }) => {
  24. active.value = Number(status)
  25. })
  26. const searchCallback = (e) => {
  27. console.log('搜索', e)
  28. }
  29. const clearCallback = () => {
  30. console.log('clear')
  31. }
  32. const active = ref(0)
  33. const tabsList = ["全部", "待付款", "待发货", "待收货", "待评价", "退款/售后"]
  34. const handleTab = (index) => {
  35. active.value = index
  36. }
  37. // const shopList = [
  38. // {
  39. // status:0,
  40. // }
  41. // ]
  42. </script>
  43. <style lang="scss" scoped>
  44. .sub-base-container {
  45. padding: 0;
  46. .search-box {
  47. padding: 16rpx 24rpx 20rpx;
  48. background: #fff;
  49. }
  50. .tabs {
  51. width: 100%;
  52. padding: 0 24rpx 16rpx;
  53. box-sizing: border-box;
  54. display: flex;
  55. overflow-x: auto;
  56. background: #fff;
  57. .tab-item {
  58. // flex: 1;
  59. width: 150px;
  60. text-align: center;
  61. color: #000;
  62. font-size: 28rpx;
  63. padding: 10rpx 0;
  64. white-space: nowrap;
  65. &.active {
  66. border-radius: 10rpx;
  67. background: rgba(243, 193, 29, 0.2);
  68. }
  69. }
  70. }
  71. }
  72. </style>