userItem.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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: (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: 24rpx;
  104. background: rgba(255, 255, 255, 1);
  105. margin-bottom: 24rpx;
  106. padding: 32rpx;
  107. display: flex;
  108. align-items: flex-start;
  109. .item-img {
  110. margin-right: 32rpx;
  111. }
  112. .item-info {
  113. display: flex;
  114. flex-direction: column;
  115. flex: 1;
  116. justify-content: space-between;
  117. height: 100%;
  118. .item-title-box {
  119. .item-title {
  120. font-size: 30rpx;
  121. font-weight: 400;
  122. line-height: 45rpx;
  123. color: rgba(26, 26, 26, 1);
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. margin-bottom: 15rpx;
  128. }
  129. }
  130. .item-de {
  131. display: flex;
  132. font-size: 26rpx;
  133. font-weight: 400;
  134. line-height: 39rpx;
  135. color: rgba(153, 153, 153, 1);
  136. display: flex;
  137. align-items: center;
  138. justify-content: flex-start;
  139. }
  140. .item-time {
  141. font-size: 26rpx;
  142. font-weight: 400;
  143. letter-spacing: 0rpx;
  144. line-height: 39rpx;
  145. color: rgba(153, 153, 153, 1);
  146. margin-bottom: 20rpx;
  147. }
  148. .item-price {
  149. font-size: 30rpx;
  150. font-weight: 400;
  151. letter-spacing: 0rpx;
  152. line-height: 45rpx;
  153. color: rgba(203, 26, 28, 1);
  154. margin-bottom: 16rpx;
  155. }
  156. .item-box {
  157. display: flex;
  158. align-items: center;
  159. justify-content: flex-end;
  160. .item-btns {
  161. display: flex;
  162. align-items: center;
  163. justify-content: center;
  164. .btn-s {
  165. font-size: 26rpx;
  166. font-weight: 400;
  167. color: rgba(221, 94, 69, 1);
  168. text-align: center;
  169. padding: 16rpx 0;
  170. width: 156.03rpx;
  171. border-radius: 8rpx;
  172. background: rgba(0, 0, 0, 0);
  173. display: flex;
  174. justify-content: center;
  175. border: 0rpx solid rgba(221, 94, 69, 1);
  176. }
  177. .btn-m {
  178. border-radius: 59rpx;
  179. font-size: 26rpx;
  180. text-align: left;
  181. margin-left: 24rpx;
  182. display: flex;
  183. justify-content: center;
  184. color: #dd5e45;
  185. padding: 12rpx 32rpx;
  186. border: 1px solid;
  187. border-radius: 59rpx;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. .item-time-text {
  194. color: #dd5e45;
  195. }
  196. .skill-description {
  197. display: -webkit-box;
  198. -webkit-line-clamp: 2;
  199. /* 限制两行 */
  200. -webkit-box-orient: vertical;
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. line-height: 1.4;
  204. min-height: 2.8em;
  205. /* 两行高度 */
  206. }
  207. </style>