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

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