You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

order-list-item-new.vue 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <!-- 新办订单item
  2. 新办订单状态:待支付、审核中、审核不通过、待发货、待收货、待激活、已完成、已取消、已结束、退货、换货-->
  3. <template>
  4. <view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'" @click.stop="gotoOrderDetails(item)">
  5. <view class="head">
  6. <view class="name">
  7. <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon"></image>
  8. <text class="title">{{item.productName ?? ''}}</text>
  9. </view>
  10. <view class="status text-orange" v-if="item.orderStatus == OrderStatus.已取消">已取消</view>
  11. <view class="status text-green" v-else
  12. :class="{'text-orange':item.orderStep == OrderStatus.已完成 || item.orderStep == OrderStatus.已结束
  13. || item.orderStep == OrderStatus['换货-设备已回收'] || item.orderStep == OrderStatus.退款成功 || item.orderStep == OrderStatus.退货成功}">
  14. {{getOrderStatusName(item.orderStep)}}
  15. </view>
  16. </view>
  17. <view class="detail">
  18. <view class="orders">
  19. <view class="order-text">
  20. <text class="type">新办单号:</text>
  21. <text class="value">{{item.orderId}}</text>
  22. </view>
  23. <view class="order-text odd">
  24. <text class="type">业务类型:</text>
  25. <text class="value">{{getOrderTypeName(item.orderType)}}</text>
  26. </view>
  27. <view class="order-text">
  28. <text class="type">订单车牌号:</text>
  29. <text class="value">{{item.vehiclePlate}}</text>
  30. </view>
  31. <view class="order-text odd">
  32. <text class="type">订单车牌颜色:</text>
  33. <text class="value">{{getVehiclePlateColor(item.vehiclePlateColor)}}</text>
  34. </view>
  35. </view>
  36. <view class="money"><text class="cny">¥</text><text class="amount">{{item.amount / 100 ?? '0.00'}}</text>
  37. </view>
  38. </view>
  39. <template v-if="item.orderStatus != OrderStatus.已取消">
  40. <!-- 信息填写未完成 -->
  41. <view class="btns"
  42. v-if="item.orderStep == OrderStatus['完成个人/单位信息上传'] || item.orderStep == OrderStatus.完成填写基本信息 || item.orderStep == OrderStatus.完成车辆信息上传">
  43. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  44. <view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">继续申请</view>
  45. </view>
  46. <!-- 待支付 -->
  47. <view class="btns" v-if="item.orderStep == OrderStatus.待支付">
  48. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  49. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view>
  50. </view>
  51. <!-- 审核中/审核不通过 -->
  52. <view class="btns" v-if="item.orderStep == OrderStatus.待审核 || item.orderStep == OrderStatus.审核不通过">
  53. <view class="btn btn-normal" v-if="item.orderStep == OrderStatus.审核不通过"
  54. @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view>
  55. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  56. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">修改地址</view>
  57. </view>
  58. <!-- 待发货 -->
  59. <view class="btns" v-else-if="item.orderStep == OrderStatus.待发货">
  60. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  61. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">修改地址</view>
  62. </view>
  63. <!-- 待收货 -->
  64. <view class="btns" v-else-if="item.orderStep == OrderStatus.待收货">
  65. <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流
  66. </view>
  67. <view class="btn btn-normal" @click.stop="gotoReturnOrder(item)">申请退货
  68. </view>
  69. <view class="btn btn-normal" @click.stop="gotoExchangeOrder(item)">申请换货</view>
  70. <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货
  71. </view>
  72. </view>
  73. <!-- 待激活 -->
  74. <view class="btns" v-else-if="item.orderStep == OrderStatus.待激活">
  75. <view class="btn btn-normal" @click.stop="gotoReturnOrder(item)">申请退货</view>
  76. <view class="btn btn-normal" @click.stop="gotoExchangeOrder(item)">申请换货</view>
  77. <view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活
  78. </view>
  79. </view>
  80. <!-- 已完成 -->
  81. <view class="btns" v-else-if="item.orderStep == OrderStatus.已完成">
  82. <view class="btn btn-primary" @click.stop="gotoEvaluateOrder(item)" v-if="!item.appraise">去评价</view>
  83. <view class="btn btn-normal" v-else>已评价</view>
  84. </view>
  85. <!-- 已结束 -->
  86. <view class="btns" v-else-if="item.orderStep == OrderStatus.已结束">
  87. <view class="btn btn-primary" @click.stop="showActiveOrder = true">重新激活订单</view>
  88. </view>
  89. <!-- 换货中 -->
  90. <view class="btns" v-else-if="item.orderStep == OrderStatus['已申请-换货']">
  91. <!-- 查看物流: 原型没有UI有 -->
  92. <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流</view>
  93. <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货</view>
  94. </view>
  95. </template>
  96. </view>
  97. <!-- 弹窗 -->
  98. <u-popup v-model="showActiveOrder" mode="center">
  99. <popup-active-order content="确认是否重新激活订单" @cancel="showActiveOrder = false" @confirm="toActiveOrder">
  100. </popup-active-order>
  101. </u-popup>
  102. </template>
  103. <script lang="ts" setup>
  104. import popupActiveOrder from "./popup-active-order.vue";
  105. import useOrderSkip from "@/composables/order/useOrderSkip";
  106. import {
  107. getOrderStatusName,
  108. msg,
  109. getOrderTypeName
  110. } from "@/utils/utils";
  111. import {
  112. ref
  113. } from "vue";
  114. import {
  115. OrderStatus
  116. } from "@/datas/enum";
  117. import {
  118. vehiclePlateColor
  119. } from "@/datas/vehiclePlateColor";
  120. defineProps({
  121. item: {
  122. type: Object,
  123. default: () => ({}),
  124. },
  125. });
  126. //是否确认激活订单弹窗
  127. const showActiveOrder = ref(false);
  128. //办理订单按钮跳转业务逻辑
  129. const {
  130. gotoEditAddress,
  131. gotoCancelOrder,
  132. gotoEditUserOrUnitInfo,
  133. gotoConfirmReceipt,
  134. gotoCheckLogistics,
  135. gotoEvaluateOrder,
  136. gotoActiveOrder,
  137. gotoReturnOrder,
  138. gotoExchangeOrder,
  139. gotoPay,
  140. gotoOrderDetails
  141. } = useOrderSkip();
  142. //激活订单
  143. const toActiveOrder = (item) => {
  144. gotoActiveOrder(item);
  145. showActiveOrder.value = false;
  146. }
  147. //获取车牌颜色文字
  148. const getVehiclePlateColor = (id: number) => {
  149. const colors = vehiclePlateColor.filter(item => item.id == id);
  150. return colors[0].color
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .item {
  155. background: #ffffff;
  156. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  157. border-radius: 20rpx;
  158. box-sizing: border-box;
  159. display: flex;
  160. flex-direction: column;
  161. margin: 30rpx 30rpx 0rpx;
  162. }
  163. .bg-white .item {
  164. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  165. }
  166. .item .head {
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. padding: 20rpx 28rpx;
  171. border-bottom: 1px solid #dcdcdc;
  172. }
  173. .item .head {
  174. .head-row {
  175. display: flex;
  176. width: 100%;
  177. justify-content: space-between;
  178. align-items: center;
  179. }
  180. .name {}
  181. .name>text {
  182. font-size: 26rpx;
  183. font-family: Noto Sans S Chinese;
  184. font-weight: 400;
  185. color: #999999;
  186. line-height: 36rpx;
  187. }
  188. }
  189. .item .head .icon {
  190. width: 48rpx;
  191. height: 48rpx;
  192. }
  193. .item .head .name {
  194. display: flex;
  195. align-items: center;
  196. }
  197. .text-green {
  198. font-size: 26rpx;
  199. color: #00b38b;
  200. }
  201. .text-orange {
  202. font-size: 26rpx;
  203. color: #ff8000;
  204. }
  205. .text-black {
  206. font-size: 28rpx;
  207. color: #333;
  208. font-weight: 500;
  209. }
  210. .title {
  211. font-size: 30rpx;
  212. color: #333;
  213. }
  214. .tag-green {
  215. font-size: 22rpx;
  216. height: 40rpx;
  217. line-height: 40rpx;
  218. padding: 0 12rpx;
  219. border-radius: 6rpx;
  220. background: #d9f4ee;
  221. color: #00b38b;
  222. }
  223. .tag-grey {
  224. font-size: 22rpx;
  225. height: 40rpx;
  226. line-height: 40rpx;
  227. padding: 0 12rpx;
  228. border-radius: 6rpx;
  229. background: #e8e8e8;
  230. color: #666;
  231. }
  232. .detail {
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. padding: 30rpx 32rpx;
  237. }
  238. .detail .type {
  239. font-size: 26rpx;
  240. color: #999;
  241. }
  242. .detail .value {
  243. font-size: 26rpx;
  244. color: #333;
  245. }
  246. .finished .detail .value {
  247. color: #999;
  248. }
  249. .detail .odd {
  250. margin: 20rpx 0;
  251. }
  252. .cny {
  253. font-size: 26rpx;
  254. color: #333;
  255. }
  256. .finished .cny {
  257. color: #999;
  258. }
  259. .amount {
  260. font-size: 40rpx;
  261. font-weight: bold;
  262. }
  263. .bottom .amount {
  264. color: #ff8000;
  265. }
  266. .finished .amount {
  267. color: #999;
  268. }
  269. .btns {
  270. position: relative;
  271. display: flex;
  272. align-items: center;
  273. justify-content: flex-end;
  274. border-top: 1px solid #dcdcdc;
  275. margin: 0 30rpx;
  276. padding: 20rpx 0;
  277. }
  278. .bottom {
  279. display: flex;
  280. justify-content: space-between;
  281. align-items: center;
  282. border-top: 1px solid #dcdcdc;
  283. margin: 0 30rpx;
  284. padding: 20rpx 0;
  285. }
  286. .btn {
  287. height: 60rpx;
  288. line-height: 58rpx;
  289. border-radius: 30rpx;
  290. padding: 0 24rpx;
  291. font-size: 20rpx;
  292. box-sizing: border-box;
  293. margin-right: 20rpx;
  294. }
  295. .btns .btn:last-child {
  296. margin: 0;
  297. }
  298. .btns .state {
  299. position: absolute;
  300. left: 0;
  301. font-size: 26rpx;
  302. font-family: Noto Sans S Chinese;
  303. font-weight: 400;
  304. color: #999999;
  305. line-height: 58rpx;
  306. text {
  307. font-size: 26rpx;
  308. font-family: Noto Sans S Chinese;
  309. font-weight: 400;
  310. color: #00B38B;
  311. line-height: 58rpx;
  312. }
  313. }
  314. .btn-primary {
  315. border: 1px solid #00b38b;
  316. color: #00b38b;
  317. }
  318. .btn-disable {
  319. border: 1px solid #999;
  320. color: #999;
  321. }
  322. .btn-normal {
  323. border: 1px solid #dcdcdc;
  324. color: #333;
  325. }
  326. </style>