userItem.vue 7.2 KB

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