Authored by 郭成尧

Merge branch 'feature/brand' of git.yoho.cn:fe/yohoblk-wap into feature/brand

... ... @@ -128,19 +128,18 @@ const order = {
// 订单-物流
logistic: (req, res) => {
let orderCode = req.query.order_code || '';
res.render('order-logistic', {
module: 'home',
page: 'order-logistic',
orderCode: orderCode
title: '物流详情'
});
},
// API- 订单-物流
getOrderLogisticdate: (req, res) => {
orderModel.getOrderLogisticdate({
uid: req.user.uid,
uid: req.user.uid || '',
type: req.query.type || '',
order_code: req.query.orderCode
}).then(result => {
res.json(result);
... ...
... ... @@ -95,16 +95,22 @@ exports.deleteOrder = (orderCode, uid) => {
* 查看订单物流详情
* @param {[int]} order_code 订单号
* @param {[int]} uid 用户uid
* @param {[string]} type 退换货物流(退货:refund,换货:change)
* @return {[array]}
*/
exports.getOrderLogisticdate = (params) => {
let method;
if (_.isEmpty(params) || _.isEmpty(params.uid)) {
if (_.isEmpty(params.order_code)) {
return [];
}
// getNewExpress:退换货物流,li:订单物流
method = _.indexOf(['refund', 'change'], params.type) >= 0 ?
'app.express.getNewExpress' : 'app.express.li';
return api.get('', Object.assign({
method: 'app.express.li'
method: method
}, params)).then(result => {
if (result.code === 200) {
... ...
... ... @@ -2,7 +2,9 @@
<div class="logistic-page yoho-page">
<div class="overview">
<div class="left" >
<a href="{{logisticDate.url}}"><img class="icon" src="{{logisticDate.logo}}" /></a>
<a href="{{logisticDate.url}}">
<img class="icon" v-bind:src="logo" />
</a>
</div>
<div class="right">
<div>
... ... @@ -156,19 +158,22 @@ $border_color_light: #eee;
<script>
const $ = require('yoho-jquery');
const qs = require('yoho-qs');
const tip = require('common/tip');
module.exports = {
props: [],
data() {
return {
logisticDate: []
logisticDate: [],
logo: ''
};
},
methods: {
getLogisticDate() {
let data = {
orderCode: '1609827614'
orderCode: qs.order_code || '',
type: qs.type || '',
};
$.ajax({
... ... @@ -176,6 +181,9 @@ $border_color_light: #eee;
data: data
}).then(result => {
this.logisticDate = result;
if (result && result.logo) {
this.logo = result.logo;
}
}).fail(() => {
tip('网络错误');
});
... ...