orderDetail.js 2.52 KB
/**
 * 个人中心 controller
 * @author: chengyao.guo<chengyao.guo@yoho.cn>
 * @date: 2016/08/10
 */

'use strict';

const headerModel = require('../../../doraemon/models/header'); // 头部model
const orderDetailModel = require('../models/orderDetail');

exports.orderDetail = (req, res, next) => {
    let params = {
        uid: req.user.uid || 6228593
    };

    let headerData = headerModel.setNav({
        navTitle: '订单详情'
    });

    orderDetailModel.orderDetail(params).then(result => {
        if (result) {
            res.render('orderDetail', Object.assign(result, {
                isLogin: params.uid ? true : false,
                module: 'home',
                page: 'index',
                title: 'Yoho!Buy 有货',
                pageHeader: headerData,
                pageFooter: true,
                orderDetail: [
                    {
                        'orderNum': '1111',
                        'pay_expire': '2016-07-28 17:26:28',
                        'user_confirm_paid': 'N',
                        'payment_type_str': '在线支付',
                        'use_limit_code': 'Y',
                        'is_cancel': 'N',
                        'uid': '20000266',
                        'update_time': '0',
                        'name': '张三',
                        'phoneNum': '15999999999',
                        'isVirtual': false,
                        'mobile': '15999999999',
                        'orderNum': '1606688700',
                        'address': '测试地址测试地址测试地址测试地址',
                        'orderStatus': '已取消',
                        'orderTime': '2016-08-17 11:24:28',
                        'logisticsUrl': '#',
                        'logisticsCompany': '顺丰',
                        'logisticsNum': '111111',
                        'yohoCoin': '999',
                        'invoice': {
                            'title': '有货',
                            'contentValue': '有货',
                            'pdfUrl': '#'
                        },
                        'qrcode': '#',
                        'orderBalance': [{
                            'promotion': '商品总金额',
                            'account': '100.00'
                        }, {
                            'promotion': '运费',
                            'account': '10.00'
                        }],
                        'price': '999.99'
                    }
                ]
            }));
        }
    }).catch(next);

};