Authored by htoooth

fix express

... ... @@ -17,7 +17,7 @@ router.get('/index/getProductInfo', cart.getProductInfo);
router.get('/coupon/list', cart.getCoupons); // 优惠券列表
router.get('/address/list', address.getList); // 用户的地址列表信息
router.get('/address/list', address.getList); // 省市区列表信息
router.get('/address/area', address.getArea); // 省市区列表信息
router.post('/address/delete', address.delAddress); // 删除地址
router.post('/address/save', address.saveAddress); // 新增地址/更新地址
... ...
... ... @@ -124,7 +124,21 @@ const detail = (req, res, next) => {
};
const express = (req, res, next) => {
let orderId = req.query.orderId || '';
let uid = req.user.uid;
let payType = req.query.payType;
let time = req.query.time;
if (!orderId) {
return res.json({
code: 400,
message: '参数出错'
});
}
ordersService.express(orderId, uid, payType, time).then((result) => {
return res.json(result);
}).catch(next);
};
module.exports = {
... ...
... ... @@ -333,6 +333,8 @@ const getOrders = (uid, page, limit, type, isPage)=> {
newOrder.orderNum = order.order_code; // 订单标识
newOrder.orderTime = moment.unix(_.get(order, 'create_time')).format('YYYY-MM-DD HH:mm:ss');
newOrder.time = _.get(order, 'create_time');
newOrder.payType = _.get(order, 'payment_type');
if (order.is_cancel === 'Y' || order.status === 6) {
newOrder.canDelete = true; // 删除订单
... ... @@ -353,7 +355,8 @@ const getOrders = (uid, page, limit, type, isPage)=> {
if (statusInfo.keyName === 'shipped') {
let expressInfo = yield _getExpressInfo(
order.order_code, uid,
order.payment_type, order.create_time
order.payment_type, order.create_time,
false
);
newOrder.logistics = expressInfo.logistics;
... ... @@ -405,7 +408,7 @@ const getOrders = (uid, page, limit, type, isPage)=> {
return newOrder;
});
result.list = yield Promise.map(orderInfo.order_list, handleOrder);
result.list = yield Promise.map(_.get(orderInfo, 'order_list', []), handleOrder);
if (isPage) {
result.pager = {
... ... @@ -789,6 +792,8 @@ const detail = co(function * (uid, orderId) {
};
});
const express = _.partial(_getExpressInfo, _, _, _, _, true);
module.exports = {
index,
ORDER_TYPE,
... ... @@ -799,5 +804,6 @@ module.exports = {
cancel,
detail,
getOrders,
closeReason
closeReason,
express
};
... ...
... ... @@ -284,6 +284,9 @@ router.post('/orders/cancelOrder', ordersController.cancel);
// 订单详情
router.get('/orders/detail', [getCommonHeader, getHomeNav], ordersController.detail);
// 物流信息
router.get('/orders/express', ordersController.express);
/********************************* 我的订单结束 *****************************************/
... ...
... ... @@ -14,7 +14,7 @@
{{/with}}
{{^}}
{{# orders.list}}
<div class="order" data-id="{{orderNum}}">
<div class="order" data-id="{{orderNum}}" data-time="{{time}}" data-paytype="{{payType}}">
<p class="order-title">
订单编号:{{orderNum}}
<span class="order-time">下单时间:{{orderTime}}</span>
... ...
... ... @@ -17,14 +17,14 @@ module.exports = {
cookieDomain: '.yohobuy.com',
domains: {
// test3
// singleApi: 'http://api-test3.yohops.com:9999/',
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
// prod
singleApi: 'http://single.yoho.cn/',
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
//singleApi: 'http://single.yoho.cn/',
//api: 'http://api.yoho.cn/',
//service: 'http://service.yoho.cn/',
// gray
// singleApi: 'http://single.gray.yohops.com/',
... ...