userItem.vue 6.0 KB

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