order.vue 1.6 KB

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