猫妈狗爸伴宠师小程序前端代码
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.

118 lines
2.3 KiB

  1. <template>
  2. <view>
  3. <view class="header-buts flex flex-center">
  4. <view class="flex buts-box">
  5. <view class="buts" :class="{'buts-active':activeIndex===1}" @click="activeIndex=1">总订单</view>
  6. <view class="buts" :class="{'buts-active':activeIndex===2}" @click="activeIndex=2">日订单</view>
  7. </view>
  8. </view>
  9. <up-sticky bgColor="#fff" v-if="activeIndex == 1">
  10. <view class="container-tabs">
  11. <up-tabs :list="tabList1" lineWidth="68rpx" :activeStyle="{
  12. color: '#FFFFFF',
  13. fontWeight: 'bold',
  14. transform: 'scale(1.05)'
  15. }" :inactiveStyle="{
  16. color: '#FFFFFF',
  17. transform: 'scale(1)'
  18. }" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#FFFFFF"></up-tabs>
  19. </view>
  20. </up-sticky>
  21. <up-sticky bgColor="#fff" v-else>
  22. <view class="container-tabs">
  23. <up-tabs :list="tabList2"
  24. lineWidth="68rpx"
  25. :activeStyle="{
  26. color: '#FFFFFF',
  27. fontWeight: 'bold',
  28. transform: 'scale(1.05)'
  29. }"
  30. :inactiveStyle="{
  31. color: '#FFFFFF',
  32. transform: 'scale(1)'
  33. }"
  34. :itemStyle="{height:'88rpx',padding:'0 52rpx', width : '400rpx'}"
  35. lineColor="#FFFFFF"></up-tabs>
  36. </view>
  37. </up-sticky>
  38. <view class="container">
  39. <systemOrder :list="list" v-if="activeIndex == 1"/>
  40. <orderListByData :list="list" v-else/>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup>
  45. import {
  46. reactive,
  47. ref
  48. } from "vue";
  49. import systemOrder from "./components/systemOrder.vue";
  50. import orderListByData from "./components/orderListByData.vue";
  51. // import personOrder from "./components/personOrder.vue";
  52. // import lossOrder from "./components/lossOrder.vue";
  53. import {
  54. getAppOrderList,
  55. } from "@/api/order/order.js"
  56. const current = ref(0)
  57. const activeIndex = ref(1)
  58. const list = ref([])
  59. const tabList1 = reactive([{
  60. name: '待服务',
  61. badge: {
  62. // value: 5,
  63. }
  64. },
  65. {
  66. name: '进行中',
  67. badge: {
  68. // value: 5,
  69. }
  70. },
  71. {
  72. name: '已完成',
  73. badge: {
  74. // value: 5,
  75. }
  76. },
  77. ])
  78. const tabList2 = reactive([
  79. {
  80. name: '待上门',
  81. badge: {
  82. // value: 5,
  83. }
  84. },
  85. {
  86. name: '已完成',
  87. badge: {
  88. // value: 5,
  89. }
  90. },
  91. ])
  92. function getList(){
  93. getAppOrderList()
  94. .then(res => {
  95. if(res.code == 200){
  96. list.value = res.rows
  97. }
  98. })
  99. }
  100. getList()
  101. </script>
  102. <style scoped lang="scss">
  103. @import "index.scss";
  104. </style>