You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news3/LogisticsDetails.vue

241 lines
4.6 KiB

9 months ago
<template>
9 months ago
<view class="bg_style">
<view class="bgImg">
9 months ago
<view style="width:100%;position:sticky;">
<view class="navBarContent">
<u-icon name="arrow-left" @click="onBack"
9 months ago
style="position: absolute;top:50%;left:16px;transform: translateY(-50%);" color="#000"
9 months ago
size="35"></u-icon>
<text>物流信息</text>
</view>
</view>
<view class="logis-box">
<image src="/static/default-logo.png" alt=""></image>
<view class="logis-pany">
<view class="logis-text">
<text>物流公司</text>{{logisticsItem.express_name}}
</view>
<view class="logis-text">
<text>物流单号</text>{{logisticsItem.express_no}}<text
style="color: #FF6565; font-size:15px;margin-left: 20px;" @click="copy">复制</text>
</view>
</view>
</view>
</view>
<!-- 物流轨迹 -->
<view class="logis-detail" v-if="logisticsItem">
9 months ago
<view class="logis-item" :class="{ first: index === 0 }" v-for="(item, index) in logisticsItem.items"
:key="index">
9 months ago
<view class="logis-item-content">
<view class="logis-item-content__describe">
<text class="f-26">{{ item.context }}</text>
</view>
<view class="logis-item-content__time">
<text class="f-22">{{ item.time }}</text>
</view>
</view>
</view>
</view>
<view class="empty" v-else>
<image :src="$picUrl+'/static/news1/walletEmpty.png'" mode="widthFix"></image>
<text>暂无物流信息</text>
</view>
9 months ago
</view>
</template>
<script>
import * as newFunApi from '@/api/newFun'
export default {
data() {
return {
traces: [],
9 months ago
logisticsItem: ''
9 months ago
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(o) {
this.onCheck(o.logisticsNum)
},
methods: {
onBack() {
uni.navigateBack({
delta: 1 // 表示返回到上一页(默认为1)
});
},
copy(value) {
uni.setClipboardData({
data: this.logisticsItem.express_no, // 这里是个坑接受字符串类型 value转化为字符串
success: function() {
//调用方法成功
uni.showToast({
title: '复制成功',
icon: 'none',
duration: 2000
})
}
})
},
/**
* 查快递
*/
onCheck(logisticsNum) {
newFunApi.expressSearch({
expressNo: logisticsNum
})
.then(res => {
if (res.status) {
this.logisticsItem = res.data
} else {
uni.showToast({
title: '查询失败',
icon: 'none',
duration: 2000
})
}
})
.finally()
}
}
}
</script>
<style scoped lang="scss">
page {
background-color: #F7F8FA;
min-height: 100%;
padding-bottom: 40upx;
}
9 months ago
.bg_style {
width: 100%;
background: url(https://www.royaum.com.cn/static/news/login-bg.png) center 0 no-repeat;
background-size: 100% auto;
min-height: 100vh;
}
9 months ago
.all-details {
width: 100%;
font-size: 14px;
text-align: center;
}
.navBarContent {
9 months ago
height: 140upx;
line-height: 140upx;
9 months ago
text-align: center;
position: relative;
text {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #000;
}
}
.bgImg {
width: 100%;
9 months ago
height: 160px;
9 months ago
position: relative;
}
// 物流轨迹
.logis-box {
width: 100%;
height: 80px;
// background-color: #FFF;
display: flex;
align-items: center;
padding: 30px;
image {
width: 60px;
height: 60px;
border-radius: 50%;
}
.logis-text {
margin: 10px 0;
}
.logis-pany {
overflow: hidden;
margin-left: 15px;
color: #000;
font-size: 14px;
text {
color: #999;
}
}
}
.logis-detail {
padding: 30rpx 50rpx;
background: #fff;
.logis-item {
position: relative;
padding: 10px 0 10px 25px;
box-sizing: border-box;
border-left: 2px solid #ccc;
&.first {
border-left: 2px solid #FF5050;
&:after {
background: #FF5050;
color: #FF5050;
}
.logis-item-content {
// background: #ff6e39;
color: #FF5050;
&:after {
border-bottom-color: #FF5050;
}
}
}
&:after {
content: ' ';
display: inline-block;
position: absolute;
9 months ago
left: -7px;
top: 0px;
width: 8px;
height: 8px;
9 months ago
border-radius: 10px;
background: #bdbdbd;
border: 2px solid #fff;
}
.logis-item-content {
position: relative;
// background: #f9f9f9;
padding: 10rpx 20rpx;
box-sizing: border-box;
color: #999;
}
}
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 400rpx;
background-color: #fff;
image {
width: 114rpx;
height: auto;
margin-top: 90 0rpx;
}
}
9 months ago
</style>