Authored by 郝肖肖

订单物流接口

... ... @@ -128,13 +128,23 @@ const order = {
// 订单-物流
logistic: (req, res) => {
let orderCode = req.query.orderCode;
let orderCode = req.query.order_code || '';
res.render('order-logistic', {
module: 'home',
page: 'order-logistic',
orderCode: orderCode
});
},
// API- 订单-物流
getOrderLogisticdate: (req, res) => {
orderModel.getOrderLogisticdate({
uid: req.user.uid,
order_code: req.query.orderCode
}).then(result => {
res.json(result);
});
}
};
... ...
... ... @@ -7,8 +7,9 @@
const api = global.yoho.API;
//const serviceAPI = global.yoho.ServiceAPI;
// const serviceAPI = global.yoho.ServiceAPI;
const camelCase = global.yoho.camelCase;
const _ = require('lodash');
/**
* 获取订单列表数据
... ... @@ -89,3 +90,27 @@ exports.deleteOrder = (orderCode, uid) => {
return result;
});
};
/**
* 查看订单物流详情
* @param {[int]} order_code 订单号
* @param {[int]} uid 用户uid
* @return {[array]}
*/
exports.getOrderLogisticdate = (params) => {
if (_.isEmpty(params) || _.isEmpty(params.uid)) {
return [];
}
return api.get('', Object.assign({
method: 'app.express.li'
}, params)).then(result => {
if (result.code === 200) {
return result.data;
}
return [];
});
};
... ...
... ... @@ -48,6 +48,7 @@ router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄
router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们
router.get('/logistic', order.logistic); // 个人中心 - 订单物流详情
router.get('/logistic', order.logistic); // 个人中心 - 订单物流详情页面
router.get('/get-order-logistic-date', order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据
module.exports = router;
... ...
const Vue = require('yoho-vue');
const orderLogistic = require('home/refund/order-logistic.vue');
const orderLogistic = require('home/order-logistic.vue');
new Vue({
el: '#order-logistic',
... ...
... ... @@ -2,40 +2,39 @@
<div class="logistic-page yoho-page">
<div class="overview">
<div class="left" >
<a href="{{logisticUrl}}"><img class="icon" src="{{logisticImg}}" /></a>
<a href="{{logisticDate.url}}"><img class="icon" src="{{logisticDate.logo}}" /></a>
</div>
<div class="right">
<div>
<span class='info'>物流公司:</span>
<span >{{logisticCompany}}</span>
<span >{{logisticDate.caption}}</span>
</div>
<div>
<span class='info'>快递单号:</span>
<span>{{logisticNumber}}</span>
<span>{{logisticDate.express_number}}</span>
</div>
</div>
</div>
</div><!--end overview-->
<div class="title">
<span>物流详情</span>
</div>
<div class="detail">
{{# logisticDetail}}
<div class="timeline-box ">
<div class="timeline-box" v-for="(index, detail) in logisticDate.express_detail">
<span class="timeline-node"></span>
<div class="timeline-info">
<div class="timeline-info-row">
{{status}}
{{detail.accept_address}}
</div>
<div class="timeline-info-row">
{{date}}
{{detail.acceptTime}}
</div>
</div>
</div>
{{/ logisticDetail}}
</div>
</div>
</div><!--end detail-->
</div><!--end logistic-page-->
</template>
<style>
... ... @@ -156,7 +155,36 @@ $border_color_light: #eee;
<script>
const $ = require('yoho-jquery');
const tip = require('common/tip');
module.exports = {
props: [],
data() {
return {
logisticDate: []
};
},
methods: {
getLogisticDate() {
let data = {
orderCode: '1609827614'
};
$.ajax({
url: '/home/get-order-logistic-date',
data: data
}).then(result => {
this.logisticDate = result;
}).fail(() => {
tip('网络错误');
});
}
},
created() {
this.getLogisticDate();
}
};
</script>
... ...