listItem.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="item">
  3. <view class="item-img">
  4. <img src="/static/img/dd.png" 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. <dict-tag :options="lrr_service_category" :value="data.serviceCategory" />
  11. <view v-if="data.serviceType">
  12. -
  13. <dict-tag :options="lrr_study" :value="data.serviceType" v-if="data.serviceCategory === 2" />
  14. <dict-tag :options="lrr_chitchat" :value="data.serviceType" v-if="data.serviceCategory === 1" />
  15. </view>
  16. </view>
  17. <view class="item-tag" :style="statysColor"> {{ status_map[data.orderStatus] }}</view>
  18. </view>
  19. <view class="item-de">
  20. 服务地址:{{ data.addressId }}
  21. </view>
  22. </view>
  23. <view class="item-box">
  24. <view class="item-price"><span class="item-price-yuan">¥</span> {{ data.serviceOnePrice || 0 }}</view>
  25. <view class="item-btns">
  26. <up-button type="error" text="查看" size="mini" :custom-style="btn_style"
  27. @click="onClick(1)"></up-button>
  28. <!-- <up-button type="error" text="沟通" size="mini" :custom-style="btn_style" @click="onClick(2)"></up-button>
  29. <up-button type="error" text="上传照片" size="mini" :custom-style="btn_style" @click="onClick(3)"></up-button> -->
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup>
  36. import { inject } from 'vue';
  37. import DictTag from '@/components/DictTag/index.vue'
  38. import { computed } from 'vue';
  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_category = inject('lrr_service_category');
  49. const lrr_chitchat = inject('lrr_chitchat');
  50. const lrr_study = inject('lrr_study');
  51. const status_map = {
  52. 1: '待服务',
  53. 2: '已取消',
  54. 3: '进行中',
  55. 4: '已完成',
  56. 5: '申请退款中',
  57. 6: '已退款',
  58. 7: '部分退款',
  59. 8: '待确认'
  60. }
  61. const status_color_map = {
  62. 1: '#3c9cff',
  63. 2: '#f56c6c',
  64. 3: '#3c9cff',
  65. 4: 'rgba(56, 148, 254, 1)',
  66. 5: 'orange',
  67. 6: '#3c9cff',
  68. 7: 'orange',
  69. 8: '#3c9cff'
  70. }
  71. const statysColor = computed(() => {
  72. return {
  73. color: status_color_map[props.data.orderStatus]
  74. }
  75. });
  76. const btn_style = ` width: 120rpx; height: 50rpx; font-size: 24rpx;border-radius: 25rpx;margin-left: 12rpx;`;
  77. /**
  78. * 1: 查看
  79. * 2:沟通
  80. * 3:上传照片
  81. */
  82. function onClick() {
  83. inject_click(props.data, 1);
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .item {
  88. height: 120px;
  89. border-radius: 10px;
  90. background: rgba(255, 255, 255, 1);
  91. padding: 12px;
  92. margin-bottom: 12px;
  93. display: flex;
  94. .item-img {
  95. width: 96px;
  96. height: 96px;
  97. margin-right: 12px;
  98. image {
  99. height: 100%;
  100. width: 100%;
  101. }
  102. }
  103. .item-info {
  104. flex: 1;
  105. display: flex;
  106. flex-direction: column;
  107. justify-content: space-between;
  108. .item-title-box {
  109. .item-title {
  110. font-size: 14px;
  111. font-weight: 700;
  112. letter-spacing: 0px;
  113. line-height: 20.27px;
  114. color: rgba(51, 51, 51, 1);
  115. text-align: left;
  116. vertical-align: top;
  117. margin-bottom: 10px;
  118. display: flex;
  119. align-content: center;
  120. justify-content: space-between;
  121. .item-name {
  122. flex: 1;
  123. display: flex;
  124. // display: -webkit-box;
  125. // -webkit-box-orient: vertical;
  126. // -webkit-line-clamp: 1;
  127. // overflow: hidden;
  128. // text-overflow: ellipsis;
  129. // word-break: break-all;
  130. }
  131. .item-tag {
  132. // color: #3c9cff;
  133. }
  134. }
  135. .item-de {
  136. font-size: 12px;
  137. font-weight: 500;
  138. letter-spacing: 0px;
  139. line-height: 17.38px;
  140. color: rgba(153, 153, 153, 1);
  141. text-align: left;
  142. vertical-align: top;
  143. display: -webkit-box;
  144. -webkit-box-orient: vertical;
  145. -webkit-line-clamp: 2;
  146. overflow: hidden;
  147. text-overflow: ellipsis;
  148. word-break: break-all;
  149. }
  150. }
  151. .item-box {
  152. display: flex;
  153. align-content: flex-end;
  154. justify-content: space-between;
  155. .item-price {
  156. font-size: 18px;
  157. font-weight: 500;
  158. letter-spacing: 0px;
  159. line-height: 21.09px;
  160. color: rgba(246, 74, 31, 1);
  161. text-align: center;
  162. vertical-align: top;
  163. .item-price-yuan {
  164. font-size: 13px;
  165. font-weight: 700;
  166. letter-spacing: 0px;
  167. line-height: 21.09px;
  168. color: rgba(246, 74, 31, 1);
  169. }
  170. }
  171. .item-btns {
  172. display: flex;
  173. }
  174. }
  175. }
  176. }
  177. </style>