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

order-confirm-receipt.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 } from "@/utils/network/request.js";
  26. import { msg, confirm, getOrderStatusName } from "@/utils/utils";
  27. import { orderDetail, receiveOrder } 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. id: state.orderInfo.id,
  63. source: "WECHAT",
  64. opId: getItem(StorageKeys.OpenId),
  65. },
  66. method: "POST",
  67. showLoading: true,
  68. };
  69. request(receiveOrder, options).then((res) => {
  70. confirm(
  71. "您已完成订单收货",
  72. () => {
  73. uni.$emit("refreshOrder");
  74. uni.navigateBack();
  75. },
  76. "收货完成",
  77. false
  78. );
  79. });
  80. }
  81. // onUnload(() => {
  82. // //移除监听
  83. // uni.$off('bluetoothLink')
  84. // })
  85. //确认收货
  86. const confirmReceiptClick = (e) => {
  87. navTo("/pages/bluetooth/bluetooth?routeType=5&id=" + state.orderInfo.id); //去连接蓝牙
  88. };
  89. //获取订单详情
  90. const getOrderDetails = (id) => {
  91. const options = {
  92. type: 2,
  93. data: { id: id },
  94. method: "POST",
  95. showLoading: true,
  96. };
  97. request(orderDetail, options).then((res) => {
  98. state.orderInfo = stringToJson(res.bizContent);
  99. state.list[0].value = state.orderInfo.orderId;
  100. state.list[1].value = state.orderInfo.vehiclePlate;
  101. state.list[2].value = getOrderStatusName(state.orderInfo.orderStep);
  102. state.list[3].value = state.orderInfo.cardId ? state.orderInfo.cardId : "";
  103. state.list[4].value = state.orderInfo.obuId ? state.orderInfo.obuId : "";
  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 30rpx 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>