You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

order.vue 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!-- 订单列表2 -->
  2. <template>
  3. <filter>
  4. <empty-view v-if="!data.login" mode="permission" content="请先登录再查看订单" btnTxt="立即登录"
  5. @btnClick="$util.navTo('/login/login')">
  6. </empty-view>
  7. <view class="list-wrapper" v-else>
  8. <view class="top-content">
  9. <view class="top-menu">
  10. <view :class="item == state.tabActive ? 'tab active' : 'tab'" v-for="item in state.flowPathTabList"
  11. :key="item" @click="flowPathTabHandle(item)">
  12. <view class="border"></view>{{ item }}
  13. </view>
  14. </view>
  15. <order-tabbar ref="tabbarRef" :tabs="data.tabsList" v-model:curIndex="data.tabIndex"
  16. v-if="data.tabsList.length > 0"></order-tabbar>
  17. </view>
  18. <order-list-item ref="mescrollItem" :index="data.tabIndex" :refresh="data.refresh">
  19. </order-list-item>
  20. </view>
  21. </filter>
  22. </template>
  23. <script setup lang="ts">
  24. import orderTabbar from "./components/order-tabbar.vue";
  25. import orderListItem from "./components/order-list-item";
  26. import useOrderList from "@/composables/order/useOrderList";
  27. import filter from '@/components/filter/filter.vue';
  28. import { onLoad } from "@dcloudio/uni-app";
  29. import useOrderListItem from "@/composables/order/useOrderListItem";
  30. import {
  31. reactive
  32. } from "vue";
  33. const {
  34. data,
  35. tabbarRef
  36. } = useOrderList();
  37. const state = reactive({
  38. tabActive: "小程序",
  39. flowPathTabList: ["小程序", "线下网点"],
  40. })
  41. const props = defineProps({
  42. index: {
  43. type: Number,
  44. default() {
  45. return 0
  46. }
  47. },
  48. refresh: { //是否刷新列表
  49. type: Boolean,
  50. default: true
  51. }
  52. })
  53. const { changeTab } = useOrderListItem(props);
  54. onLoad((option) => {
  55. // 一进来就调一遍
  56. changeTab(state.tabActive)
  57. })
  58. const flowPathTabHandle = (tab) => {
  59. console.log("tab", tab)
  60. state.tabActive = tab;
  61. changeTab(state.tabActive)
  62. };
  63. </script>
  64. <style lang="scss">
  65. page {
  66. background: #eef7f7;
  67. }
  68. :deep(.u-mode-center-box) {
  69. border-radius: 20rpx;
  70. }
  71. </style>
  72. <style lang="scss" scoped>
  73. .top-content {
  74. position: fixed;
  75. left: 0;
  76. z-index: 99999;
  77. background-color: white;
  78. }
  79. .top-menu {
  80. display: flex;
  81. justify-content: space-around;
  82. }
  83. .top-menu .tab {
  84. font-size: 28rpx;
  85. padding: 30rpx 30rpx;
  86. color: #666666;
  87. position: relative;
  88. }
  89. .top-menu .active .border {
  90. position: absolute;
  91. width: 70%;
  92. height: 16rpx;
  93. background: #00b38b;
  94. opacity: 0.3;
  95. bottom: 28rpx;
  96. z-index: -99;
  97. left: 15%;
  98. border-radius: 6rpx;
  99. }
  100. .top-menu .active {
  101. font-weight: bold;
  102. font-size: 32rpx;
  103. color: #0d0f26;
  104. }
  105. .top-menu .active::before {
  106. width: 100%;
  107. height: 16rpx;
  108. background: #00b38b;
  109. opacity: 0.3;
  110. }
  111. </style>