orderlist.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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">姓名:{{item.name}}</view>
  28. <view class="info-line">类别:{{item.orderStatus}}</view>
  29. <view class="info-line">技能介绍:{{ item.skillDescribe }}</view>
  30. </view>
  31. <!-- 右侧信息 -->
  32. <view class="item-right">
  33. <!-- ,,orderStatus=0,未开始,=2已完成 -->
  34. <view class="rating">评分:9.5</view>
  35. <up-tag v-if="orderStatus == 0">未开始</up-tag>
  36. <up-tag v-else-if="orderStatus == 1">进行中</up-tag>
  37. <up-tag v-else-if="orderStatus == 2">已完成</up-tag>
  38. <up-button type="primary" text="沟通" size="small" class="action-btn"
  39. ></up-button>
  40. <up-button type="error" text="查看" size="small" class="action-btn"
  41. @click="handlClick(item)"></up-button>
  42. </view>
  43. </view>
  44. </up-list-item>
  45. </up-list>
  46. </view>
  47. </view>
  48. </template>
  49. <script setup>
  50. import {
  51. ref,
  52. onMounted
  53. } from "vue"
  54. // const tab = ref('')
  55. const userType = uni.getStorageSync('userType') //读取本地存储
  56. // 用户/志愿者 识别标识
  57. const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
  58. const orderStatus = ref(0)
  59. const column2 = [{
  60. name: "全部",
  61. value: "",
  62. },
  63. {
  64. name: "待支付",
  65. value: "1",
  66. },
  67. {
  68. name: "待服务",
  69. value: "2",
  70. },
  71. {
  72. name: "进行中",
  73. value: "3",
  74. },
  75. {
  76. name: "已完成",
  77. value: "4",
  78. },
  79. {
  80. name: "已取消",
  81. value: "5",
  82. }
  83. ]
  84. const props = defineProps({
  85. dataList: {
  86. typeof: Array,
  87. default: () => [],
  88. },
  89. })
  90. const emits = defineEmits([
  91. 'fetchData'
  92. ])
  93. const handlClick = (item) => {
  94. const mainOrderId = item.mainOrderId; // 获取详情id
  95. uni.navigateTo({
  96. url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
  97. });
  98. }
  99. function onChange(tabItem) {
  100. // tab.value = tabItem.value;
  101. emits('fetchData', tabItem.value )
  102. }
  103. </script>
  104. <style scoped>
  105. .list-item {
  106. display: flex;
  107. padding: 24rpx 24rpx;
  108. align-items: flex-start;
  109. gap: 24rpx;
  110. }
  111. .item-image {
  112. width: 160rpx;
  113. height: 180rpx;
  114. border-radius: 16rpx;
  115. object-fit: cover;
  116. }
  117. .item-info {
  118. flex: 1;
  119. display: flex;
  120. flex-direction: column;
  121. gap: 14rpx;
  122. }
  123. .info-line {
  124. font-size: 28rpx;
  125. color: #333;
  126. line-height: 1.6;
  127. }
  128. .item-right {
  129. display: flex;
  130. flex-direction: column;
  131. align-items: flex-end;
  132. gap: 16rpx;
  133. min-width: 160rpx;
  134. }
  135. .rating {
  136. font-size: 28rpx;
  137. color: #f39c12;
  138. font-weight: bold;
  139. }
  140. .tag {
  141. transform: scale(0.9);
  142. /* 缩小标签尺寸 */
  143. }
  144. .action-btn {
  145. margin-top: 18rpx;
  146. width: 100%;
  147. }
  148. </style>