您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

order-details-card-sign.vue 18KB

1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
6 个月前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <!-- 换卡、换签、卡签同时更换-订单详情 -->
  2. <template>
  3. <view class="wrapper">
  4. <!-- 只有审核中、待发货订单有地址信息显示 -->
  5. <view v-if="state.orderInfo.orderStatus != OrderStatus.已取消">
  6. <view class="address-box as-gravity-center-start as-layout-horizontal" v-if="
  7. state.orderInfo.orderStep == OrderStatus.待审核 ||
  8. state.orderInfo.orderStep == OrderStatus.待发货 ">
  9. <view class="avatar as-gravity-center">
  10. {{state.orderInfo.orderInfoExt.consignee != null ? state.orderInfo.orderInfoExt.consignee.charAt(0): "" }}
  11. </view>
  12. <view class="center" style="flex: 1">
  13. <view class="as-layout-horizontal">
  14. <view class="name">
  15. {{ state.orderInfo.orderInfoExt.consignee ?state.orderInfo.orderInfoExt.consignee: ""}}
  16. </view>
  17. <view class="phone">
  18. {{ state.orderInfo.orderInfoExt.consigneeTel ?state.orderInfo.orderInfoExt.consigneeTel: "" }}
  19. </view>
  20. </view>
  21. <view class="addr">
  22. {{ state.orderInfo.orderInfoExt.region ?state.orderInfo.orderInfoExt.region : "" }}
  23. {{ state.orderInfo.orderInfoExt.address ?state.orderInfo.orderInfoExt.address: "" }}
  24. </view>
  25. </view>
  26. <image :src="`${$imgUrl}applyCard/edit.png`" mode="" class="edit"
  27. @click="gotoEditAddress(state.orderInfo)"></image>
  28. </view>
  29. </view>
  30. <view class="detail-box">
  31. <view class="detail-header">
  32. <image class="d-img" :src="`${$imgUrl}order/icon-star-green.png`"></image>
  33. <text class="detail-name">{{ state.orderInfo.productName ?state.orderInfo.productName: "" }}</text>
  34. </view>
  35. <view class="detail-content">
  36. <view class="base-info-box">
  37. <!-- 卡签信息 -->
  38. <view class="base-info">
  39. <view class="d-row">
  40. <text class="d-label">订单编号:</text>
  41. <text class="d-value">{{ state.orderInfo.orderId }}</text>
  42. </view>
  43. <view class="d-row">
  44. <text class="d-label">用户名称:</text>
  45. <text class="d-value">{{ state.orderInfo.vehiclePlate }}</text>
  46. </view>
  47. <view class="d-row">
  48. <text class="d-label">用户证件类型:</text>
  49. <text class="d-value">{{state.orderInfo.userType === "UNIT_USER" ? "单位" : "个人" }}</text>
  50. </view>
  51. <view class="d-row">
  52. <text class="d-label">用户证件号:</text>
  53. <text class="d-value">{{ state.orderInfo.vehicleType }}</text>
  54. </view>
  55. <view class="d-row">
  56. <text class="d-label">订单车牌号:</text>
  57. <text class="d-value text-orange">{{ state.orderInfo.vehiclePlate }}</text>
  58. </view>
  59. <view class="d-row">
  60. <text class="d-label">收费车型:</text>
  61. <text class="d-value text-green">{{ state.orderInfo.vehicleType }}</text>
  62. </view>
  63. <!-- 只换签不显示 -->
  64. <view v-if="state.orType !== 3">
  65. <view class="d-row">
  66. <text class="d-label">原卡号:</text>
  67. <text
  68. class="d-value">{{state.orderInfo.insertTime ?state.orderInfo.insertTime: "" }}</text>
  69. </view>
  70. <view class="d-row">
  71. <text class="d-label">原卡状态:</text>
  72. <text
  73. class="d-value">{{ state.orderInfo.insertTime ?state.orderInfo.insertTime: ""}}</text>
  74. </view>
  75. </view>
  76. <!-- 只换卡不显示 -->
  77. <view v-if="state.orType !== 2">
  78. <view class="d-row">
  79. <text class="d-label">原OBU号:</text>
  80. <text
  81. class="d-value">{{ state.orderInfo.insertTime ?state.orderInfo.insertTime:"" }}</text>
  82. </view>
  83. <view class="d-row">
  84. <text class="d-label">原OBU状态:</text>
  85. <text
  86. class="d-value">{{state.orderInfo.insertTime ?state.orderInfo.insertTime: ""}}</text>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 售后信息 -->
  91. <view class="post-sale">
  92. <!-- 通用信息 -->
  93. <view class="d-row">
  94. <text class="d-label">售后单号:</text>
  95. <text class="d-value">{{ state.orderInfo.XX ?state.orderInfo.XX: "没有这个字段"}}</text>
  96. </view>
  97. <view class="d-row">
  98. <text class="d-label">业务类型:</text>
  99. <text class="d-value">{{ state.orderInfo.orderType ?state.orderInfo.orderType: "" }}</text>
  100. </view>
  101. <view class="d-row">
  102. <text class="d-label">订单状态:</text>
  103. <text class="d-value text-green">{{ getOrderStatusName(state.orderInfo.orderStep)}}</text>
  104. </view>
  105. <view class="d-row">
  106. <text class="d-label">订单金额:</text>
  107. <text
  108. class="d-value text-orange">{{state.orderInfo.amount / 100 ?state.orderInfo.amount / 100: "0.00" }}</text>
  109. </view>
  110. <view class="d-row">
  111. <text class="d-label">创建时间:</text>
  112. <text class="d-value">{{ state.orderInfo.insertTime ?state.orderInfo.insertTime: ""}}</text>
  113. </view>
  114. <!-- 根据状态显示不同信息 -->
  115. <view>
  116. <!-- 已取消 -->
  117. <view v-if="state.orderInfo.orderStatus == OrderStatus.已取消">
  118. <view class="d-row">
  119. <text class="d-label">付款时间:</text>
  120. <text
  121. class="d-value">{{ state.orderInfo.orderInfoExt.payTime ?state.orderInfo.orderInfoExt.payTime: ""}}</text>
  122. </view>
  123. <view class="d-row">
  124. <text class="d-label">发货时间:</text>
  125. <text
  126. class="d-value">{{ state.orderInfo.orderInfoExt.deliveryTime ?state.orderInfo.orderInfoExt.deliveryTime: "" }}</text>
  127. </view>
  128. <view class="d-row">
  129. <text class="d-label">取消时间:</text>
  130. <text
  131. class="d-value">{{ state.orderInfo.orderInfoExt.cancelTime ?state.orderInfo.orderInfoExt.cancelTime: ""}}</text>
  132. </view>
  133. <view class="d-row">
  134. <text class="d-label">取消原因:</text>
  135. <text
  136. class="d-value">{{ state.orderInfo.orderInfoExt.cancelReason ?state.orderInfo.orderInfoExt.cancelReason: "" }}</text>
  137. </view>
  138. </view>
  139. <view v-else>
  140. <!-- 待发货 -->
  141. <view v-if="state.orderInfo.orderStep == OrderStatus.待发货">
  142. <view class="d-row">
  143. <text class="d-label">付款时间:</text>
  144. <text
  145. class="d-value">{{state.orderInfo.orderInfoExt.payTime ?state.orderInfo.orderInfoExt.payTime: "" }}</text>
  146. <!-- 换签 显示 -->
  147. <view v-if="state.orType === 3">
  148. <view class="d-row">
  149. <text class="d-label">快递单号:</text>
  150. <text
  151. class="d-value">{{ state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: ""}}</text>
  152. </view>
  153. <view class="d-row">
  154. <text class="d-label">物流公司:</text>
  155. <text
  156. class="d-value">{{state.orderInfo.courierCompany ?state.orderInfo.courierCompany: "" }}</text>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. <!-- 待收货 -->
  162. <view v-if="state.orderInfo.orderStep == OrderStatus.待收货">
  163. <view class="d-row">
  164. <text class="d-label">付款时间:</text>
  165. <text
  166. class="d-value">{{state.orderInfo.orderInfoExt.payTime ?state.orderInfo.orderInfoExt.payTime: ""}}</text>
  167. </view>
  168. <view class="d-row">
  169. <text class="d-label">发货时间:</text>
  170. <text
  171. class="d-value">{{state.orderInfo.orderInfoExt.deliveryTime ?state.orderInfo.orderInfoExt.deliveryTime: "" }}</text>
  172. </view>
  173. <!-- 换签、换卡 显示 -->
  174. <view v-if="state.orType === 3 || state.orType === 2">
  175. <view class="d-row">
  176. <text class="d-label">快递单号:</text>
  177. <text
  178. class="d-value">{{ state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: "" }}</text>
  179. </view>
  180. <view class="d-row">
  181. <text class="d-label">物流公司:</text>
  182. <text
  183. class="d-value">{{ state.orderInfo.courierCompany ?state.orderInfo.courierCompany: "" }}</text>
  184. </view>
  185. </view>
  186. </view>
  187. <!-- 待激活 -->
  188. <view v-if="state.orderInfo.orderStep == OrderStatus.待激活">
  189. <view class="d-row">
  190. <text class="d-label">付款时间:</text>
  191. <text
  192. class="d-value">{{state.orderInfo.orderInfoExt.payTime ?state.orderInfo.orderInfoExt.payTime:""}}</text>
  193. </view>
  194. <view class="d-row">
  195. <text class="d-label">发货时间:</text>
  196. <text
  197. class="d-value">{{ state.orderInfo.orderInfoExt.deliveryTime ?state.orderInfo.orderInfoExt.deliveryTime :"" }}</text>
  198. </view>
  199. <view class="d-row">
  200. <text class="d-label">收货时间:</text>
  201. <text
  202. class="d-value">{{ state.orderInfo.orderInfoExt.receivingTime ?state.orderInfo.orderInfoExt.receivingTime: ""}}</text>
  203. </view>
  204. <!-- 换签、换卡 显示 -->
  205. <view v-if="state.orType === 3 || state.orType === 2">
  206. <view class="d-row">
  207. <text class="d-label">快递单号:</text>
  208. <text
  209. class="d-value">{{ state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: "" }}</text>
  210. </view>
  211. <view class="d-row">
  212. <text class="d-label">物流公司:</text>
  213. <text
  214. class="d-value">{{ state.orderInfo.courierCompany ?state.orderInfo.courierCompany: "" }}</text>
  215. </view>
  216. </view>
  217. </view>
  218. <!-- 已完成 -->
  219. <view v-if="state.orderInfo.orderStep == OrderStatus.已完成">
  220. <view class="d-row">
  221. <text class="d-label">付款时间:</text>
  222. <text
  223. class="d-value">{{ state.orderInfo.orderInfoExt.payTime ?state.orderInfo.orderInfoExt.payTime: ""}}</text>
  224. </view>
  225. <view class="d-row">
  226. <text class="d-label">发货时间:</text>
  227. <text
  228. class="d-value">{{state.orderInfo.orderInfoExt.deliveryTime ?state.orderInfo.orderInfoExt.deliveryTime: ""}}</text>
  229. </view>
  230. <view class="d-row">
  231. <text class="d-label">收货时间:</text>
  232. <text
  233. class="d-value">{{state.orderInfo.orderInfoExt.receivingTime ?state.orderInfo.orderInfoExt.receivingTime: "" }}</text>
  234. </view>
  235. <view class="d-row">
  236. <text class="d-label">激活时间:</text>
  237. <text
  238. class="d-value">{{ state.orderInfo.cardEnableTime ?state.orderInfo.cardEnableTime: "" }}</text>
  239. </view>
  240. <!-- 换签、换卡 显示 -->
  241. <view v-if="state.orType === 3 || state.orType === 2">
  242. <view class="d-row">
  243. <text class="d-label">快递单号:</text>
  244. <text
  245. class="d-value">{{ state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: ""}}</text>
  246. </view>
  247. <view class="d-row">
  248. <text class="d-label">物流公司:</text>
  249. <text
  250. class="d-value">{{ state.orderInfo.courierCompany ?state.orderInfo.courierCompany: ""}}</text>
  251. </view>
  252. </view>
  253. </view>
  254. </view>
  255. </view>
  256. <!-- TODO 更换卡签时收费展示的字段 邮寄收 -->
  257. <view class="d-row" v-if="false">
  258. <text class="d-label">更换原因:</text>
  259. <text class="d-value">{{ state.orderInfo.reason ?state.orderInfo.reason: "" }}</text>
  260. </view>
  261. <!-- TODO 更换卡签时不收费展示的字段 线上换-邮寄收-->
  262. <view class="d-row">
  263. <text class="d-label">退货物流公司:</text>
  264. <text
  265. class="d-value">{{ state.orderInfo.courierCompany ?state.orderInfo.courierCompany: "" }}</text>
  266. </view>
  267. <view class="d-row">
  268. <text class="d-label">退货快递单号:</text>
  269. <text
  270. class="d-value">{{state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: "" }}</text>
  271. </view>
  272. <view class="d-row">
  273. <text class="d-label">更换原因:</text>
  274. <text class="d-value">{{ state.orderInfo.reason ?state.orderInfo.reason: "" }}</text>
  275. </view>
  276. </view>
  277. </view>
  278. <!-- 按钮区 -->
  279. <view class="btn-view" v-if="state.orderInfo.orderStatus != OrderStatus.已取消">
  280. <!-- 审核中 -->
  281. <view
  282. v-if=" state.orderInfo.orderStep == OrderStatus.待审核 || state.orderInfo.orderStep == OrderStatus.审核不通过"
  283. class="btn-status">
  284. <view class="btn space" @click="gotoEditAddress(state.orderInfo)">修改地址</view>
  285. <view class="btn-green" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  286. </view>
  287. <!-- 待支付 -->
  288. <view v-if="state.orderInfo.orderStep == OrderStatus.待支付" class="btn-status">
  289. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  290. <view class="btn-green width-num-1" @click="gotoCardSignPay(state.orderInfo)">支付</view>
  291. </view>
  292. <!-- 待发货 -->
  293. <view v-if="state.orderInfo.orderStep == OrderStatus.待发货" class="btn-status">
  294. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  295. <view class="btn-green" @click="gotoEditAddress(state.orderInfo)">修改地址</view>
  296. </view>
  297. <!-- 待收货 -->
  298. <view v-if="state.orderInfo.orderStep == OrderStatus.待收货" class="btn-status">
  299. <!-- <view class="btn space" @click="gotoCheckLogistics(state.orderInfo)">查看物流</view> -->
  300. <view class="btn-green" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
  301. </view>
  302. <!-- 待激活 -->
  303. <view v-if="state.orderInfo.orderStep == OrderStatus.待激活" class="btn-status">
  304. <view class="btn-green" @click="gotoActiveOrder(state.orderInfo)">去激活</view>
  305. </view>
  306. <!-- 订单完成 -->
  307. <view v-if="state.orderInfo.orderStep == OrderStatus.已完成" class="btn-status">
  308. <view class="btn space" @click="gotoEvaluateOrder(state.orderInfo)">去评价</view>
  309. </view>
  310. </view>
  311. </view>
  312. </view>
  313. </view>
  314. </template>
  315. <script setup lang="ts">
  316. import { reactive } from "vue";
  317. import { onLoad, onUnload } from "@dcloudio/uni-app";
  318. import { request } from "@/utils/network/request";
  319. import { orderDetail } from "@/utils/network/api";
  320. import { stringToJson } from "@/utils/network/encryption";
  321. import useOrderSkip from "@/composables/order/useOrderSkip";
  322. import { getETCStatusName, getOBUStatusName, getOrderStatusName, } from "@/utils/utils";
  323. import { OrderStatus } from "@/datas/enum";
  324. const state = reactive({
  325. orderInfo: {} as any, //订单信息
  326. orType: 1, //1-卡签同时更换 2-换卡 3-换签
  327. });
  328. //按钮跳转业务逻辑
  329. const {
  330. gotoEditAddress,
  331. gotoCancelOrder,
  332. gotoConfirmReceipt,
  333. gotoCheckLogistics,
  334. gotoEvaluateOrder,
  335. gotoActiveOrder,
  336. gotoCardSignPay,
  337. } = useOrderSkip();
  338. //获取订单详情
  339. const getOrderDetails = (id) => {
  340. const options = {
  341. type: 2,
  342. data: {
  343. id: id
  344. },
  345. method: "POST",
  346. showLoading: true,
  347. };
  348. request(orderDetail, options).then((res) => {
  349. state.orderInfo = stringToJson(res.bizContent);
  350. //测试
  351. // state.orderInfo.orderStep = OrderStatus.完成填写基本信息;
  352. });
  353. };
  354. onLoad((options) => {
  355. state.orType = options.orType;
  356. getOrderDetails(options.id);
  357. //刷新订单信息
  358. uni.$on("refreshOrder", (data) => {
  359. getOrderDetails(options.id);
  360. });
  361. //回显修改的地址 TODO 缺少修改订单详情地址接口
  362. uni.$on("selectAddressSuccess", (addr) => {
  363. (state.orderInfo.orderInfoExt.id = addr.id),
  364. (state.orderInfo.orderInfoExt.consignee = addr.consignee);
  365. state.orderInfo.orderInfoExt.consigneeTel = addr.consigneeTel;
  366. state.orderInfo.orderInfoExt.region = addr.region;
  367. state.orderInfo.orderInfoExt.address = addr.address;
  368. state.orderInfo.orderInfoExt.postalCode = addr.postalCode;
  369. });
  370. });
  371. onUnload(() => {
  372. uni.$off("refreshOrder");
  373. uni.$off("selectAddressSuccess");
  374. });
  375. </script>
  376. <style>
  377. page {
  378. background: #eef7f7;
  379. padding-bottom: 30rpx;
  380. }
  381. </style>
  382. <style lang="scss" scoped>
  383. .address-box {
  384. background: #ffffff;
  385. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  386. border-radius: 20rpx;
  387. margin: 30rpx 30rpx 0rpx;
  388. padding: 30rpx;
  389. .avatar {
  390. background: rgba(0, 179, 139, 0.2);
  391. border-radius: 50%;
  392. color: #00b38b;
  393. font-size: 26rpx;
  394. width: 80rpx;
  395. height: 80rpx;
  396. }
  397. .center {
  398. margin-left: 20rpx;
  399. margin-right: 20rpx;
  400. display: flex;
  401. flex-direction: column;
  402. justify-content: center;
  403. .name {
  404. font-size: 30rpx;
  405. font-family: Microsoft YaHei;
  406. font-weight: 400;
  407. color: #333333;
  408. }
  409. .phone {
  410. font-size: 24rpx;
  411. font-family: Microsoft YaHei;
  412. font-weight: 400;
  413. color: #999999;
  414. margin-left: 20rpx;
  415. }
  416. .addr {
  417. margin-top: 18rpx;
  418. font-size: 26rpx;
  419. font-family: Microsoft YaHei;
  420. font-weight: 400;
  421. color: #333333;
  422. line-height: 36rpx;
  423. }
  424. }
  425. .edit {
  426. width: 60rpx;
  427. height: 55rpx;
  428. }
  429. }
  430. .detail-box {
  431. background: #ffffff;
  432. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  433. border-radius: 20rpx;
  434. margin: 30rpx;
  435. .detail-header {
  436. display: flex;
  437. border-bottom: 1rpx solid #dcdcdc;
  438. padding: 30rpx;
  439. align-items: center;
  440. .d-img {
  441. width: 48rpx;
  442. height: 48rpx;
  443. }
  444. .detail-name {
  445. font-size: 30rpx;
  446. font-weight: 400;
  447. color: #333333;
  448. margin-left: 12rpx;
  449. }
  450. }
  451. .detail-content {
  452. padding: 28rpx 29rpx 10rpx 29rpx;
  453. .post-sale {
  454. border-top: 1rpx solid #dcdcdc;
  455. padding-top: 38rpx;
  456. }
  457. .d-row {
  458. display: flex;
  459. margin-bottom: 32rpx;
  460. .d-label {
  461. font-size: 26rpx;
  462. color: #999999;
  463. text-align: right;
  464. }
  465. .d-value {
  466. font-size: 26rpx;
  467. color: #333333;
  468. flex: 1;
  469. overflow: hidden;
  470. }
  471. }
  472. .btn-view {
  473. .btn-status {
  474. display: flex;
  475. justify-content: flex-end;
  476. padding: 20rpx 0;
  477. border-top: 1rpx solid #dcdcdc;
  478. }
  479. .space {
  480. margin-right: 19rpx;
  481. }
  482. .btn {
  483. border: 1px solid #dcdcdc;
  484. border-radius: 30rpx;
  485. color: #333333;
  486. font-size: 26rpx;
  487. height: 61rpx;
  488. width: 141rpx;
  489. display: flex;
  490. justify-content: center;
  491. align-items: center;
  492. font-size: 26rpx;
  493. }
  494. .btn-green {
  495. border: 1px solid #00b38b;
  496. border-radius: 30rpx;
  497. color: #00b38b;
  498. height: 61rpx;
  499. width: 141rpx;
  500. display: flex;
  501. justify-content: center;
  502. align-items: center;
  503. font-size: 26rpx;
  504. }
  505. .width-num-1 {
  506. width: 115rpx;
  507. }
  508. .width-num-2 {
  509. width: 221rpx;
  510. }
  511. .width-num-3 {
  512. width: 201rpx;
  513. }
  514. }
  515. }
  516. }
  517. .text-orange {
  518. color: #ff8000 !important;
  519. }
  520. .text-green {
  521. color: #00b38b !important;
  522. }
  523. </style>