listItem.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="item">
  3. <view class="item-img">
  4. <img :src=" baseUrl + data.avatar" alt="">
  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. <dict-tag :options="lrr_service_status" :value="data.orderStatus" v-if="data.score" />
  13. <text v-else>
  14. 待评价
  15. </text>
  16. </view>
  17. <view class="item-de">
  18. 服务地址:{{ data.address }}
  19. </view>
  20. </view>
  21. <view class="item-box">
  22. <view class="item-price"><span class="item-price-yuan">¥</span> {{ data.serviceOnePrice || 0 }}</view>
  23. <view class="item-btns">
  24. <up-button type="error" text="查看" size="mini" :custom-style="btn_style"
  25. @click="onClick(1)"></up-button>
  26. <up-button type="error" text="沟通" size="mini" :custom-style="btn_style"
  27. @click="onClick(2)"></up-button>
  28. <!-- <up-button type="error" text="上传照片" size="mini" :custom-style="btn_style" @click="onClick(3)"></up-button> -->
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script setup>
  35. import { inject } from 'vue';
  36. import DictTag from '@/components/DictTag/index.vue'
  37. import config from '@/config'
  38. const baseUrl = config.baseUrl
  39. const props = defineProps({
  40. data: {
  41. type: Object,
  42. default: () => {
  43. return {}
  44. }
  45. },
  46. });
  47. const inject_click = inject('onClick');
  48. const lrr_service_status = inject('lrr_service_status');
  49. const btn_style = ` width: 120rpx; height: 50rpx; font-size: 24rpx;border-radius: 25rpx;margin-left: 12rpx;`;
  50. /**
  51. * 1: 查看
  52. * 2:沟通
  53. */
  54. function onClick(type) {
  55. inject_click(props.data, type);
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .item {
  60. height: 120px;
  61. border-radius: 10px;
  62. background: rgba(255, 255, 255, 1);
  63. padding: 12px;
  64. margin-bottom: 12px;
  65. display: flex;
  66. .item-img {
  67. width: 96px;
  68. height: 96px;
  69. margin-right: 12px;
  70. image {
  71. height: 100%;
  72. width: 100%;
  73. }
  74. }
  75. .item-info {
  76. flex: 1;
  77. display: flex;
  78. flex-direction: column;
  79. justify-content: space-between;
  80. .item-title-box {
  81. .item-title {
  82. font-size: 14px;
  83. font-weight: 700;
  84. letter-spacing: 0px;
  85. line-height: 20.27px;
  86. color: rgba(51, 51, 51, 1);
  87. text-align: left;
  88. vertical-align: top;
  89. margin-bottom: 10px;
  90. display: flex;
  91. align-content: center;
  92. justify-content: space-between;
  93. .item-name {
  94. flex: 1;
  95. display: flex;
  96. // display: -webkit-box;
  97. // -webkit-box-orient: vertical;
  98. // -webkit-line-clamp: 1;
  99. // overflow: hidden;
  100. // text-overflow: ellipsis;
  101. // word-break: break-all;
  102. }
  103. .item-tag {
  104. // color: #3c9cff;
  105. }
  106. }
  107. .item-de {
  108. font-size: 12px;
  109. font-weight: 500;
  110. letter-spacing: 0px;
  111. line-height: 17.38px;
  112. color: rgba(153, 153, 153, 1);
  113. text-align: left;
  114. vertical-align: top;
  115. display: -webkit-box;
  116. -webkit-box-orient: vertical;
  117. -webkit-line-clamp: 2;
  118. overflow: hidden;
  119. text-overflow: ellipsis;
  120. word-break: break-all;
  121. }
  122. }
  123. .item-box {
  124. display: flex;
  125. align-content: flex-end;
  126. justify-content: space-between;
  127. .item-price {
  128. font-size: 18px;
  129. font-weight: 500;
  130. letter-spacing: 0px;
  131. line-height: 21.09px;
  132. color: rgba(246, 74, 31, 1);
  133. text-align: center;
  134. vertical-align: top;
  135. .item-price-yuan {
  136. font-size: 13px;
  137. font-weight: 700;
  138. letter-spacing: 0px;
  139. line-height: 21.09px;
  140. color: rgba(246, 74, 31, 1);
  141. }
  142. }
  143. .item-btns {
  144. display: flex;
  145. }
  146. }
  147. }
  148. }
  149. </style>