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

96 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" :current="current"/>
  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 submitBut from "@/components/submitBut/index.vue"
  37. import {
  38. useStore
  39. } from "vuex"
  40. const current = ref(0)
  41. const list = reactive([{
  42. name: '系统派单',
  43. badge: {
  44. value: 5,
  45. }
  46. },
  47. {
  48. name: '个人订单',
  49. badge: {
  50. value: 5,
  51. }
  52. },
  53. {
  54. name: '流失订单',
  55. badge: {
  56. value: 5,
  57. }
  58. },
  59. ])
  60. const store = useStore();
  61. const userInfo = computed(() => {
  62. return store.getters.userInfo
  63. })
  64. const orderlist = ref([]);
  65. onShow(() => {
  66. if (!getIsLogin()) {
  67. uni.navigateTo({
  68. url: "/pages/login/index"
  69. })
  70. }
  71. getOrderList();
  72. })
  73. // 获取接单大厅列表
  74. const getOrderList = async () => {
  75. let response = await orderList({
  76. status: current.value,
  77. userId: userInfo.value.userId
  78. });
  79. if (response.code == 200 && response.data) {
  80. orderlist.value = response.data;
  81. }
  82. }
  83. const clickEvent = (item) => {
  84. current.value = item.index;
  85. getOrderList();
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. @import "index.scss";
  90. </style>