userItem.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="item">
  3. <view class="item-img">
  4. <up-image :show-loading="true" :src="data.volunteerPicture"></up-image>
  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="String(data.orderStatus)" />
  13. </view>
  14. <view class="item-de">
  15. 服务类别:{{ data.businessTierName }}
  16. </view>
  17. <view class="item-de">
  18. 下单日期:{{ data.createTime }}
  19. </view>
  20. <view class="item-time skill-description">
  21. 服务描述:{{ data.businessDescribe }}
  22. </view>
  23. </view>
  24. <view class="item-box">
  25. <view class="item-btns">
  26. <view v-for="item in btns" :key="item.name">
  27. <view class="btn-m" v-if="item.show ? item.show(data) : true" :type="item.type" text="取消"
  28. @click="item.onClick(data)">
  29. {{ item.name }}
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import { inject } from 'vue';
  39. import DictTag from '@/components/DictTag/index.vue'
  40. const props = defineProps({
  41. data: {
  42. type: Object,
  43. default: () => {
  44. return {}
  45. }
  46. },
  47. });
  48. const order_status = inject('order_status');
  49. const btns = [
  50. {
  51. name: '沟通',
  52. onClick: (e) => {
  53. console.log("TCL: e", e)
  54. uni.navigateTo({
  55. url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}`
  56. });
  57. },
  58. type: 'primary'
  59. },
  60. {
  61. name: '退款',
  62. onClick: (e) => handleRefund(e),
  63. show: (item) => ['3'].includes(item.orderStatus),
  64. type: 'error'
  65. },
  66. {
  67. name: '取消',
  68. onClick: (e) => handleCancel(e),
  69. show: (item) => ['1'].includes(item.orderStatus),
  70. type: 'warning'
  71. },
  72. {
  73. name: '查看',
  74. onClick: (e) => handlClick(e),
  75. // show: (item) => item.orderStatus !== '1',
  76. type: 'info'
  77. },
  78. ]
  79. //申请退款
  80. const handleRefund = (item) => {
  81. const mainOrderId = item.mainOrderId; // 获取详情id
  82. uni.navigateTo({
  83. url: `/pages_classify/pages/requestaRefund/requestaRefund?mainOrderId=${mainOrderId}`
  84. });
  85. };
  86. // 取消订单
  87. const handleCancel = (item) => {
  88. const mainOrderId = item.mainOrderId;
  89. uni.navigateTo({
  90. url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
  91. });
  92. };
  93. //查看
  94. const handlClick = (item) => {
  95. const mainOrderId = item.mainOrderId; // 获取详情id
  96. uni.navigateTo({
  97. url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
  98. });
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .item {
  103. border-radius: 18rpx;
  104. background: #FFFFFF;
  105. box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
  106. margin-bottom: 24rpx;
  107. padding: 32rpx;
  108. display: flex;
  109. align-items: flex-start;
  110. .item-img {
  111. width: 122rpx;
  112. height: 122rpx;
  113. border-radius: 200rpx;
  114. overflow: hidden;
  115. :deep(image) {
  116. width: 100%;
  117. height: 100%;
  118. object-fit: cover;
  119. }
  120. }
  121. .item-info {
  122. display: flex;
  123. flex-direction: column;
  124. flex: 1;
  125. justify-content: space-between;
  126. height: 100%;
  127. .item-title-box {
  128. .item-title {
  129. font-size: 30rpx;
  130. font-weight: 400;
  131. line-height: 45rpx;
  132. color: rgba(26, 26, 26, 1);
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. margin-bottom: 15rpx;
  137. }
  138. }
  139. .item-de {
  140. display: flex;
  141. font-size: 26rpx;
  142. font-weight: 400;
  143. line-height: 39rpx;
  144. color: rgba(153, 153, 153, 1);
  145. display: flex;
  146. align-items: center;
  147. justify-content: flex-start;
  148. }
  149. .item-time {
  150. font-size: 26rpx;
  151. font-weight: 400;
  152. letter-spacing: 0rpx;
  153. line-height: 39rpx;
  154. color: rgba(153, 153, 153, 1);
  155. margin-bottom: 20rpx;
  156. }
  157. .item-price {
  158. font-size: 30rpx;
  159. font-weight: 400;
  160. letter-spacing: 0rpx;
  161. line-height: 45rpx;
  162. color: rgba(203, 26, 28, 1);
  163. margin-bottom: 16rpx;
  164. }
  165. .item-box {
  166. display: flex;
  167. align-items: center;
  168. justify-content: flex-end;
  169. .item-btns {
  170. display: flex;
  171. align-items: center;
  172. justify-content: center;
  173. .btn-s {
  174. font-size: 26rpx;
  175. font-weight: 400;
  176. color: rgba(221, 94, 69, 1);
  177. text-align: center;
  178. padding: 16rpx 0;
  179. width: 156.03rpx;
  180. border-radius: 8rpx;
  181. background: rgba(0, 0, 0, 0);
  182. display: flex;
  183. justify-content: center;
  184. border: 0rpx solid rgba(221, 94, 69, 1);
  185. }
  186. .btn-m {
  187. border-radius: 59rpx;
  188. font-size: 26rpx;
  189. text-align: left;
  190. margin-left: 24rpx;
  191. display: flex;
  192. justify-content: center;
  193. color: #dd5e45;
  194. padding: 12rpx 32rpx;
  195. border: 1px solid;
  196. border-radius: 59rpx;
  197. }
  198. }
  199. }
  200. }
  201. }
  202. .item-time-text {
  203. color: #dd5e45;
  204. }
  205. .skill-description {
  206. display: -webkit-box;
  207. -webkit-line-clamp: 2;
  208. /* 限制两行 */
  209. -webkit-box-orient: vertical;
  210. overflow: hidden;
  211. text-overflow: ellipsis;
  212. line-height: 1.4;
  213. min-height: 2.8em;
  214. /* 两行高度 */
  215. }
  216. </style>