orderlist.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <!-- 用户 -->
  3. <view class="classify-main" v-if="userType == '1'">
  4. <up-tabs :list="column2" :scrollable="false" @change="onChange" :activeStyle="{
  5. color: 'rgba(255, 87, 4, 1)',
  6. fontWeight: 'bold',
  7. transform: 'scale(1.05)'
  8. }" lineColor="rgba(255, 87, 4, 1)" :current="tabKey">
  9. </up-tabs>
  10. <view class="list">
  11. <OrderList :dataList="dataList" v-if="dataList.length > 0" />
  12. <view v-else class="empty-null">
  13. <img src="/static/empty/订单为空.png" alt="">
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import {
  20. userMainOrderList
  21. } from '@/api/userList.js'
  22. const column2 = [{
  23. name: "全部",
  24. value: "",
  25. },
  26. {
  27. name: "待支付",
  28. value: "1",
  29. },
  30. {
  31. name: "待服务",
  32. value: "2",
  33. },
  34. {
  35. name: "进行中",
  36. value: "3",
  37. },
  38. {
  39. name: "已完成",
  40. value: "4",
  41. },
  42. {
  43. name: "已取消",
  44. value: "5",
  45. }
  46. ]
  47. const getList = async() =>{
  48. const res = await userMainOrderList({
  49. orderStatus: tab.value
  50. });
  51. }
  52. function onChange(tabItem) {
  53. tab.value = tabItem.value;
  54. getList();
  55. console.log('change', tabItem, tab.value);
  56. }
  57. onMounted(()=>{
  58. getList()
  59. })
  60. </script>
  61. <style scoped>
  62. .list-item {
  63. display: flex;
  64. padding: 24rpx;
  65. align-items: flex-start;
  66. gap: 24rpx;
  67. }
  68. .item-image {
  69. width: 160rpx;
  70. height: 180rpx;
  71. border-radius: 16rpx;
  72. object-fit: cover;
  73. }
  74. .item-info {
  75. flex: 1;
  76. display: flex;
  77. flex-direction: column;
  78. gap: 14rpx;
  79. }
  80. .info-line {
  81. font-size: 28rpx;
  82. color: #333;
  83. line-height: 1.6;
  84. }
  85. .item-right {
  86. display: flex;
  87. flex-direction: column;
  88. align-items: flex-end;
  89. gap: 16rpx;
  90. min-width: 160rpx;
  91. }
  92. .rating {
  93. font-size: 28rpx;
  94. color: #f39c12;
  95. font-weight: bold;
  96. }
  97. .tag {
  98. transform: scale(0.9);
  99. /* 缩小标签尺寸 */
  100. }
  101. .action-btn {
  102. margin-top: 18rpx;
  103. width: 100%;
  104. }
  105. </style>