listItem.vue 5.3 KB

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