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-confirm-receipt.vue 3.7KB

2 年之前
1 年之前
1 年之前
1 年之前
2 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
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 { request, requestNew } from "@/utils/network/request.js";
  26. import { msg, confirm, getOrderStatusName } from "@/utils/utils";
  27. import { orderDetail, receiveOrder,orderReceiveGoods } from "@/utils/network/api";
  28. import { getItem, StorageKeys } from "@/utils/storage";
  29. import { stringToJson } from "@/utils/network/encryption";
  30. const state = reactive({
  31. //订单信息
  32. orderInfo: {} as any,
  33. //显示订单信息
  34. list: [
  35. {
  36. label: "订单编号:",
  37. value: "",
  38. },
  39. {
  40. label: "订单车牌:",
  41. value: "",
  42. },
  43. {
  44. label: "订单状态:",
  45. value: "",
  46. },
  47. {
  48. label: "发货卡号:",
  49. value: "",
  50. },
  51. {
  52. label: "发货签号:",
  53. value: "",
  54. },
  55. ],
  56. });
  57. //确认收货
  58. const confirmReceipt = (e) => {
  59. const options = {
  60. type: 2,
  61. data: {
  62. opId: getItem(StorageKeys.OpenId),
  63. orderId:state.orderInfo.orderId
  64. },
  65. method: "POST",
  66. showLoading: true,
  67. };
  68. requestNew(orderReceiveGoods, options).then((res) => {
  69. confirm(
  70. "您已完成订单收货",
  71. () => {
  72. uni.$emit("refreshOrder");
  73. uni.navigateBack();
  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. request(orderDetail, options).then((res) => {
  97. state.orderInfo = stringToJson(res.bizContent);
  98. state.list[0].value = state.orderInfo.orderId;
  99. state.list[1].value = state.orderInfo.vehiclePlate;
  100. state.list[2].value = getOrderStatusName(state.orderInfo.orderStep);
  101. state.list[3].value = state.orderInfo.cardId ? state.orderInfo.cardId : "";
  102. state.list[4].value = state.orderInfo.obuId ? state.orderInfo.obuId : "";
  103. });
  104. };
  105. onLoad((options) => {
  106. getOrderDetails(options.id);
  107. });
  108. </script>
  109. <style>
  110. page {
  111. background-color: #eef7f7;
  112. }
  113. </style>
  114. <style lang="scss" scoped>
  115. .card-box {
  116. background-color: white;
  117. border-radius: 20rpx;
  118. box-shadow: 0px 0px 6rpx 2rpx rgba(223, 223, 223, 0.3);
  119. margin: 30rpx;
  120. padding: 20rpx 0;
  121. .title {
  122. padding: 0 20rpx 20rpx;
  123. }
  124. .icon {
  125. width: 48rpx;
  126. height: 48rpx;
  127. margin-right: 10rpx;
  128. }
  129. .txt-title {
  130. font-size: 30rpx;
  131. color: #333333;
  132. }
  133. .order-box {
  134. padding: 0px 30rpx 10rpx;
  135. .order-item {
  136. padding: 28rpx 0px 0px;
  137. }
  138. }
  139. }
  140. .hint {
  141. font-size: 28rpx;
  142. color: #ff8000;
  143. margin-top: 60rpx;
  144. text-align: center;
  145. }
  146. .btn {
  147. margin: 500rpx 40rpx 50rpx;
  148. }
  149. </style>