Authored by lzhy

订单详情

import GoodsInfo from './goods-info';
export { GoodsInfo };
... ...
<template>
<div class="ivu-row">
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title" style="height: 35px">
当前订单状态:{{ orderStatus[orderInfo.orderStatus] }}
<template v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600">
<i-button size="large" type="success" style="margin-left: 50px;" @click="deliver(123)">发货</i-button>
</template>
</p>
</div>
<div class="ivu-card-body">
若订单一直未发货,买家会有投诉风险,建议您及时点击发货 查看未发货超时规则 <br />
若买家存在恶意购买行为,您可以联系平台处理
</div>
</div>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">订单信息</p>
</div>
<div class="ivu-card-body">
<Row>
<i-col span="24">订购人:{{ orderInfo.mobile }}({{ orderInfo.adminName }})</i-col>
</Row>
<br />
<Row>
<i-col span="4">订单号:{{ orderInfo.orderCode }}</i-col>
<i-col span="4">下单时间:{{ orderInfo.createTime | timeFormat }}</i-col>
<i-col span="4">发货时间:{{ orderInfo.arriveTime | timeFormat }}</i-col>
</Row>
<br />
<Row>
<i-col span="4">订单状态:{{ orderStatus[orderInfo.orderStatus] }}</i-col>
<i-col span="4">提交时间:{{ orderInfo.checkTime | timeFormat }}</i-col>
<i-col span="4">成交时间:</i-col>
</Row>
</div>
</div>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">物流信息</p>
</div>
<div class="ivu-card-body">
<Row>
<i-col span="4">收货人:{{ orderInfo.consigneeName }}</i-col>
<i-col span="4">手机号:{{ orderInfo.mobile }} </i-col>
</Row>
<Row>
<i-col span="24">
送货地址:{{ orderInfo.province }} {{ orderInfo.city }} {{ orderInfo.district }}
{{ orderInfo.street }}
</i-col>
</Row>
<Row>
<i-col span="24">详细地址:{{ orderInfo.address }}</i-col>
</Row>
<Row>
<i-col span="24">邮政编码:{{ orderInfo.zipCode }}</i-col>
</Row>
<Row>
<i-col span="24">物流公司:{{ orderInfo.expressName }} </i-col>
</Row>
<Row>
<i-col span="24">运单号:{{ orderInfo.expressNumber }} </i-col>
</Row>
</div>
</div>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">商品信息</p>
</div>
<div class="ivu-card-body">
<goods-info
:table-data="tableData"
:coupons-data="couponsData"
:goods-promos="goodsPromos"
:order-info="orderInfo"
:order-promos="orderPromos"
>
</goods-info>
</div>
</div>
</div>
</template>
<script>
import { GoodsInfo } from './components';
import { OrderConfig } from '../configs';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
components: { GoodsInfo },
data() {
return {
orderCode: this.$route.query.orderCode,
orderStatus: OrderConfig.orderStatus,
feeSharingType: OrderConfig.feeSharingType,
orderInfo: [],
couponsData: [],
tableData: [],
goodsPromos: [],
orderPromos: [],
};
},
created() {
this.orderService = new OrderService();
this.getOrderInfo();
this.getOrderGoods();
this.getGoodsPromos();
this.getOrderCoupons();
this.getOrderPromos();
},
methods: {
deliver(code) {
this.$router.push({
name: 'order.deliver.step1',
params: {},
query: {
orderCode: code,
},
});
},
//获取订单详情
getOrderInfo() {
this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
this.orderInfo = _.get(ret, 'data', []);
});
},
//获取订单商品
getOrderGoods() {
this.orderService.queryOrderGoods({ orderCode: +this.orderCode }).then(ret => {
this.tableData = _.get(ret, 'data', []);
});
},
//获取订单商品促销信息
getGoodsPromos() {
this.orderService.queryOrderGoodsPromos({ orderCode: +this.orderCode }).then(ret => {
this.goodsPromos = _.get(ret, 'data', []);
});
},
//获取订单优惠券
getOrderCoupons() {
this.orderService.queryOrderCoupons({ orderCode: +this.orderCode }).then(ret => {
this.couponsData = _.get(ret, 'data', {});
_.each(this.couponsData, coupons => {
coupons['feeSharingTypeStr'] = this.feeSharingType[coupons.feeSharingType] || '无';
});
});
},
//获取订单促销信息
getOrderPromos() {
this.orderService.queryOrderPromos({ orderCode: +this.orderCode }).then(ret => {
this.orderPromos = _.get(ret, 'data', {});
});
},
},
};
</script>
<style lang="scss"></style>
... ...
export default {
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "order.detail" */ './detail'),
meta: {
pageName: '订单详情',
},
};
... ...
import OrderService from './order-service';
export { OrderService };
... ...
import Service from '../service';
const apiUrl = {
orderList: '/erp/orderList',
orderDetail: '/erp/orderDetail',
orderGoods: '/erp/queryOrderGoods',
orderGoodsPromos: '/erp/queryOrderGoodsPromos',
orderCoupons: '/erp/queryOrderCoupons',
orderPromos: '/erp/queryOrderPromos',
};
class OrderService extends Service {
/**
* 订单列表
* @param params
* @return {*}
*/
orderList(params) {
return this.post(apiUrl.orderList, params);
}
/**
* 订单详情
* @param params
* @return {*}
*/
orderDetail(params) {
return this.post(apiUrl.orderDetail, params);
}
/**
* 根据订单号获取订单商品
* @param params
*/
queryOrderGoods(params) {
return this.post(apiUrl.orderGoods, params);
}
/**
* 获取订单商品的促销
* @param params
*/
queryOrderGoodsPromos(params) {
return this.post(apiUrl.orderGoodsPromos, params);
}
/**
* 获取订单的优惠券信息
* @param parmas
* @return {*}
*/
queryOrderCoupons(parmas) {
return this.post(apiUrl.orderCoupons, parmas);
}
/**
* 获取订单促销
* @param parmas
*/
queryOrderPromos(params) {
return this.post(apiUrl.orderPromos, params);
}
}
export default OrderService;
... ...