listItem.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="item">
  3. <view class="item-img">
  4. <!-- <img :src="data.avatar" alt="" style="width: 112rpx; height: 112rpx;"> -->
  5. <up-image :show-loading="true" :src="data.avatar" width="112rpx" height="112rpx"></up-image>
  6. </view>
  7. <view class="item-info">
  8. <view class="item-title-box">
  9. <view class="item-title">
  10. <view class="item-name">
  11. {{ data.name }}
  12. </view>
  13. <view v-if="data.score || ['0', '1','3'].includes(String(data.orderStatus))">
  14. <dict-tag :options="order_status" :value="String(data.orderStatus)" />
  15. </view>
  16. <text v-else class="color-blue ">
  17. 待评价
  18. </text>
  19. </view>
  20. <view class="item-de">
  21. <img src="/static/serverImg/list/ad2.png" alt="" style="width: 28rpx;height: 28rpx;">
  22. {{ data.address }}
  23. </view>
  24. <view class="item-time">
  25. 服务时间:{{ data.workDate }} {{ data.workStartTime }}(<text class="item-time-text">{{ data.serviceDuration }}分钟</text>)
  26. </view>
  27. <view class="item-price"><span class="item-price-yuan">¥</span> {{ data.serviceOnePrice || 0 }}</view>
  28. </view>
  29. <view class="item-box">
  30. <view class="item-btns">
  31. <view class="btn-m" @click="onClick(1)" v-if="['2','4'].includes(data.orderStatus)">查看</view>
  32. <!-- <view class="btn-m" @click="onClick(2)">
  33. <text style="margin-left: 8rpx;">沟通</text>
  34. </view> -->
  35. <view class="btn-m" @click="onClick(1)" v-if="['3', '1'].includes(data.orderStatus)">
  36. <!-- <up-icon name="chat" color="#ffffff" size="20"></up-icon> -->
  37. {{ data.orderStatus === '1' ? '开始' : '完成' }}服务
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup>
  45. import { inject } from 'vue';
  46. import DictTag from '@/components/DictTag/index.vue'
  47. const props = defineProps({
  48. data: {
  49. type: Object,
  50. default: () => {
  51. return {}
  52. }
  53. },
  54. });
  55. const inject_click = inject('onClick');
  56. const order_status = inject('order_status');
  57. /**
  58. * 1: 查看
  59. * 2:沟通
  60. */
  61. function onClick(type) {
  62. inject_click(props.data, type);
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .item {
  67. border-radius: 24rpx;
  68. background: rgba(255, 255, 255, 1);
  69. margin-bottom: 24rpx;
  70. padding: 32rpx;
  71. display: flex;
  72. align-items: flex-start;
  73. .item-img {
  74. margin-right: 32rpx;
  75. }
  76. .item-info {
  77. display: flex;
  78. flex-direction: column;
  79. flex: 1;
  80. justify-content: space-between;
  81. height: 100%;
  82. .item-title-box {
  83. .item-title {
  84. font-size: 30rpx;
  85. font-weight: 400;
  86. line-height: 45rpx;
  87. color: rgba(26, 26, 26, 1);
  88. display: flex;
  89. align-items: center;
  90. justify-content: space-between;
  91. margin-bottom: 15rpx;
  92. }
  93. }
  94. .item-de {
  95. display: flex;
  96. font-size: 26rpx;
  97. font-weight: 400;
  98. line-height: 39rpx;
  99. color: rgba(153, 153, 153, 1);
  100. display: flex;
  101. align-items: center;
  102. justify-content: flex-start;
  103. }
  104. .item-time {
  105. font-size: 26rpx;
  106. font-weight: 400;
  107. letter-spacing: 0rpx;
  108. line-height: 39rpx;
  109. color: rgba(153, 153, 153, 1);
  110. margin-bottom: 20rpx;
  111. }
  112. .item-price {
  113. font-size: 30rpx;
  114. font-weight: 400;
  115. letter-spacing: 0rpx;
  116. line-height: 45rpx;
  117. color: rgba(203, 26, 28, 1);
  118. margin-bottom: 16rpx;
  119. }
  120. .item-box {
  121. display: flex;
  122. align-items: center;
  123. justify-content: flex-end;
  124. .item-btns {
  125. display: flex;
  126. align-items: center;
  127. justify-content: center;
  128. .btn-s {
  129. font-size: 26rpx;
  130. font-weight: 400;
  131. color: rgba(221, 94, 69, 1);
  132. text-align: center;
  133. padding: 16rpx 0;
  134. width: 156.03rpx;
  135. border-radius: 8rpx;
  136. background: rgba(0, 0, 0, 0);
  137. display: flex;
  138. justify-content: center;
  139. border: 0rpx solid rgba(221, 94, 69, 1);
  140. }
  141. .btn-m {
  142. border-radius: 59rpx;
  143. font-size: 26rpx;
  144. text-align: left;
  145. margin-left: 24rpx;
  146. display: flex;
  147. justify-content: center;
  148. color: #dd5e45;
  149. padding: 12rpx 32rpx;
  150. border: 1px solid;
  151. border-radius: 59rpx;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. .item-time-text {
  158. color: #dd5e45;
  159. }
  160. </style>