listItem.vue 5.4 KB

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