orderlist.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <!-- 用户 -->
  3. <view>
  4. <view class="classify-main" v-if="userType == '1'">
  5. <up-tabs v-if="column2 && column2.length > 0" :list="column2" :scrollable="false" @change="onChange"
  6. :activeStyle="{
  7. color: 'rgba(255, 87, 4, 1)',
  8. fontWeight: 'bold',
  9. transform: 'scale(1.05)'
  10. }" lineColor="rgba(255, 87, 4, 1)" :current="tabKey">
  11. </up-tabs>
  12. <view class="list">
  13. <OrderItem v-if="dataList && dataList.length > 0" :dataList="dataList" />
  14. <view v-else class="empty-null">
  15. <img src="/static/empty/订单为空.png" alt="">
  16. </view>
  17. </view>
  18. </view>
  19. <view>
  20. <up-list @scrolltolower="scrolltolower">
  21. <up-list-item v-for="(item, index) in dataList" :key="index">
  22. <view class="list-item">
  23. <!-- 左侧图片 -->
  24. <image src="/static/img/dd.png" mode="aspectFill" class="item-image"></image>
  25. <!-- 中间信息 -->
  26. <view class="item-info">
  27. <view class="info-line">姓名:王麻子</view>
  28. <view class="info-line">类别:刨土豆</view>
  29. <view class="info-line">技能介绍:{{ item.remark }}</view>
  30. </view>
  31. <!-- 右侧信息 -->
  32. <view class="item-right">
  33. <view class="rating">评分:9.5</view>
  34. <up-tag text="标签" plain size="mini" class="tag"></up-tag>
  35. <up-button type="primary" text="沟通" size="small" class="action-btn"
  36. @click="handlClick(item)"></up-button>
  37. </view>
  38. </view>
  39. </up-list-item>
  40. </up-list>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup>
  45. import {
  46. ref,
  47. onMounted
  48. } from "vue"
  49. // const tab = ref('')
  50. const userType = uni.getStorageSync('userType') //读取本地存储
  51. // 用户/志愿者 识别标识
  52. const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
  53. const column2 = [{
  54. name: "全部",
  55. value: "",
  56. },
  57. {
  58. name: "待支付",
  59. value: "1",
  60. },
  61. {
  62. name: "待服务",
  63. value: "2",
  64. },
  65. {
  66. name: "进行中",
  67. value: "3",
  68. },
  69. {
  70. name: "已完成",
  71. value: "4",
  72. },
  73. {
  74. name: "已取消",
  75. value: "5",
  76. }
  77. ]
  78. const props = defineProps({
  79. dataList: {
  80. typeof: Array,
  81. default: () => [],
  82. },
  83. })
  84. const emits = defineEmits([
  85. 'fetchData'
  86. ])
  87. const handlClick = (item) => {
  88. const mainOrderId = item.mainOrderId; // 获取详情id
  89. uni.navigateTo({
  90. url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
  91. });
  92. }
  93. function onChange(tabItem) {
  94. // tab.value = tabItem.value;
  95. emits('fetchData', tabItem.value )
  96. }
  97. </script>
  98. <style scoped>
  99. .list-item {
  100. display: flex;
  101. padding: 24rpx 24rpx;
  102. align-items: flex-start;
  103. gap: 24rpx;
  104. }
  105. .item-image {
  106. width: 160rpx;
  107. height: 180rpx;
  108. border-radius: 16rpx;
  109. object-fit: cover;
  110. }
  111. .item-info {
  112. flex: 1;
  113. display: flex;
  114. flex-direction: column;
  115. gap: 14rpx;
  116. }
  117. .info-line {
  118. font-size: 28rpx;
  119. color: #333;
  120. line-height: 1.6;
  121. }
  122. .item-right {
  123. display: flex;
  124. flex-direction: column;
  125. align-items: flex-end;
  126. gap: 16rpx;
  127. min-width: 160rpx;
  128. }
  129. .rating {
  130. font-size: 28rpx;
  131. color: #f39c12;
  132. font-weight: bold;
  133. }
  134. .tag {
  135. transform: scale(0.9);
  136. /* 缩小标签尺寸 */
  137. }
  138. .action-btn {
  139. margin-top: 18rpx;
  140. width: 100%;
  141. }
  142. </style>