userItem.vue 5.8 KB

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