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

order-confirm-receipt.vue 3.6KB

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