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

95 lines
1.8 KiB

  1. <template>
  2. <view>
  3. <up-sticky bgColor="#fff">
  4. <view class="container-tabs">
  5. <up-tabs :list="list" lineWidth="68rpx" :activeStyle="{
  6. color: '#FFFFFF',
  7. fontWeight: 'bold',
  8. transform: 'scale(1.05)'
  9. }" :inactiveStyle="{
  10. color: '#FFFFFF',
  11. transform: 'scale(1)'
  12. }" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#FFFFFF" @click="clickEvent"></up-tabs>
  13. </view>
  14. </up-sticky>
  15. <view class="container">
  16. <list :orderList="orderlist" v-if="current===0" />
  17. </view>
  18. </view>
  19. </template>
  20. <script setup>
  21. import {
  22. computed,
  23. reactive,
  24. ref
  25. } from "vue";
  26. import List from "./components/list.vue";
  27. import {
  28. onShow
  29. } from "@dcloudio/uni-app"
  30. import {
  31. getIsLogin
  32. } from "@/utils/auth.js"
  33. import {
  34. orderList
  35. } from "@/api/receivingHall/index.js"
  36. import {
  37. useStore
  38. } from "vuex"
  39. const current = ref(0)
  40. const list = reactive([{
  41. name: '系统派单',
  42. badge: {
  43. value: 5,
  44. }
  45. },
  46. {
  47. name: '个人订单',
  48. badge: {
  49. value: 5,
  50. }
  51. },
  52. {
  53. name: '流失订单',
  54. badge: {
  55. value: 5,
  56. }
  57. },
  58. ])
  59. const store = useStore();
  60. const userInfo = computed(() => {
  61. return store.getters.userInfo
  62. })
  63. const orderlist = ref([]);
  64. onShow(() => {
  65. if (!getIsLogin()) {
  66. uni.navigateTo({
  67. url: "/pages/login/index"
  68. })
  69. }
  70. getOrderList();
  71. })
  72. // 获取接单大厅列表
  73. const getOrderList = async () => {
  74. let response = await orderList({
  75. status: current.value,
  76. userId: userInfo.value.userId
  77. });
  78. if (response.code == 200 && response.data) {
  79. orderlist.value = response.data;
  80. }
  81. }
  82. const clickEvent = (item) => {
  83. current.value = item.index;
  84. getOrderList();
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. @import "index.scss";
  89. </style>