userItem.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view class="item">
  3. <view class="item-img">
  4. <up-image :show-loading="true" :src="data.volunteerPicture" width="112rpx" height="112rpx"></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: () => { },
  53. type: 'primary'
  54. },
  55. {
  56. name: '退款',
  57. onClick: (e)=>handleRefund(e),
  58. show: (item) => ['3'].includes(item.orderStatus),
  59. type: 'error'
  60. },
  61. {
  62. name: '取消',
  63. onClick: (e)=>handleCancel(e),
  64. show: (item) => ['1'].includes(item.orderStatus),
  65. type: 'warning'
  66. },
  67. {
  68. name: '查看',
  69. onClick: (e)=>handlClick(e),
  70. // show: (item) => item.orderStatus !== '1',
  71. type: 'info'
  72. },
  73. ]
  74. //申请退款
  75. const handleRefund = (item) => {
  76. const mainOrderId = item.mainOrderId; // 获取详情id
  77. uni.navigateTo({
  78. url: `/pages_classify/pages/requestaRefund/requestaRefund?mainOrderId=${mainOrderId}`
  79. });
  80. };
  81. // 取消订单
  82. const handleCancel = (item) => {
  83. const mainOrderId = item.mainOrderId;
  84. uni.navigateTo({
  85. url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
  86. });
  87. };
  88. //查看
  89. const handlClick = (item) => {
  90. const mainOrderId = item.mainOrderId; // 获取详情id
  91. uni.navigateTo({
  92. url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
  93. });
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .item {
  98. border-radius: 24rpx;
  99. background: rgba(255, 255, 255, 1);
  100. margin-bottom: 24rpx;
  101. padding: 32rpx;
  102. display: flex;
  103. align-items: flex-start;
  104. .item-img {
  105. margin-right: 32rpx;
  106. }
  107. .item-info {
  108. display: flex;
  109. flex-direction: column;
  110. flex: 1;
  111. justify-content: space-between;
  112. height: 100%;
  113. .item-title-box {
  114. .item-title {
  115. font-size: 30rpx;
  116. font-weight: 400;
  117. line-height: 45rpx;
  118. color: rgba(26, 26, 26, 1);
  119. display: flex;
  120. align-items: center;
  121. justify-content: space-between;
  122. margin-bottom: 15rpx;
  123. }
  124. }
  125. .item-de {
  126. display: flex;
  127. font-size: 26rpx;
  128. font-weight: 400;
  129. line-height: 39rpx;
  130. color: rgba(153, 153, 153, 1);
  131. display: flex;
  132. align-items: center;
  133. justify-content: flex-start;
  134. }
  135. .item-time {
  136. font-size: 26rpx;
  137. font-weight: 400;
  138. letter-spacing: 0rpx;
  139. line-height: 39rpx;
  140. color: rgba(153, 153, 153, 1);
  141. margin-bottom: 20rpx;
  142. }
  143. .item-price {
  144. font-size: 30rpx;
  145. font-weight: 400;
  146. letter-spacing: 0rpx;
  147. line-height: 45rpx;
  148. color: rgba(203, 26, 28, 1);
  149. margin-bottom: 16rpx;
  150. }
  151. .item-box {
  152. display: flex;
  153. align-items: center;
  154. justify-content: flex-end;
  155. .item-btns {
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. .btn-s {
  160. font-size: 26rpx;
  161. font-weight: 400;
  162. color: rgba(221, 94, 69, 1);
  163. text-align: center;
  164. padding: 16rpx 0;
  165. width: 156.03rpx;
  166. border-radius: 8rpx;
  167. background: rgba(0, 0, 0, 0);
  168. display: flex;
  169. justify-content: center;
  170. border: 0rpx solid rgba(221, 94, 69, 1);
  171. }
  172. .btn-m {
  173. border-radius: 59rpx;
  174. font-size: 26rpx;
  175. text-align: left;
  176. margin-left: 24rpx;
  177. display: flex;
  178. justify-content: center;
  179. color: #dd5e45;
  180. padding: 12rpx 32rpx;
  181. border: 1px solid;
  182. border-radius: 59rpx;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. .item-time-text {
  189. color: #dd5e45;
  190. }
  191. .skill-description {
  192. display: -webkit-box;
  193. -webkit-line-clamp: 2;
  194. /* 限制两行 */
  195. -webkit-box-orient: vertical;
  196. overflow: hidden;
  197. text-overflow: ellipsis;
  198. line-height: 1.4;
  199. min-height: 2.8em;
  200. /* 两行高度 */
  201. }
  202. </style>