listItem.vue 4.6 KB

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