订单详情查看物流

msb_beta
ch 3 years ago
parent 65bb0ea1e3
commit dcfe4376cf

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-29 17:38:17
* @LastEditors: ch
* @LastEditTime: 2022-04-18 11:04:14
* @LastEditTime: 2022-04-18 15:37:05
* @Description: file content
*/
import {ToAsyncAwait, MsbRequestTk} from '@/common/utils';
@ -41,6 +41,13 @@ export const ApiGetOrderDetail = (id) =>
*/
export const ApiGetOrderProductDetail = ({orderProductId}) =>
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/tradeOrder/product/${orderProductId}`));
/**
* 获取物流信息
* @param {*} orderProductId
*/
export const ApiGetOrderLogistics = ({orderId}) =>
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/tradeOrder/logistics/${orderId}`));
/**
* 提交订单
* @param {*} data

@ -154,6 +154,14 @@
"navigationBarBackgroundColor" : "#F8F8F8"
}
},
{
"path": "pages/order/logisitcsInfo",
"aliasPath" : "/logisitcsInfo",
"style": {
"navigationBarTitleText": "物流详情",
"navigationBarBackgroundColor" : "#F8F8F8"
}
},
{
"path": "pages/order/paySuccess",
"aliasPath" : "/paySuccess",

@ -2,14 +2,28 @@
* @Author: ch
* @Date: 2022-04-15 16:36:02
* @LastEditors: ch
* @LastEditTime: 2022-04-15 17:00:16
* @LastEditTime: 2022-04-18 16:31:12
* @Description: file content
-->
<template>
<UiWhiteBox>
<u-cell class="address" title="是的发生的" label="陈先生 190****2342"
:border="false" isLink @click="$Router.push('/addressList')">
<image class="address--icon" slot="icon" src="@/static/order/dw.png" />
<u-cell class="address" isLink v-if="lastLogisitcs" @click="$Router.push('/addressList')">
<view slot="title" class="address--title">{{lastLogisitcs.context}}</view>
<image class="address--icon" slot="icon" src="@/static/order/fj.png" />
<view slot="label" class="address--label">
<text>{{lastLogisitcs.time}}</text>
</view>
</u-cell>
<u-cell class="address" :border="false">
<view slot="title" :class="lastLogisitcs ? 'address--title__grey' :''">
{{logisitcsInfo.recipientAddress}}
</view>
<image class="address--icon" slot="icon" v-if="lastLogisitcs" src="@/static/order/dw2.png" />
<image class="address--icon" slot="icon" v-else src="@/static/order/dw.png" />
<view slot="label" class="address--label">
<text>{{logisitcsInfo.recipientName}}</text>
<text>{{logisitcsInfo.recipientPhone}}</text>
</view>
</u-cell>
</UiWhiteBox>
</template>
@ -22,15 +36,47 @@ export default {
type : Object,
defalut : () => ({})
}
},
computed : {
lastLogisitcs (){
const list = this.logisitcsInfo && this.logisitcsInfo.logisticsDataList
if(list && list.length > 0){
return list[0]
}else{
return null
}
}
}
}
</script>
<style lang="scss" scoped>
.address{
/deep/.u-cell__body__content{
padding: 10rpx 0;
.address--icon{
width: 28rpx;
height: 34rpx;
margin-right: 30rpx;
}
&--title{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 500rpx;
&__grey{
color: $color-grey4;
}
}
&--icon{
width: 28rpx;
height: 34rpx;
margin-right: 30rpx;
}
&--label{
margin-top: 26rpx;
text{
color: $color-grey4;
margin-right: 40rpx;
}
}
}
</style>

@ -2,15 +2,23 @@
* @Author: ch
* @Date: 2022-04-15 17:46:10
* @LastEditors: ch
* @LastEditTime: 2022-04-15 18:02:18
* @LastEditTime: 2022-04-18 16:16:26
* @Description: file content
-->
<template>
<view class="footer">
<UiButton>查看物流</UiButton>
<UiButton class="footer--btn" @click="cancelShow = true">取消订单</UiButton>
<UiButton class="footer--btn" type="gradual">去支付</UiButton>
<u-popup :show="cancelShow" @close="closeCancel" round="16rpx" closeable>
<!-- 支付过后都可查看物流 -->
<UiButton class="footer--btn" v-if="orderInfo.orderStatus >= 4" @click="$Router.push(`/logisitcsInfo?orderId=${orderInfo.orderId}`)"></UiButton>
<!-- 交易关闭可以联系客服 -->
<UiButton class="footer--btn" v-if="orderInfo.orderStatus === 2"></UiButton>
<!-- 已发货可以确认收货 -->
<UiButton class="footer--btn" v-if="orderInfo.orderStatus === 4" type="gradual"></UiButton>
<!-- 待支付可以取消支付订单 -->
<template v-if="orderInfo.orderStatus === 1">
<UiButton class="footer--btn" @click="cancelShow = true">取消订单</UiButton>
<UiButton class="footer--btn" type="gradual">去支付</UiButton>
</template>
<u-popup class="cancel" :show="cancelShow" @close="closeCancel" round="16rpx" closeable>
<view class="cancel--title">取消订单原因</view>
<radio-group class="cancel--cell" @change="cancelChange">
<UiCell title="我不想买了">
@ -42,6 +50,12 @@ import UiCell from '@/components/UiCell.vue'
import {ApiPutCancelOrder} from '@/common/api/order'
export default {
components: { UiButton, UiCell },
props : {
orderInfo : {
type : Object,
default : () => ({})
}
},
data(){
return {
//
@ -86,11 +100,12 @@ export default {
justify-content: flex-end;
align-items: center;
&--btn{
display: block;
display: inline-block;
margin: 0 0 0 30rpx;
}
}
.cancel{
flex: 0;
&--title{
text-align: center;
font-size: 34rpx;

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-04-15 16:04:28
* @LastEditors: ch
* @LastEditTime: 2022-04-15 16:16:36
* @LastEditTime: 2022-04-18 14:48:59
* @Description: file content
-->
<template>
@ -29,12 +29,16 @@
<UiWhiteBox class="cell-box">
<view class="cell">
<text class="cell--title">商品总额:</text>
<text class="cell--value">{{orderInfo.totalAmount}}</text>
<text class="cell--value">{{orderInfo.totalAmount}}</text>
</view>
<view class="cell">
<text class="cell--title">运费:</text>
<text class="cell--value">{{orderInfo.shippingAmount}}</text>
</view>
<view class="amount-box">
<text class="amount-label">实付款</text>
<text class="amount">{{orderInfo.payAmount}}</text>
</view>
</UiWhiteBox>
</view>
@ -69,4 +73,16 @@ export default {
font-size: $font-size-sm;
}
}
.amount-box{
text-align: right;
margin-top: 30rpx;
}
.amount-label{
font-size: $font-size-sm;
}
.amount{
color: $color-yellow4;
font-size: $font-size-lg;
}
</style>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-31 14:26:09
* @LastEditors: ch
* @LastEditTime: 2022-04-18 11:00:17
* @LastEditTime: 2022-04-18 16:16:44
* @Description: file content
-->
<template>
@ -12,7 +12,7 @@
<UiGoodsInfo :class="index === orderInfo.products.length - 1 && 'goods-info__last'"
v-for="(item, index) in orderInfo.products" :data="item" :key="index">
<template slot="operation">
<view class="goods-info-operation">
<view class="goods-info-operation" v-if="item.afterSaleApplyFlag || [3,4].includes(item.detailStatus)">
<UiButton size="min" type="primaryLine" v-if="item.afterSaleApplyFlag"
@click="$Router.push(`/saleAfterSelect?id=${item.orderProductId}`)">申请售后</UiButton>
<template v-else>
@ -27,7 +27,7 @@
</UiWhiteBox>
<LogisitcsInfo :logisitcsInfo="orderInfo.logistics" />
<OrderInfo :orderInfo="orderInfo" />
<Operation></Operation>
<Operation :orderInfo="orderInfo" v-if="orderInfo.orderStatus !== 3"></Operation>
</view>
</template>
<script>
@ -44,7 +44,8 @@ export default {
data(){
return {
orderInfo : {
products:[]
products:[],
logistics:{}
},
}
},

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 10:58:24
* @LastEditors: ch
* @LastEditTime: 2022-04-09 15:03:53
* @LastEditTime: 2022-04-18 16:33:42
* @Description: file content
-->
<template>
@ -21,7 +21,7 @@
<text class="orders--name">官方自营</text>
<text class="orders--status" :class="[1,3].includes(item.orderStatus) && 'orders--status__warn'">{{item.orderStatusDesc}}</text>
</view>
<view class="orders--item" v-for="i in item.products" :key="i.productId" @click="$Router.push(`/orderDetail?id=${item.orderId}`)">
<view class="orders--item" v-for="i in item.products" :key="i.orderProductId" @click="$Router.push(`/orderDetail?id=${item.orderId}`)">
<image class="orders--item-image" mode="widthFix" :src="i.productImageUrl" />
<view >
<view class="orders--item-con">
@ -42,8 +42,10 @@
</view>
<view class="orders--footer">
<button class="orders--footer-btn orders--footer-btn__red" v-if="item.orderStatus === 1"></button>
<button class="orders--footer-btn" v-if="item.orderStatus === 2"></button>
<button class="orders--footer-btn" v-if="[3,4,7].includes(item.orderStatus)"></button>
<button class="orders--footer-btn" v-if="item.orderStatus === 2"
@click="$Router.push(`/orderDetail?id=${item.orderId}`)">查看详情</button>
<button class="orders--footer-btn" v-if="item.orderStatus >= 4"
@click="$Router.push(`/logisitcsInfo?orderId=${item.orderId}`)">查看物流</button>
<button class="orders--footer-btn orders--footer-btn__red" v-if="item.orderStatus == 4"></button>
</view>
</view>

@ -0,0 +1,129 @@
<!--
* @Author: ch
* @Date: 2022-04-18 15:28:14
* @LastEditors: ch
* @LastEditTime: 2022-04-18 17:10:26
* @Description: file content
-->
<template>
<view>
<UiWhiteBox>
<UiGoodsInfo :class="idx === orderInfo.products.length-1 ? 'goods-info__last' : ''" :key="item.orderProductId"
v-for="(item, idx) in orderInfo.products" :data="item"></UiGoodsInfo>
</UiWhiteBox>
<UiWhiteBox class="company">
<text class="company--name">{{orderInfo.companyName}}</text>
<view class="company--no">{{orderInfo.trackingNo}}</view>
</UiWhiteBox>
<UiWhiteBox>
<view class="title">
<text>物流信息</text>
<text class="title--desc">本服务有快递100提供</text>
</view>
<view class="group">
<view class="item" :class="idx === orderInfo.logisticsDataList.length - 1 ? 'item__last' : ''"
v-for="(item, idx) in orderInfo.logisticsDataList" :key="idx">
<view class="item--time">{{item.time}}</view>
<view class="item--ctx">{{item.context}}</view>
</view>
</view>
</UiWhiteBox>
</view>
</template>
<script>
import UiGoodsInfo from '@/components/UiGoodsInfo.vue'
import UiWhiteBox from '@/components/UiWhiteBox.vue'
import {ApiGetOrderLogistics} from '@/common/api/order';
export default {
components: { UiWhiteBox, UiGoodsInfo },
data(){
return {
orderInfo : {}
}
},
mounted(){
this.getOrderProductInfo()
},
methods : {
async getOrderProductInfo(){
const {error, result} = await ApiGetOrderLogistics({
orderId : this.$Route.query.orderId
});
if(error){
uni.$u.toast(error.message);
return false;
}
this.orderInfo = result;
}
}
}
</script>
<style lang="scss" scoped>
page{
background: $color-grey1;
}
.company{
height: 100rpx;
padding: 0 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.title{
height: 98rpx;
line-height: 98rpx;
border-bottom: 2rpx solid $color-grey2;
padding: 0 30rpx;
color: $color-grey5;
display: flex;
justify-content: space-between;
&--desc{
color: $color-grey4
}
}
.group{
padding: 30rpx;
}
.item{
padding-bottom: 44rpx;
position: relative;
padding-left: 58rpx;
&::before{
display: block;
width: 10rpx;
height: 10rpx;
content: '';
border-radius: 50%;
border:6rpx solid $color-yellow3;
background: #fff;
position: absolute;
left: 0;
}
&::after{
display: block;
content: '';
height: calc(100% - 38rpx);
width: 1px;
left: 10rpx;
top: 28rpx;
border-left: 1px dashed $color-grey4;
position: absolute;
}
&__last::after{
display: none;
}
&--time{
font-size: $font-size-sm;
color: $color-grey4;
}
&--ctx{
line-height: 42rpx;
color: $color-grey5;
margin-top: 20rpx;
}
}
.goods-info__last{
border: 0;
}
</style>

@ -2,13 +2,12 @@
* @Author: ch
* @Date: 2022-04-14 16:50:37
* @LastEditors: ch
* @LastEditTime: 2022-04-15 11:33:42
* @LastEditTime: 2022-04-18 15:33:42
* @Description: file content
-->
<template>
<view>
<UiWhiteBox>
<!-- <ui-goods-info -->
<UiGoodsInfo class="goods-info" :data="orderInfo.orderProduct"></UiGoodsInfo>
</UiWhiteBox>
<UiWhiteBox>

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Loading…
Cancel
Save