123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <!-- 订单详情-确认收货 -->
- <template>
- <view class="card-box">
- <view class="as-layout-horizontal as-gravity-center-start title">
- <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon"></image>
- <text class="txt-title">{{ state.orderInfo.productName }}</text>
- </view>
- <view style="border-bottom: 1px solid #dcdcdc" />
-
- <!-- 订单信息 -->
- <view class="order-box">
- <view class="order-item" v-for="(item, index) in state.list" :key="index">
- <order-info-item :label="item.label" :value="item.value"></order-info-item>
- </view>
- </view>
- </view>
-
- <view class="hint">请核对实收货物与上述货物编号是否一致!</view>
- <view class="btn">
- <submit-button title="确认收货" @submit="$util.confirm('是否确认收到货?', confirmReceipt, '收货确认')"></submit-button>
- </view>
- </template>
-
- <script setup lang="ts">
- import orderInfoItem from "./components/order-info-item";
- import { reactive } from "vue";
- import { onLoad } from "@dcloudio/uni-app";
- import {requestNew } from "@/utils/network/request.js";
- import {confirm, getOrderStatusName } from "@/utils/utils";
- import {orderReceiveGoods,orderDetailQuery } from "@/utils/network/api";
- import { getItem, StorageKeys } from "@/utils/storage";
-
- const state = reactive({
- //订单信息
- orderInfo: {} as any,
- //显示订单信息
- list: [
- {
- label: "订单编号:",
- value: "",
- },
- {
- label: "订单车牌:",
- value: "",
- },
- {
- label: "订单状态:",
- value: "",
- },
- {
- label: "发货卡号:",
- value: "",
- },
- {
- label: "发货签号:",
- value: "",
- },
- ],
- });
-
- //确认收货
- const confirmReceipt = (e) => {
- const options = {
- type: 2,
- data: {
- opId: getItem(StorageKeys.OpenId),
- orderId:state.orderInfo.orderNo
- },
- method: "POST",
- showLoading: true,
- };
- requestNew(orderReceiveGoods, options).then((res) => {
- confirm(
- "您已完成订单收货",
- () => {
- uni.$emit("refreshOrder");
- uni.navigateBack();
- },
- "收货完成",
- false
- );
- });
- }
- // onUnload(() => {
- // //移除监听
- // uni.$off('bluetoothLink')
- // })
- //确认收货
- const confirmReceiptClick = (e) => {
- navTo("/pages/bluetooth/bluetooth?routeType=5&id=" + state.orderInfo.id); //去连接蓝牙
- };
-
- //获取订单详情
- const getOrderDetails = (id) => {
- const options = {
- type: 2,
- data: { id: id },
- method: "POST",
- showLoading: true,
- };
- requestNew(orderDetailQuery, options).then((res) => {
- console.log("获取订单详情",res)
- state.orderInfo =res.data;
-
- state.list[0].value = state.orderInfo.orderNo;
- state.list[1].value = state.orderInfo.vehiclePlate;
- state.list[2].value = getOrderStatusName(state.orderInfo.orderStep);
- state.list[3].value = state.orderInfo.cardId ? state.orderInfo.cardId : "";
- state.list[4].value = state.orderInfo.obuId ? state.orderInfo.obuId : "";
- });
- };
-
- onLoad((options) => {
- getOrderDetails(options.id);
- });
- </script>
-
- <style>
- page {
- background-color: #eef7f7;
- }
- </style>
- <style lang="scss" scoped>
- .card-box {
- background-color: white;
- border-radius: 20rpx;
- box-shadow: 0px 0px 6rpx 2rpx rgba(223, 223, 223, 0.3);
- margin: 30rpx;
- padding: 20rpx 0;
-
- .title {
- padding: 0 20rpx 20rpx;
- }
-
- .icon {
- width: 48rpx;
- height: 48rpx;
- margin-right: 10rpx;
- }
-
- .txt-title {
- font-size: 30rpx;
- color: #333333;
- }
-
- .order-box {
- padding: 0px 24rpx 10rpx;
-
- .order-item {
- padding: 28rpx 0px 0px;
- }
- }
- }
-
- .hint {
- font-size: 28rpx;
- color: #ff8000;
- margin-top: 60rpx;
- text-align: center;
- }
-
- .btn {
- margin: 500rpx 40rpx 50rpx;
- }
- </style>
|