userItem.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view class="item">
  3. <view class="item-img">
  4. <!-- <up-image :show-loading="true" :src="data.volunteerPicture"></up-image> -->
  5. <image :show-loading="true" :src="data.volunteerPicture"></image>
  6. </view>
  7. <view class="item-info">
  8. <view class="item-serviceTotalPrice">¥{{ data.serviceTotalPrice }}</view>
  9. <view class="item-title-box">
  10. <view class="item-title">
  11. <view class="item-name">
  12. {{ data.name }}
  13. </view>
  14. </view>
  15. <view class="item-de">
  16. 服务类别:{{ data.businessTierName }}
  17. </view>
  18. <view class="item-de">
  19. 下单日期:{{ data.createTime }}
  20. </view>
  21. <view class="item-time">
  22. 服务描述:{{ data.businessDescribe }}
  23. </view>
  24. <view class="item-status-box">
  25. <image src="/static/img/矩形 413@1x.png" class="item-status-img"></image>
  26. <dict-tag :options="order_status" :value="String(data.orderStatus)" class="item-status" />
  27. </view>
  28. </view>
  29. <view class="item-box">
  30. <view class="item-btns">
  31. <view v-for="item in btns" :key="item.name">
  32. <view class="btn-m" v-if="item.show ? item.show(data) : true" :type="item.type" text="取消"
  33. @click="item.onClick(data)">
  34. <image v-if="item.name === '查看'" src="/static/img/组 14145@1x.png" class="btn-icon"></image>
  35. <image v-if="item.name === '沟通'" src="/static/img/容器 165@1x.png" class="btn-icon"></image>
  36. {{ item.name }}
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup>
  45. import { inject } from 'vue';
  46. import DictTag from '@/components/DictTag/index.vue'
  47. const props = defineProps({
  48. data: {
  49. type: Object,
  50. default: () => {
  51. return {}
  52. }
  53. },
  54. });
  55. const order_status = inject('order_status');
  56. const btns = [
  57. {
  58. name: '沟通',
  59. onClick: (e) => {
  60. console.log("TCL: e", e)
  61. uni.navigateTo({
  62. url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}`
  63. });
  64. },
  65. type: 'primary'
  66. },
  67. {
  68. name: '退款',
  69. onClick: (e) => handleRefund(e),
  70. show: (item) => ['3'].includes(item.orderStatus),
  71. type: 'error'
  72. },
  73. {
  74. name: '取消',
  75. onClick: (e) => handleCancel(e),
  76. show: (item) => ['1'].includes(item.orderStatus),
  77. type: 'warning'
  78. },
  79. {
  80. name: '查看',
  81. onClick: (e) => handlClick(e),
  82. // show: (item) => item.orderStatus !== '1',
  83. type: 'info'
  84. },
  85. ]
  86. //申请退款
  87. const handleRefund = (item) => {
  88. const mainOrderId = item.mainOrderId; // 获取详情id
  89. uni.navigateTo({
  90. url: `/pages_classify/pages/requestaRefund/requestaRefund?mainOrderId=${mainOrderId}`
  91. });
  92. };
  93. // 取消订单
  94. const handleCancel = (item) => {
  95. const mainOrderId = item.mainOrderId;
  96. uni.navigateTo({
  97. url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
  98. });
  99. };
  100. //查看
  101. const handlClick = (item) => {
  102. const mainOrderId = item.mainOrderId; // 获取详情id
  103. uni.navigateTo({
  104. url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
  105. });
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .item {
  110. display: flex;
  111. flex-direction: row;
  112. justify-content: space-between;
  113. align-items: center;
  114. width: 702rpx;
  115. height: 347rpx;
  116. // background: red;
  117. border-radius: 18rpx;
  118. background: #FFFFFF;
  119. box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
  120. margin-bottom: 25rpx;
  121. .item-img {
  122. width: 122rpx;
  123. height: 122rpx;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. image {
  128. width: 100%;
  129. height: 100%;
  130. border-radius: 122rpx;
  131. }
  132. }
  133. .item-info {
  134. display: flex;
  135. flex-direction: column;
  136. justify-content: space-between;
  137. height: 100%;
  138. padding: 20rpx;
  139. box-sizing: border-box;
  140. position: relative;
  141. // 价格
  142. .item-serviceTotalPrice {
  143. position: absolute;
  144. top: 20rpx;
  145. right: 20rpx;
  146. width: 96rpx;
  147. height: 42rpx;
  148. font-family: PingFang SC;
  149. font-size: 32rpx;
  150. font-weight: 600;
  151. line-height: 42rpx;
  152. letter-spacing: normal;
  153. color: rgba(0, 0, 0, 0.8);
  154. }
  155. // 志愿者姓名
  156. .item-name {
  157. width: 374rpx;
  158. height: 42rpx;
  159. font-family: PingFang SC;
  160. font-size: 32rpx;
  161. font-weight: 600;
  162. line-height: 42rpx;
  163. letter-spacing: normal;
  164. color: rgba(0, 0, 0, 0.8);
  165. margin-bottom: 10rpx;
  166. }
  167. .item-title-box {
  168. margin-top: 60rpx;
  169. }
  170. // 服务类别/下单日期
  171. .item-de {
  172. width: 532rpx;
  173. height: 34rpx;
  174. font-family: PingFang SC;
  175. font-size: 28rpx;
  176. font-weight: normal;
  177. line-height: 34rpx;
  178. letter-spacing: normal;
  179. color: rgba(0, 0, 0, 0.5);
  180. margin-bottom: 10rpx;
  181. }
  182. // 服务描述
  183. .item-time {
  184. width: 280rpx;
  185. /* Approximately 8 Chinese characters */
  186. height: 34rpx;
  187. font-family: PingFang SC;
  188. font-size: 28rpx;
  189. font-weight: normal;
  190. line-height: 34rpx;
  191. letter-spacing: normal;
  192. color: rgba(0, 0, 0, 0.5);
  193. overflow: hidden;
  194. text-overflow: ellipsis;
  195. white-space: nowrap;
  196. // max-width: 100%;
  197. margin-bottom: 10rpx;
  198. }
  199. .item-status-box {
  200. .item-status-img {
  201. width: 130rpx;
  202. height: 47rpx;
  203. position: absolute;
  204. top: 0rpx;
  205. left: -135rpx;
  206. }
  207. .item-status {
  208. width: 100rpx;
  209. height: 46rpx;
  210. font-family: PingFang SC;
  211. font-size: 24rpx;
  212. font-weight: 500;
  213. line-height: 44rpx;
  214. letter-spacing: normal;
  215. color: #843816;
  216. position: absolute;
  217. left: -116rpx;
  218. top: 2rpx;
  219. }
  220. }
  221. }
  222. .item-box {
  223. display: flex;
  224. justify-content: flex-end;
  225. align-items: center;
  226. .item-btns {
  227. display: flex;
  228. justify-content: flex-end;
  229. align-items: center;
  230. gap: 20rpx;
  231. .btn-m {
  232. width: 140rpx;
  233. height: 60rpx;
  234. font-family: PingFang SC;
  235. font-size: 24rpx;
  236. font-weight: 500;
  237. line-height: 60rpx;
  238. text-align: center;
  239. letter-spacing: normal;
  240. color: #FFFFFF;
  241. background: #D94342;
  242. border-radius: 36rpx;
  243. padding: 0;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. .btn-icon {
  248. width: 24rpx;
  249. height: 24rpx;
  250. margin-right: 8rpx;
  251. }
  252. }
  253. }
  254. }
  255. }
  256. </style>