279 lines
6.9 KiB
Vue
279 lines
6.9 KiB
Vue
<template>
|
|
<view class="">
|
|
<view class="header">
|
|
<!-- 顶部导航栏 -->
|
|
<z-nav-bar title="物流详情"></z-nav-bar>
|
|
</view>
|
|
<view v-if="deliverDetails.length > 0">
|
|
<!-- <u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
|
|
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs> -->
|
|
<view class="deliverCntent">
|
|
<view class="">
|
|
|
|
<view class="kuaidiItem">{{expressCompanyName}} {{expressOrderSn}}
|
|
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
|
|
<view v-for="(item, index) in deliverDetails" :class="['item',index == 0 ? 'first':'' ]">
|
|
<view class="flexbox">
|
|
<view class="img_icon "></view>
|
|
<view class="wuliu">
|
|
<view class="time">{{item.acceptTime}}</view>
|
|
<view class="content">{{item.acceptStation}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="quesheng" v-else>
|
|
<image src="../../static/icon/kongbai.png" ></image>
|
|
<text>- 暂无物流信息 -</text>
|
|
</view>
|
|
<music-play :playData="playData"></music-play>
|
|
<public-module></public-module>
|
|
<!-- <u-loading color="red" :show="loading"></u-loading> -->
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import musicPlay from '@/components/music.vue'
|
|
import $http from '@/config/requestConfig.js';
|
|
// import Loading from '../../'
|
|
import {
|
|
mapState
|
|
} from 'vuex';
|
|
import loginVue from '../user/login.vue';
|
|
export default {
|
|
data() {
|
|
return {
|
|
playData:{},
|
|
loading: false,
|
|
orderId: null,
|
|
deliverDetails: [{
|
|
Traces: []
|
|
}],
|
|
express:{}, // 面单
|
|
consignee:{}, // 收件人信息
|
|
expressOrderSn:'', // 运单号
|
|
expressCompanyCode:'', //快递编码
|
|
expressCompanyName:'' ,// 快递公司
|
|
orderSn : '',
|
|
current: 0,
|
|
deliverList: [],
|
|
deliverDetailsLength: null,
|
|
orderContet:{},
|
|
sheetList:[]
|
|
}
|
|
},
|
|
onLoad(e) {
|
|
this.expressOrderSn = e.expressOrderSn
|
|
this.expressCompanyCode = e.expressCompanyCode
|
|
this.expressCompanyName = e.expressCompanyName
|
|
//this.express = e.express
|
|
//this.consignee = e.consignee
|
|
console.log(e,'传入的参数')
|
|
this.orderSn = e.orderSn
|
|
},
|
|
onShow() {
|
|
this.getOrderList()
|
|
},
|
|
computed: {
|
|
...mapState(['userInfo']),
|
|
},
|
|
components:{
|
|
musicPlay
|
|
},
|
|
methods: {
|
|
|
|
// 获取订单列表
|
|
getOrderList() {
|
|
console.log('this.orderType',this.orderType)
|
|
this.$http
|
|
// .get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`)
|
|
.get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`)
|
|
.then(res => {
|
|
console.log('订单详情',res)
|
|
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
|
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
|
res.result.overTime = seconds - nowSeconds
|
|
|
|
this.orderContet = res.result
|
|
//this.userRecordid = res.userRecordid
|
|
this.productIDs = res.result.goodsList.map(item => {
|
|
return item.buyOrderProductId
|
|
})
|
|
// console.log(this.orderContet,'this.orderContet')
|
|
if (this.orderContet.orderStatus == 0) {
|
|
this.titleStat = '待支付'
|
|
} else if (this.orderContet.orderStatus == 1) {
|
|
this.titleStat = '待发货'
|
|
} else if (this.orderContet.orderStatus == 2) {
|
|
this.titleStat = '待收货'
|
|
} else if (this.orderContet.orderStatus == 3) {
|
|
this.titleStat = '已完成'
|
|
}
|
|
|
|
|
|
if(parseInt(this.orderContet.orderStatus) >= 2){
|
|
this.getdeliverDetails()
|
|
// 查询快递信息
|
|
// this.getSheetInfo()
|
|
}
|
|
console.log(this.orderContet,'订单详情')
|
|
})
|
|
},
|
|
// getSheetInfo(){
|
|
// console.log('查询快递信息')
|
|
// this.$http
|
|
// .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`)
|
|
// .then(res => {
|
|
// if(res.code == 0){
|
|
// this.sheetList = res.result.data
|
|
// console.log(res,'面单信息')
|
|
// this.getdeliverDetails()
|
|
// }
|
|
// }).catch(e => {
|
|
// console.log('e',e)
|
|
|
|
// })
|
|
// },
|
|
// 复制到剪切板
|
|
copyData(data){
|
|
uni.setClipboardData({
|
|
data,
|
|
success: function () {
|
|
console.log('success');
|
|
}
|
|
});
|
|
},
|
|
tabchange(item) {
|
|
console.log(item)
|
|
this.current = item.index
|
|
},
|
|
// 获取物流
|
|
getdeliverDetails() {
|
|
this.deliverList = []
|
|
var strLength = this.orderContet.consignee.consigneeMobile.length
|
|
var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
|
|
// this.expressOrderSn = 'SF1504651506851'
|
|
// this.expressCompanyCode = 'SF'
|
|
// subMobile = '9277'
|
|
uni.showLoading()
|
|
this.$http
|
|
//.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
|
|
.get(`/book/buyOrder/queryExpress?expressOrderSn=${this.expressOrderSn}&expressCompanyCode=${this.expressCompanyCode}&customerName=${subMobile}`)
|
|
.then(res => {
|
|
console.log(res, '物流信息')
|
|
if (res && res.code === 0) {
|
|
uni.hideLoading()
|
|
// this.deliverDetails = res.result.traces
|
|
console.log(res.result.traces,'物流信息')
|
|
// res.rntStr.forEach((item, index) => {
|
|
this.deliverDetails = res.result.traces.reverse()
|
|
// item.Traces = item.Traces.reverse()
|
|
// //console.log(item)
|
|
// this.deliverList.push({'name':item.ShipperName})
|
|
// })
|
|
}
|
|
}).catch(e => {
|
|
console.log(e,'e')
|
|
})
|
|
},
|
|
|
|
|
|
|
|
}
|
|
}
|
|
</script>
|
|
<style>
|
|
.item:first-child::before {
|
|
background-color: #6fca78 !important
|
|
}
|
|
</style>
|
|
<style lang="scss" scoped>
|
|
.quesheng{text-align: center; margin-top: 20px;
|
|
image{ width: 150rpx; height: 170rpx; display: block; margin: 10px auto;
|
|
}
|
|
text{
|
|
color: #888;
|
|
}
|
|
}
|
|
.copyCode{display: inline-block; margin-left: 20rpx; }
|
|
.u-tabs {
|
|
background: #fff
|
|
}
|
|
|
|
.xiangqing {
|
|
overflow: hidden;
|
|
|
|
img {
|
|
display: block;
|
|
max-width: 100%;
|
|
}
|
|
}
|
|
|
|
.kuaidiItem {
|
|
padding: 10px;
|
|
color: #666
|
|
}
|
|
|
|
.deliverCntent {
|
|
.img_icon {
|
|
border-left: 2px solid #eee;
|
|
}
|
|
line-height:20px;
|
|
padding: 32rpx;
|
|
position: relative;
|
|
background-color: #fff;
|
|
margin-bottom: 20rpx;
|
|
border-top: 1px solid #eee;
|
|
font-size: 28rpx;
|
|
color:#777;
|
|
.item {
|
|
padding-left: 10px;
|
|
position: relative;
|
|
}
|
|
.item:before {
|
|
display: inline-block;
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 100%;
|
|
background: #eee;
|
|
left: 6px;
|
|
top: 0;
|
|
content: "";
|
|
position: absolute;
|
|
}
|
|
|
|
.time {
|
|
color: #888;
|
|
font-size: 28rpx;
|
|
margin-bottom: 5px
|
|
}
|
|
.first{
|
|
color: #55aa7f;
|
|
}
|
|
.content {
|
|
padding-bottom: 14px;
|
|
}
|
|
}
|
|
.flexbox {
|
|
display: flex;
|
|
}
|
|
|
|
.img_icon {
|
|
padding-right: 30rpx;
|
|
}
|
|
|
|
.moreBtnF {
|
|
align-items: center;
|
|
padding: 30rpx;
|
|
height: 100%;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
z-index: 1;
|
|
background-color: rgba(255, 255, 255, .9);
|
|
}
|
|
</style>
|