userItem.vue 7.2 KB

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