Authored by zhangxiaoru

exchange

... ... @@ -108,58 +108,37 @@ const getProductInfo = (req, res, next) => {
}).catch(next);
};
const detailExchange = (req, res) => {
// const uid = global.yoho.uid || '8050560';
// const page = req.query.page;
res.display('index', {
page: 'exchange-detail',
isMe: true,
content: {
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: 'http://placehold.it/{width}x{height}',
exchange: {
// audit: true,
// through: false,
// send: true,
finish: true,
way: '上门送货',
goods: [
{
img: '',
name: 'fdefwfwefwrefverfref',
color: '',
size: '',
num: '',
reason: '',
exchangeColor: '蓝色',
exchangeSize: 'M'
},
{
img: '',
name: 'fdefwfwefwrefverfref',
color: '',
size: '',
num: '',
reason: '',
exchangeColor: '蓝色',
exchangeSize: 'M'
}
],
reasonInfo: [
{
problem: '太小了',
img: ''
},
{
problem: '太小了',
img: ''
}
]
const exchangeDeatail = (req, res) => {
let id = 125946;
let uid = 8050560;
returns.getExchangeDetailData(id, uid).then(result => {
res.display('index', {
page: 'exchange-detail',
isMe: true,
content: {
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: 'http://placehold.it/{width}x{height}',
exchange: {
finish: true,
way: '上门送货',
goodsList: [
{
goodsImage: '',
productName: 'fdefwfwefwrefverfref',
colorName: '',
sizeName: '',
num: '',
reasonName: '',
newColorName: '蓝色',
newSizeName: 'M',
}
]
}
}
}
});
});
};
... ... @@ -171,5 +150,5 @@ module.exports = {
exchange,
getProductInfo,
refundDetail,
detailExchange
exchangeDeatail
};
... ...
/**
/**
* 商品基本信息
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/7/19
... ... @@ -58,12 +58,21 @@ const getProductInfoAsync = (productId, productSkn) => {
});
};
const getExchangeDetail = (id, uid) => {
return api.get('', {
method: 'app.change.detail',
id: id,
uid: uid
});
};
module.exports = {
getOrderInfoAsync,
getRefundGoodsAsync,
getChangeGoodsListAsync,
getProductInfoAsync,
getRefundDetailAsync,
refundSubmitAsync
refundSubmitAsync,
getExchangeDetail
};
... ...
... ... @@ -11,6 +11,7 @@ const camelCase = global.yoho.camelCase;
const _ = require('lodash');
const mcHandler = require('./menu-crumb-handler');
const returnsAPI = require('./returns-api');
const logger = global.yoho.logger;
const helpers = global.yoho.helpers;
... ... @@ -213,6 +214,32 @@ const _setRefundDetailData = (data) => {
return resData;
};
const _setExchangeDetailData = (data) => {
let list = {};
switch (data.status) {
case 0:
list.audit = true;
break;
case 10:
list.through = true;
break;
case 50:
list.send = true;
list.auditSuccess = true;
break;
case 40:
resData.finish = true;
list.auditSuccess = true;
break;
default:
resData.audit = true;
break;
}
return list;
};
const getRefundGoodsData = (orderCode, uid) => {
return returnsAPI.getRefundGoodsAsync(orderCode, uid).then(result => {
let resData = {};
... ... @@ -248,7 +275,7 @@ const getRefundDetailData = (applyId, uid) => {
if (result.data) {
// console.log(_setRefundDetailData(result.data));
Object.assign(resData.refundDetail, _setReturnStatus(result.data.statusList));
Object.assign(resData.refundDetail, _setReturnStatus(result.data.statusList));//头部
Object.assign(resData.refundDetail, _setRefundDetailData(result.data));
}
... ... @@ -319,11 +346,38 @@ const getChangeGoodsList = (orderCode, uid) => {
});
};
const getExchangeDetailData = (id, uid) => {
return returnsAPI.getExchangeDetail(id, uid).then(result => {
let exchangeData = {};
Object.assign(exchangeData, _setSideMenu('我的退/换货'));
exchangeData = {
title: '换货申请',
exchangeDetail: {}
};
if (result.data) {
// console.log(_setRefundDetailData(result.data));
Object.assign(exchangeData.exchangeDetail, _setReturnStatus(result.data.statusList));//头部
Object.assign(exchangeData.exchangeDetail, _setExchangeDetailData(result.data));
// Object.assign(exchangeData.exchangeDetail, camelCase(result.data));
}
console.log(exchangeData)
return {returns: exchangeData};
});
};
module.exports = {
getUserReturn,
getRefundGoodsData,
getChangeGoodsList,
getProductInfo,
getRefundDetailData,
saveRefund
saveRefund,
getExchangeDetailData
};
... ...
... ... @@ -30,8 +30,8 @@ router.get('/editOrder', order.editOrder);
router.get('/return', returns.index);
router.get('/return/refund/:orderCode', returns.refund);
router.get('/return/exchange/:orderCode', returns.exchange);
router.get('/return/refund/detail/:applyId', returns.refundDetail);
router.get('/return/exchange/detail', returns.detailExchange);
router.get('/return/refund/detail/:id', returns.refundDetail);
router.get('/return/exchange/detail/:applyId', returns.exchangeDeatail);
router.get('/return/:returnId', returns.detail);
router.post('/return/refund/apply', returns.refundApply);
router.get('/return/getProductInfo', returns.getProductInfo);
... ...
{{# exchange}}
{{> returns/returns-status}}
<div class="exchange-detail-page">
{{#if audit}}
<p class="state"><span class="iconfont">&#xe618;</span>换货申请审核中</p>
... ... @@ -21,7 +23,7 @@
{{#if finish}}
<p class="contact">如有疑问,请联系<span class="iconfont">&#xe61c;</span>在线客服</p>
{{else}}
<p class="way-title">您已选择{{way}}</p>
<p class="way-title">您已选择{{deliveryTpyeName}}</p>
<p>请将商品连同吊牌、包装、发货单(如无发货单,您可找张白纸上注明订单编号,收货人姓名及手机号码)、发票(如有)、赠品(如有)一并保存,
如有遗漏将影响您的退换货进度,敬请谅解
</p>
... ... @@ -31,7 +33,7 @@
<p class="cancel">如果您不想换货了,您可以<span class="cancel-btn">取消申请</span></p>
{{/if}}
{{#if finish}}
{{#if auditSuccess}}
<div class="order">
<span class="check">查看</span>
<span class="exchange-order">换货订单</span>
... ... @@ -42,10 +44,10 @@
<div class="adress">
<p class="adress-title">收货地址<span class="modify-btn">修改</span></p>
<div class="adress-detail">
<p>所在区域:江苏省 南京市 雨花台区</p>
<p>收 货 人:赵四</p>
<p>详细地址:西善桥北路 109 号</p>
<p>联系电话:17714194699</p>
<p>所在区域:{{city}}{{county}}</p>
<p>收 货 人:{{consigneeName}}</p>
<p>详细地址:{{aderss}}</p>
<p>联系电话:{{mobile}}</p>
</div>
</div>
... ... @@ -61,34 +63,32 @@
</div>
<div class="table">
{{# goods}}
{{# goodsList}}
<div class="table-body">
<div class="goods-info">
<img class="lazy" data-original="{{image img 70 90}}">
<img class="lazy" data-original="{{image goodsImage 70 90}}">
<div class="info">
<p class="good-name">{{name}}</p>
<p>颜色:{{color}}&nbsp;尺码:{{size}}</p>
<p class="good-name">{{productName}}</p>
<p>颜色:{{colorName}}&nbsp;尺码:{{sizeName}}</p>
<p>×{{num}}</p>
</div>
</div>
<div class="common-column special-border">
<p class="reason">{{reason}}发错货</p>
<p class="reason">{{reasonName}}</p>
</div>
<div class="common-column special-border operation">
<p class="subtext">color: {{exchangeColor}}<br>size: {{exchangeSize}}</p>
<p class="subtext">color: {{newColorName}}蓝色 <br>size: {{newSizeName}}</p>
</div>
</div>
{{/ goods}}
{{# reasonInfo}}
<div class="reason-info">
<span>问题描述:{{problem}}</span>
<span>问题描述:{{reasonName}}</span>
<div class="reason-img">照片凭证:
<div class="evidence">
<img src="{{image img 70 90}}">
</div>
</div>
</div>
{{/ reasonInfo}}
{{/ goodsList}}
</div>
</div>
</div>
... ...
... ... @@ -6,6 +6,6 @@
{{> refund-detail}}
{{> exchange}}
{{> exchange-detail}}
{{/ returns}}
</div>
... ...
... ... @@ -208,6 +208,7 @@
}
.reason-info {
font-size: 14px;
overflow: hidden;
padding: 25px 0 30px 20px;
width: 100%;
... ...