Authored by 陈轩

fix

... ... @@ -5,8 +5,6 @@
'use strict';
const cookie = global.yoho.cookie;
const logger = global.yoho.logger;
const returnsModel = require('../models/returns');
/*
... ... @@ -23,6 +21,7 @@ exports.index = (req, res, next) => {
page: 'returns',
meReturnsPage: true
}, data);
res.render('returns/returns', viewData);
})
.catch(next);
... ...
... ... @@ -7,7 +7,6 @@
const path = require('path');
const Promise = require('bluebird');
const _ = require('lodash');
// 使用 product中的分页逻辑
const pagerPath = path.join(global.appRoot, '/apps/product/models/public-handler.js');
... ... @@ -29,7 +28,7 @@ const EXCHANGE_URI = '/home/returns/exchangeDetail';
function getGoodsData(goods) {
const arr = [];
goods.forEach(good=> {
goods.forEach(good => {
const obj = {};
const cnAlphabet = good.cn_alphabet || '';
... ... @@ -90,18 +89,22 @@ exports.getReturnsList = co(function*(uid, page, limit) {
switch (item.refund_type) {
case REFUND:
isChange = false;
uri = REFUND_URI;
if (canCancel) {
uri = REFUND_URI;
}
break;
case EXCHANGE:
isChange = true;
uri = EXCHANGE_URI;
if (canCancel) {
uri = EXCHANGE_URI;
}
break;
default:
}
t.isChange = isChange;
t.canCancelUrl = helpers.urlFormat(uri);
t.moreHref = helpers.urlFormat(uri, {id: item.id});
t.moreHref = helpers.urlFormat(uri, { id: item.id });
t.goods = getGoodsData(item.goods);
obj.orders.push(t);
... ...