Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

order-confirm-receipt.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!-- 订单详情-确认收货 -->
  2. <template>
  3. <view class="card-box">
  4. <view class="as-layout-horizontal as-gravity-center-start title">
  5. <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon"></image>
  6. <text class="txt-title">{{ state.orderInfo.productName }}</text>
  7. </view>
  8. <view style="border-bottom: 1px solid #dcdcdc" />
  9. <!-- 订单信息 -->
  10. <view class="order-box">
  11. <view class="order-item" v-for="(item, index) in state.list" :key="index">
  12. <order-info-item :label="item.label" :value="item.value"></order-info-item>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="hint">请核对实收货物与上述货物编号是否一致!</view>
  17. <view class="btn">
  18. <submit-button title="确认收货" @submit="$util.confirm('是否确认收到货?', confirmReceipt, '收货确认')"></submit-button>
  19. </view>
  20. </template>
  21. <script setup lang="ts">
  22. import orderInfoItem from "../components/order-info-item";
  23. import { reactive } from "vue";
  24. import { onLoad } from "@dcloudio/uni-app";
  25. import {requestNew } from "@/utils/network/request.js";
  26. import {confirm, getOrderStatusName } from "@/utils/utils";
  27. import {orderReceiveGoodsSH,changeCardObuView } from "@/utils/network/api";
  28. import { getItem, StorageKeys } from "@/utils/storage";
  29. const state = reactive({
  30. //订单信息
  31. orderInfo: {} as any,
  32. //显示订单信息
  33. list: [
  34. {
  35. label: "订单编号:",
  36. value: "",
  37. },
  38. {
  39. label: "订单车牌:",
  40. value: "",
  41. },
  42. {
  43. label: "订单状态:",
  44. value: "",
  45. },
  46. {
  47. label: "发货卡号:",
  48. value: "",
  49. },
  50. {
  51. label: "发货签号:",
  52. value: "",
  53. },
  54. ],
  55. });
  56. //确认收货
  57. const confirmReceipt = (e) => {
  58. const options = {
  59. type: 2,
  60. data: {
  61. id:state.orderInfo.id
  62. },
  63. method: "POST",
  64. showLoading: true,
  65. };
  66. requestNew(orderReceiveGoodsSH, options).then((res) => {
  67. confirm(
  68. "您已完成订单收货",
  69. () => {
  70. uni.$emit("refreshOrder");
  71. uni.navigateBack({
  72. delta:2
  73. });
  74. },
  75. "收货完成",
  76. false
  77. );
  78. });
  79. }
  80. // onUnload(() => {
  81. // //移除监听
  82. // uni.$off('bluetoothLink')
  83. // })
  84. //确认收货
  85. const confirmReceiptClick = (e) => {
  86. navTo("/pages/bluetooth/bluetooth?routeType=5&id=" + state.orderInfo.id); //去连接蓝牙
  87. };
  88. //获取订单详情
  89. const getOrderDetails = (id) => {
  90. const options = {
  91. type: 2,
  92. data: { id: id },
  93. method: "POST",
  94. showLoading: true,
  95. };
  96. requestNew(changeCardObuView, options).then((res) => {
  97. console.log("获取订单详情",res)
  98. state.orderInfo =res;
  99. state.list[0].value = state.orderInfo.orderNo;
  100. state.list[1].value = state.orderInfo.vehiclePlate;
  101. state.list[2].value = state.orderInfo.orderStepStr;
  102. state.list[3].value = state.orderInfo.newCardId ? state.orderInfo.newCardId : "";
  103. state.list[4].value = state.orderInfo.newObuId ? state.orderInfo.newObuId : "";
  104. });
  105. };
  106. onLoad((options) => {
  107. getOrderDetails(options.id);
  108. });
  109. </script>
  110. <style>
  111. page {
  112. background-color: #eef7f7;
  113. }
  114. </style>
  115. <style lang="scss" scoped>
  116. .card-box {
  117. background-color: white;
  118. border-radius: 20rpx;
  119. box-shadow: 0px 0px 6rpx 2rpx rgba(223, 223, 223, 0.3);
  120. margin: 30rpx;
  121. padding: 20rpx 0;
  122. .title {
  123. padding: 0 20rpx 20rpx;
  124. }
  125. .icon {
  126. width: 48rpx;
  127. height: 48rpx;
  128. margin-right: 10rpx;
  129. }
  130. .txt-title {
  131. font-size: 30rpx;
  132. color: #333333;
  133. }
  134. .order-box {
  135. padding: 0px 24rpx 10rpx;
  136. .order-item {
  137. padding: 28rpx 0px 0px;
  138. }
  139. }
  140. }
  141. .hint {
  142. font-size: 28rpx;
  143. color: #ff8000;
  144. margin-top: 60rpx;
  145. text-align: center;
  146. }
  147. .btn {
  148. margin: 500rpx 40rpx 50rpx;
  149. }
  150. </style>