|
@@ -1,31 +1,33 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="card">
|
|
<view class="card">
|
|
|
<view class="card-header">
|
|
<view class="card-header">
|
|
|
- <text class="waybill-number">运单号:JDVA401410370033</text>
|
|
|
|
|
|
|
+ <text class="waybill-number">运单号:{{ orderDetail.externalWaybillNo }}</text>
|
|
|
<image src="/static/img/copy.png" @click="copyWaybillNumber"></image>
|
|
<image src="/static/img/copy.png" @click="copyWaybillNumber"></image>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="content">
|
|
<view class="content">
|
|
|
<!-- 左侧寄件人信息 -->
|
|
<!-- 左侧寄件人信息 -->
|
|
|
<view class="sender-info">
|
|
<view class="sender-info">
|
|
|
- <view class="city-tag">洛阳市</view>
|
|
|
|
|
- <view class="name">下海龙</view>
|
|
|
|
|
|
|
+ <view class="city-tag">{{ orderDetail.senderCity }}</view>
|
|
|
|
|
+ <view class="name">{{ orderDetail.senderName }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="translate">
|
|
<view class="translate">
|
|
|
- <view class="status">待取件</view>
|
|
|
|
|
- <image src="/static/img/translte-1.png"></image>
|
|
|
|
|
|
|
+ <view class="status">{{ getStatusText(orderDetail.orderStatus) }}</view>
|
|
|
|
|
+
|
|
|
|
|
+ <image v-if="orderDetail.orderStatus == 5" src="/static/img/translte-1.png"></image>
|
|
|
|
|
+ <image v-else src="/static/img/translte-2.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 右侧收件人信息 -->
|
|
<!-- 右侧收件人信息 -->
|
|
|
<view class="receiver-info">
|
|
<view class="receiver-info">
|
|
|
- <view class="city-tag">北京市</view>
|
|
|
|
|
- <view class="name">周欣源</view>
|
|
|
|
|
|
|
+ <view class="city-tag">{{ orderDetail.receiverCity }}</view>
|
|
|
|
|
+ <view class="name">{{ orderDetail.receiverName }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 状态信息 -->
|
|
<!-- 状态信息 -->
|
|
|
- <view class="section-continer">
|
|
|
|
|
|
|
+ <view class="section-continer" v-if="false">
|
|
|
<view class="timeline">
|
|
<view class="timeline">
|
|
|
<view class="dot">
|
|
<view class="dot">
|
|
|
<view class="timeline-dot dot-active"></view>
|
|
<view class="timeline-dot dot-active"></view>
|
|
@@ -43,27 +45,32 @@
|
|
|
|
|
|
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
|
<view class="action-buttons">
|
|
<view class="action-buttons">
|
|
|
- <view class="action-btn" @click="showExpressTrack">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <view v-if="orderDetail.orderStatus > 1 && orderDetail.orderStatus != 6" class="action-btn" @click="showExpressTrack">
|
|
|
<text class="btn-text">物流轨迹</text>
|
|
<text class="btn-text">物流轨迹</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="action-btn" @click="showOrderInfo">
|
|
<view class="action-btn" @click="showOrderInfo">
|
|
|
<text class="btn-text">运单详情</text>
|
|
<text class="btn-text">运单详情</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="action-btn btn-cancel">
|
|
|
|
|
|
|
+ <view v-if="orderDetail.orderStatus == 1" @click="cancel" class="action-btn btn-cancel">
|
|
|
<text class="btn-text">运单取消</text>
|
|
<text class="btn-text">运单取消</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<!-- 物流轨迹弹框 -->
|
|
<!-- 物流轨迹弹框 -->
|
|
|
- <TrackPopup
|
|
|
|
|
- v-model:showPopup="showTrackPopup"
|
|
|
|
|
- :expressData="expressData"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <TrackPopup v-model:showPopup="showTrackPopup" :expressData="expressData" />
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
- import { ref, defineProps, defineEmits } from 'vue'
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ ref,
|
|
|
|
|
+ defineProps,
|
|
|
|
|
+ defineEmits
|
|
|
|
|
+ } from 'vue'
|
|
|
|
|
+ import {
|
|
|
|
|
+ cancelOrder
|
|
|
|
|
+ } from '@/api/order.js'
|
|
|
import TrackPopup from './TrackPopup.vue'
|
|
import TrackPopup from './TrackPopup.vue'
|
|
|
|
|
|
|
|
const emit = defineEmits(['success'])
|
|
const emit = defineEmits(['success'])
|
|
@@ -74,30 +81,10 @@
|
|
|
},
|
|
},
|
|
|
orderDetail: {
|
|
orderDetail: {
|
|
|
type: Object,
|
|
type: Object,
|
|
|
- default: () => ({
|
|
|
|
|
- goodsMainImage: null,
|
|
|
|
|
- goodsName: null,
|
|
|
|
|
- id: undefined,
|
|
|
|
|
- orderCreateTime: '',
|
|
|
|
|
- shopConfirmStatus: "",
|
|
|
|
|
- shopEvaluateStatus: '',
|
|
|
|
|
- shopDispatchVerifyStatus: "",
|
|
|
|
|
- shopGoodsId: undefined,
|
|
|
|
|
- shopOrderAmount: undefined,
|
|
|
|
|
- shopOrderId: "",
|
|
|
|
|
- shopOrderNum: 1,
|
|
|
|
|
- shopOrderStatus: "1",
|
|
|
|
|
- shopPrice: 102,
|
|
|
|
|
- shopRefundReviewStatus: null,
|
|
|
|
|
- shopServiceStatus: null,
|
|
|
|
|
- shopUserTime: null,
|
|
|
|
|
- userId: "1989219383070896130",
|
|
|
|
|
- userNickName: "bonjour",
|
|
|
|
|
- userPhone: "17639845061"
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ default: () => ({})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 控制弹框显示
|
|
// 控制弹框显示
|
|
|
const showTrackPopup = ref(false)
|
|
const showTrackPopup = ref(false)
|
|
|
const expressData = ref({
|
|
const expressData = ref({
|
|
@@ -105,24 +92,24 @@
|
|
|
number: 'JDVA401410370033',
|
|
number: 'JDVA401410370033',
|
|
|
status: '待取件'
|
|
status: '待取件'
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 显示物流轨迹弹框
|
|
// 显示物流轨迹弹框
|
|
|
const showExpressTrack = () => {
|
|
const showExpressTrack = () => {
|
|
|
// 这里可以调用API获取物流信息
|
|
// 这里可以调用API获取物流信息
|
|
|
// 暂时使用模拟数据
|
|
// 暂时使用模拟数据
|
|
|
showTrackPopup.value = true
|
|
showTrackPopup.value = true
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const showOrderInfo = () => {
|
|
const showOrderInfo = () => {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url:'/pages/order/order_detail'
|
|
|
|
|
|
|
+ url: `/pages/order/order_detail?waybillId=${props.orderDetail.waybillId}`
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 复制运单号
|
|
// 复制运单号
|
|
|
const copyWaybillNumber = () => {
|
|
const copyWaybillNumber = () => {
|
|
|
uni.setClipboardData({
|
|
uni.setClipboardData({
|
|
|
- data: 'JDVA401410370033',
|
|
|
|
|
|
|
+ data: props.orderDetail.externalWaybillNo,
|
|
|
success: () => {
|
|
success: () => {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '运单号已复制',
|
|
title: '运单号已复制',
|
|
@@ -131,6 +118,53 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ // 取消订单
|
|
|
|
|
+ const cancel = async () => {
|
|
|
|
|
+ let res = await cancelOrder({
|
|
|
|
|
+ waybillId: props.orderDetail.waybillId,
|
|
|
|
|
+ cancelReason: "取消",
|
|
|
|
|
+ externalWaybillNo: props.orderDetail.externalWaybillNo,
|
|
|
|
|
+ orderType: props.orderDetail.orderType,
|
|
|
|
|
+ productCode: props.orderDetail.productCode,
|
|
|
|
|
+
|
|
|
|
|
+ waybillNo: props.orderDetail.waybillNo,
|
|
|
|
|
+ })
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.msg,
|
|
|
|
|
+ icon: 'success'
|
|
|
|
|
+ })
|
|
|
|
|
+ emit('success')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取订单状态
|
|
|
|
|
+ const getStatusText = (orderStatus) => {
|
|
|
|
|
+ let txt = ''
|
|
|
|
|
+ switch (orderStatus) {
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ txt = '待揽件'
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ txt = '已揽件'
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ txt = '运输中'
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 4:
|
|
|
|
|
+ txt = '派送中'
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 5:
|
|
|
|
|
+ txt = '已签收'
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 6:
|
|
|
|
|
+ txt = '已取消'
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ return txt;
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
@@ -175,7 +209,8 @@
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- min-width: 0; /* 防止flex子元素溢出 */
|
|
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ /* 防止flex子元素溢出 */
|
|
|
|
|
|
|
|
.city-tag {
|
|
.city-tag {
|
|
|
max-width: 250rpx;
|
|
max-width: 250rpx;
|
|
@@ -238,7 +273,7 @@
|
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.timeline {
|
|
.timeline {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
@@ -246,7 +281,7 @@
|
|
|
width: 34rpx;
|
|
width: 34rpx;
|
|
|
margin-right: 20rpx;
|
|
margin-right: 20rpx;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.dot {
|
|
.dot {
|
|
|
width: 34rpx;
|
|
width: 34rpx;
|
|
|
height: 34rpx;
|
|
height: 34rpx;
|
|
@@ -257,33 +292,33 @@
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.timeline-dot {
|
|
.timeline-dot {
|
|
|
width: 18rpx;
|
|
width: 18rpx;
|
|
|
height: 18rpx;
|
|
height: 18rpx;
|
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
&.dot-active {
|
|
&.dot-active {
|
|
|
background-color: #1B64F0;
|
|
background-color: #1B64F0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.timeline-line {
|
|
.timeline-line {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
width: 4rpx;
|
|
width: 4rpx;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
margin-top: 10rpx;
|
|
margin-top: 10rpx;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
&.line-active {
|
|
&.line-active {
|
|
|
border-left: 4rpx dashed #1B64F0;
|
|
border-left: 4rpx dashed #1B64F0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.status-section {
|
|
.status-section {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
min-width: 0;
|
|
min-width: 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.status-badge {
|
|
.status-badge {
|
|
|
margin-bottom: 8rpx;
|
|
margin-bottom: 8rpx;
|
|
|
height: 48rpx;
|
|
height: 48rpx;
|
|
@@ -295,7 +330,7 @@
|
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.status-detail {
|
|
.status-detail {
|
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
@@ -306,7 +341,7 @@
|
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.status-time {
|
|
.status-time {
|
|
|
margin-top: 8rpx;
|
|
margin-top: 8rpx;
|
|
|
height: 40rpx;
|
|
height: 40rpx;
|
|
@@ -320,7 +355,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.action-buttons {
|
|
.action-buttons {
|
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -335,7 +370,7 @@
|
|
|
border-radius: 80rpx;
|
|
border-radius: 80rpx;
|
|
|
border: 2rpx solid #F1F3F8;
|
|
border: 2rpx solid #F1F3F8;
|
|
|
margin-left: 20rpx;
|
|
margin-left: 20rpx;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
&:first-child {
|
|
&:first-child {
|
|
|
margin-left: 0;
|
|
margin-left: 0;
|
|
|
}
|
|
}
|
|
@@ -359,7 +394,7 @@
|
|
|
color: #ff6b6b;
|
|
color: #ff6b6b;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/* 添加点击效果 */
|
|
/* 添加点击效果 */
|
|
|
&:active {
|
|
&:active {
|
|
|
opacity: 0.7;
|
|
opacity: 0.7;
|