<template>
|
<view>
|
<view class='logistics'>
|
<block v-if="orderInfoList&&orderInfoList.length>0">
|
<view class='header acea-row row-between row-top' v-for="orderItem,orderIndex in orderInfoList"
|
:key="orderIndex">
|
<view class='pictrue'>
|
<image :src='orderItem.productImg'></image>
|
</view>
|
<view class='text'>
|
<view class="nameBox acea-row row-between">
|
<view class='name '>{{orderItem.productName}}</view>
|
<view class='buyNum'>x{{orderItem.payNum}}</view>
|
</view>
|
<view class="attrName">{{orderItem.sku}}</view>
|
<view class='money' style="margin-top: 10rpx;font-weight: bold;"><text class="color-orange" v-if="orderItem.payWay!==3&&toNumber(orderItem.price)>0">¥{{toNumber(orderItem.price)}}</text><text class="color-green" v-if="toNumber(orderItem.price)>0&&toNumber(orderItem.payCareBean)>0&&payWay!==3">+</text>
|
<text class="color-green" v-if="toNumber(orderItem.payCareBean)>0">{{toNumber(orderItem.payCareBean)}}悦养豆</text></view>
|
</view>
|
</view>
|
</block>
|
|
<!-- <view class='logisticsCon' v-if="orderInfoList&&orderInfoList.length>0">
|
<view style="margin-bottom:0;" class='company acea-row row-between-wrapper'
|
v-for="orderItem,orderIndex in orderInfoList" :key="orderIndex">
|
<view class='picTxt acea-row row-between-wrapper'>
|
<view class='text' style="width: 100%;">
|
<view><text class='name line1'>商品信息:</text> {{orderItem.productName}}</view>
|
</view>
|
</view>
|
</view>
|
</view> -->
|
|
<view class='logisticsCon' v-if="expressInfo&&expressInfo.deliveryId">
|
<view class='company'>
|
<view class='picTxt'>
|
<view class='iconfont icon-wuliu'></view>
|
<view class='text'>
|
<view><text class='name line1'>物流公司:</text> {{expressInfo.deliveryName}}</view>
|
<view class="acea-row row-between-wrapper">
|
<view class='express line1'><text class='name'>快递单号:</text> {{expressInfo.deliveryId}}
|
</view>
|
<view class='copy' @tap='copyOrderId'>复制单号</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class='item' v-for="(item,index) in expressList" :key="index">
|
<view class='circular' :class='index === 0 ? "on":""'></view>
|
<view class='text' :class='index===0 ? "on-font on":""'>
|
<view>{{item.status}}</view>
|
<view class='data' :class='index===0 ? "on-font on":""'>{{item.time}}</view>
|
</view>
|
</view>
|
</view>
|
<recommend :pageName="'精品推荐'" :hostProduct='hostProduct' v-if="hostProduct.length"></recommend>
|
</view>
|
<!-- #ifdef MP -->
|
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
<!-- #endif -->
|
</view>
|
</template>
|
|
<script>
|
import {
|
express,
|
expressInfo
|
} from '@/api/order.js';
|
import {
|
getProductHot
|
} from '@/api/store.js';
|
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
import {
|
toLogin
|
} from '@/libs/login.js';
|
import {
|
mapGetters
|
} from "vuex";
|
import recommend from '@/components/recommend';
|
export default {
|
components: {
|
recommend,
|
},
|
data() {
|
return {
|
orderId: '',
|
expressNumber: '',
|
expressId:'',
|
dataId:'',
|
isMulti: false,
|
expressInfo: {},
|
product: {
|
productInfo: {}
|
},
|
orderInfo: {},
|
orderInfoList: [],
|
expressList: [],
|
hostProduct: [],
|
loading: false,
|
goodScroll: true,
|
params: { //精品推荐分页
|
page: 1,
|
limit: 10,
|
},
|
};
|
},
|
computed: mapGetters(['isLogin']),
|
watch: {},
|
onLoad: function(options) {
|
console.log(options);
|
if (!options.orderId) return this.$util.Tips({
|
title: '缺少订单号'
|
});
|
this.dataId=options.dataId;
|
this.orderId = options.orderId;
|
this.expressNumber = options.expressNumber;
|
this.expressId=options.expressId;
|
this.isMulti = options.isMulti ? options.isMulti : false;
|
if (this.$store.getters.isLogin) {
|
this.getExpress();
|
this.get_host_product();
|
} else {
|
toLogin(this);
|
}
|
},
|
onReady: function() {
|
// #ifdef H5
|
this.$nextTick(function() {
|
const clipboard = new ClipboardJS(".copy-data");
|
clipboard.on("success", () => {
|
this.$util.Tips({
|
title: '复制成功'
|
});
|
});
|
});
|
// #endif
|
},
|
methods: {
|
/**
|
* 授权回调
|
*/
|
onLoadFun: function() {
|
this.getExpress();
|
this.get_host_product();
|
},
|
copyOrderId: function() {
|
uni.setClipboardData({
|
data: this.expressInfo.deliveryId
|
});
|
},
|
getExpress: function() {
|
let that = this;
|
express(that.orderId).then(function(res) {
|
if (!that.isMulti) {
|
that.$set(that.expressInfo, 'deliveryId', res.data.order.deliveryId);
|
that.$set(that.expressInfo, 'deliveryName', res.data.order.deliveryName);
|
that.$set(that, 'orderInfoList', res.data.order.info);
|
that.$set(that, 'expressList', res.data.express.list || []);
|
}
|
});
|
if (that.isMulti) {
|
expressInfo(that.dataId,that.expressNumber,that.expressId).then(function(res) {
|
that.$set(that.expressInfo, 'deliveryId', that.expressNumber);
|
that.$set(that.expressInfo, 'deliveryName', res.data.order.deliveryName);
|
that.$set(that, 'orderInfoList', res.data.order.info);
|
that.$set(that, 'expressList', res.data.express.list || []);
|
})
|
}
|
|
},
|
get_host_product: function() {
|
this.loading = true
|
if (!this.goodScroll) return
|
let that = this;
|
getProductHot(that.params.page, that.params.limit).then(function(res) {
|
//this.iSshowH = false
|
that.loading = false
|
that.goodScroll = res.data.list.length >= that.params.limit
|
that.params.page++
|
that.hostProduct = that.hostProduct.concat(res.data.list)
|
});
|
},
|
},
|
// 滚动到底部
|
onReachBottom() {
|
|
if (this.params.page != 1) {
|
this.get_host_product();
|
}
|
},
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.logistics .header {
|
padding: 23rpx 30rpx;
|
background-color: #fff;
|
height: 166rpx;
|
box-sizing: border-box;
|
}
|
|
.logistics .header .pictrue {
|
width: 120rpx;
|
height: 120rpx;
|
}
|
|
.logistics .header .pictrue image {
|
width: 100%;
|
height: 100%;
|
border-radius: 6rpx;
|
}
|
|
.logistics .header .text {
|
width: 540rpx;
|
font-size: 28rpx;
|
color: #999;
|
margin-top: 6rpx;
|
}
|
|
.logistics .header .text .name {
|
width: 471rpx;
|
color: #282828;
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
}
|
|
.logistics .header .text .buyNum {
|
font-size: 26rpx;
|
text-align: right;
|
}
|
.logistics .header .text .attrName{
|
font-size: 20rpx;
|
}
|
.logistics .header .text .price{
|
font-size: 26rpx;
|
}
|
.logistics .orderCon,
|
.logistics .logisticsCon {
|
background-color: #fff;
|
margin: 12rpx 0;
|
}
|
|
.logistics .logisticsCon .company {
|
margin: 0 0 45rpx 30rpx;
|
padding:30rpx 30rpx 30rpx 0;
|
border-bottom: 1rpx solid #f5f5f5;
|
}
|
|
.logistics .logisticsCon .company .picTxt {
|
width: 100%;
|
position: relative;
|
}
|
|
.logistics .logisticsCon .company .picTxt .iconfont {
|
width: 50rpx;
|
height: 50rpx;
|
background-color: #666;
|
text-align: center;
|
line-height: 50rpx;
|
color: #fff;
|
font-size: 35rpx;
|
position: absolute;
|
left: 0;
|
top: 50%;
|
margin-top: -25rpx;
|
}
|
|
.logistics .logisticsCon .company .picTxt .text {
|
padding-left: 60rpx;
|
font-size: 26rpx;
|
color: #282828;
|
}
|
|
.logistics .logisticsCon .company .picTxt .text .name {
|
color: #999;
|
}
|
|
.logistics .logisticsCon .company .picTxt .text .express {
|
margin-top: 5rpx;
|
}
|
|
.logistics .logisticsCon .company .copy {
|
font-size: 20rpx;
|
width: 106rpx;
|
height: 40rpx;
|
text-align: center;
|
line-height: 40rpx;
|
border-radius: 20rpx;
|
border: 1rpx solid #999;
|
}
|
|
.logistics .logisticsCon .item {
|
padding: 0 40rpx;
|
position: relative;
|
}
|
|
.logistics .logisticsCon .item .circular {
|
width: 20rpx;
|
height: 20rpx;
|
border-radius: 50%;
|
position: absolute;
|
top: -1rpx;
|
left: 31.5rpx;
|
background-color: #ddd;
|
}
|
|
.logistics .logisticsCon .item .circular.on {
|
background-color: $theme-color;
|
}
|
|
.logistics .logisticsCon .item .text.on-font {
|
color: $theme-color;
|
}
|
|
.logistics .logisticsCon .item .text .data.on-font {
|
color: $theme-color;
|
}
|
|
.logistics .logisticsCon .item .text {
|
font-size: 26rpx;
|
color: #666;
|
width: 615rpx;
|
border-left: 1rpx solid #e6e6e6;
|
padding: 0 0 60rpx 38rpx;
|
}
|
|
.logistics .logisticsCon .item .text.on {
|
border-left-color: #f8c1bd;
|
}
|
|
.logistics .logisticsCon .item .text .data {
|
font-size: 24rpx;
|
color: #999;
|
margin-top: 10rpx;
|
}
|
|
.logistics .logisticsCon .item .text .data .time {
|
margin-left: 15rpx;
|
}
|
</style>
|