選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

order-list-item-new.vue 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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 v-if="!item.appraise" class='evaluation'>
  83. <view class="btn btn-primary" @click.stop="gotoEvaluateOrder(item)" >去评价最初的</view>
  84. <view class="btn btn-primary" @click.stop="gotoEvaluateProduct(item)" >去评价产品</view>
  85. <view class="btn btn-primary" @click.stop="gotoEvaluateSalesman(item)" >去评价业务员</view>
  86. </view>
  87. <view class="btn btn-normal" v-else>已评价</view>
  88. </view>
  89. <!-- 已结束 -->
  90. <view class="btns" v-else-if="item.orderStep == OrderStatus.已结束">
  91. <view class="btn btn-primary" @click.stop="showActiveOrder = true">重新激活订单</view>
  92. </view>
  93. <!-- 换货中 -->
  94. <view class="btns" v-else-if="item.orderStep == OrderStatus['已申请-换货']">
  95. <!-- 查看物流: 原型没有UI有 -->
  96. <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流</view>
  97. <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货</view>
  98. </view>
  99. </template>
  100. </view>
  101. <!-- 弹窗 -->
  102. <u-popup v-model="showActiveOrder" mode="center">
  103. <popup-active-order content="确认是否重新激活订单" @cancel="showActiveOrder = false" @confirm="toActiveOrder">
  104. </popup-active-order>
  105. </u-popup>
  106. </template>
  107. <script lang="ts" setup>
  108. import popupActiveOrder from "./popup-active-order.vue";
  109. import useOrderSkip from "@/composables/order/useOrderSkip";
  110. import {
  111. getOrderStatusName,
  112. msg,
  113. getOrderTypeName
  114. } from "@/utils/utils";
  115. import {
  116. ref
  117. } from "vue";
  118. import {
  119. OrderStatus
  120. } from "@/datas/enum";
  121. import {
  122. vehiclePlateColor
  123. } from "@/datas/vehiclePlateColor";
  124. defineProps({
  125. item: {
  126. type: Object,
  127. default: () => ({}),
  128. },
  129. });
  130. //是否确认激活订单弹窗
  131. const showActiveOrder = ref(false);
  132. //办理订单按钮跳转业务逻辑
  133. const {
  134. gotoEditAddress,
  135. gotoCancelOrder,
  136. gotoEditUserOrUnitInfo,
  137. gotoConfirmReceipt,
  138. gotoCheckLogistics,
  139. gotoEvaluateOrder,
  140. gotoEvaluateProduct,
  141. gotoEvaluateSalesman,
  142. gotoActiveOrder,
  143. gotoReturnOrder,
  144. gotoExchangeOrder,
  145. gotoPay,
  146. gotoOrderDetails
  147. } = useOrderSkip();
  148. //激活订单
  149. const toActiveOrder = (item) => {
  150. gotoActiveOrder(item);
  151. showActiveOrder.value = false;
  152. }
  153. //获取车牌颜色文字
  154. const getVehiclePlateColor = (id: number) => {
  155. const colors = vehiclePlateColor.filter(item => item.id == id);
  156. return colors[0].color
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .item {
  161. background: #ffffff;
  162. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  163. border-radius: 20rpx;
  164. box-sizing: border-box;
  165. display: flex;
  166. flex-direction: column;
  167. margin: 30rpx 30rpx 0rpx;
  168. }
  169. .bg-white .item {
  170. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  171. }
  172. .item .head {
  173. display: flex;
  174. justify-content: space-between;
  175. align-items: center;
  176. padding: 20rpx 28rpx;
  177. border-bottom: 1px solid #dcdcdc;
  178. }
  179. .item .head {
  180. .head-row {
  181. display: flex;
  182. width: 100%;
  183. justify-content: space-between;
  184. align-items: center;
  185. }
  186. .name {}
  187. .name>text {
  188. font-size: 26rpx;
  189. font-family: Noto Sans S Chinese;
  190. font-weight: 400;
  191. color: #999999;
  192. line-height: 36rpx;
  193. }
  194. }
  195. .item .head .icon {
  196. width: 48rpx;
  197. height: 48rpx;
  198. }
  199. .item .head .name {
  200. display: flex;
  201. align-items: center;
  202. }
  203. .text-green {
  204. font-size: 26rpx;
  205. color: #00b38b;
  206. }
  207. .text-orange {
  208. font-size: 26rpx;
  209. color: #ff8000;
  210. }
  211. .text-black {
  212. font-size: 28rpx;
  213. color: #333;
  214. font-weight: 500;
  215. }
  216. .title {
  217. font-size: 30rpx;
  218. color: #333;
  219. }
  220. .tag-green {
  221. font-size: 22rpx;
  222. height: 40rpx;
  223. line-height: 40rpx;
  224. padding: 0 12rpx;
  225. border-radius: 6rpx;
  226. background: #d9f4ee;
  227. color: #00b38b;
  228. }
  229. .tag-grey {
  230. font-size: 22rpx;
  231. height: 40rpx;
  232. line-height: 40rpx;
  233. padding: 0 12rpx;
  234. border-radius: 6rpx;
  235. background: #e8e8e8;
  236. color: #666;
  237. }
  238. .detail {
  239. display: flex;
  240. justify-content: space-between;
  241. align-items: center;
  242. padding: 30rpx 32rpx;
  243. }
  244. .detail .type {
  245. font-size: 26rpx;
  246. color: #999;
  247. }
  248. .detail .value {
  249. font-size: 26rpx;
  250. color: #333;
  251. }
  252. .finished .detail .value {
  253. color: #999;
  254. }
  255. .detail .odd {
  256. margin: 20rpx 0;
  257. }
  258. .cny {
  259. font-size: 26rpx;
  260. color: #333;
  261. }
  262. .finished .cny {
  263. color: #999;
  264. }
  265. .amount {
  266. font-size: 40rpx;
  267. font-weight: bold;
  268. }
  269. .bottom .amount {
  270. color: #ff8000;
  271. }
  272. .finished .amount {
  273. color: #999;
  274. }
  275. .btns {
  276. position: relative;
  277. display: flex;
  278. align-items: center;
  279. justify-content: flex-end;
  280. border-top: 1px solid #dcdcdc;
  281. margin: 0 30rpx;
  282. padding: 20rpx 0;
  283. }
  284. .bottom {
  285. display: flex;
  286. justify-content: space-between;
  287. align-items: center;
  288. border-top: 1px solid #dcdcdc;
  289. margin: 0 30rpx;
  290. padding: 20rpx 0;
  291. }
  292. .btn {
  293. height: 60rpx;
  294. line-height: 58rpx;
  295. border-radius: 30rpx;
  296. padding: 0 24rpx;
  297. font-size: 26rpx;
  298. box-sizing: border-box;
  299. margin-right: 20rpx;
  300. }
  301. .btns .btn:last-child {
  302. margin: 0;
  303. }
  304. .btns .state {
  305. position: absolute;
  306. left: 0;
  307. font-size: 26rpx;
  308. font-family: Noto Sans S Chinese;
  309. font-weight: 400;
  310. color: #999999;
  311. line-height: 58rpx;
  312. text {
  313. font-size: 26rpx;
  314. font-family: Noto Sans S Chinese;
  315. font-weight: 400;
  316. color: #00B38B;
  317. line-height: 58rpx;
  318. }
  319. }
  320. .btn-primary {
  321. border: 1px solid #00b38b;
  322. color: #00b38b;
  323. }
  324. .btn-disable {
  325. border: 1px solid #999;
  326. color: #999;
  327. }
  328. .btn-normal {
  329. border: 1px solid #dcdcdc;
  330. color: #333;
  331. }
  332. .evaluation{
  333. display: flex;
  334. }
  335. </style>