Authored by biao

update for return

... ... @@ -7,6 +7,25 @@
// const returns = require('../models/returns');
const mcHandler = require('../models/menu-crumb-handler');
const returnModel = require('../models/returns');
const index = (req, res, next) => {
const uid = global.yoho.uid || '8050560';
const page = req.query.page;
returnModel.getUserReturn(uid, page).then(result => {
res.display('index', {
page: 'order',
isMe: true,
content: Object.assign({
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: 'http://placehold.it/{width}x{height}'
}, result)
});
}).catch(next);
};
const detail = (req, res, next) => {
next();
... ... @@ -37,6 +56,7 @@ const exchange = (req, res, next) => {
};
module.exports = {
index,
detail,
refund,
exchange
... ...
'use strict';
const api = global.yoho.API;
const camelCase = global.yoho.camelCase;
const moment = require('moment');
const getUserReturn = (uid, page) => {
return api.get('', {
method: 'app.refund.getList',
uid: uid,
page: page || 1,
limit: 10
}).then(result => {
const basicData = {
title: '我的退/换货'
};
const refundStr = {
1: '退货',
2: '换货'
};
const data = camelCase(result.data);
data.list.forEach(item => {
item.orderGoods = item.goods;
item.createTime = item.orderCreateTime;
item.hidePrice = true;
item.showStatus = true;
item.refundStr = refundStr[item.refundType];
item.orderGoods.forEach(it => {
it.hidePrice = true;
});
});
return {
returns: Object.assign(data, basicData)
};
});
};
module.exports = {
getUserReturn
};
... ...
... ... @@ -27,7 +27,7 @@ router.get('/getExpressInfo', order.getExpressInfo);
router.get('/editOrder', order.editOrder);
// 退换货
// router.get('/return', return.index);
router.get('/return', returns.index);
router.get('/return/refund/:orderCode', returns.refund);
router.get('/return/exchange/:orderCode', returns.exchange);
router.get('/return/:returnId', returns.detail);
... ...
<div class="goods-container special-border">
<div class="goods-container special-border {{#if hidePrice}}no-price{{/if}}">
{{#orderGoods}}
<div class="good-info {{#if @last}}last{{/if}}">
<img src="{{image goodsImage 65 90}}">
... ... @@ -9,12 +9,13 @@
<span class="bold">{{sizeName}}</span>
</span>
<p class="bold buy-number">{{> icon/error-round}}{{buyNumber}}</p>
</div>
</div>
{{#unless hidePrice}}
<div class="sub-column right-border bold">
<p class="{{#if @last}}last{{/if}}">¥{{goodsPrice}}</p>
</div>
{{/unless}}
<div class="sub-column right-border special-column bold">
<p class="bold">{{buyNumber}}</p>
</div>
... ...
<ul class="header">
<li class="content">下单时间:{{createTime}}</li>
<li class="content">订单编号:{{orderCode}}</li>
{{#if showMobile}}
<li class="content">手机订单</li>
{{/if}}
</ul>
... ...
... ... @@ -2,13 +2,7 @@
{{#if orderList}}
{{#orderList}}
<div class="order" data-code="{{orderCode}}">
<ul class="header">
<li class="content">下单时间:{{createTime}}</li>
<li class="content">订单编号:{{orderCode}}</li>
{{#if showMobile}}
<li class="content">手机订单</li>
{{/if}}
</ul>
{{> order/order-header}}
<div class="table-body">
{{> order/goods-box}}
<div class="common-column special-border">
... ...
<div class="return-wrap">
<div class="return-wrap user-order">
<div class="order">
{{# returns}}
{{> common/subtitle}}
<div class="table">
<ul class="header">
<li class="info">商品信息</li>
<li class="st">状态</li>
<li class="op">操作</li>
</ul>
</div>
{{#list}}
<div class="table">
{{> order/order-header}}
<div class="table-body">
{{> order/goods-box}}
<div class="common-column special-border">
<p class="refund-status">{{statusName}}</p>
<p class="subtext badge refund-type">{{refundStr}}</p>
</div>
<div class="common-column special-border operation">
<p class="subtext">取消申请</p>
<p class="subtext">查看详情</p>
</div>
</div>
</div>
{{/list}}
{{/ returns}}
</div>
\ No newline at end of file
</div>
</div>
... ...
... ... @@ -103,4 +103,5 @@
@import "address";
@import "order/index";
@import "return/index";
@import "currency";
... ...
... ... @@ -9,20 +9,6 @@
border-bottom: 1px solid $liBorderColor;
z-index: 0;
.badge {
min-width: 16px;
line-height: 16px;
display: inline-block;
padding: 0 5px;
position: absolute;
top: 0;
right: 14px;
background-color: $skyBlue;
color: #fff;
border-radius: 9px;
font-size: 12px;
}
.tabs {
display: inline-block;
height: $liHeight;
... ...
... ... @@ -14,6 +14,20 @@
margin: $space 0;
}
.badge {
min-width: 16px;
line-height: 16px;
display: inline-block;
padding: 0 5px;
position: absolute;
top: 0;
right: 14px;
background-color: $skyBlue;
color: #fff;
border-radius: 9px;
font-size: 12px;
}
.header {
height: $headerHeight;
line-height: $headerHeight;
... ...
@import "list"
... ...
.return-wrap {
.table {
width: 100%;
.header {
.info {
width: 496px;
text-align: left;
}
.st,
.op {
width: 206px;
}
}
.goods-container {
&.no-price {
.good-info {
border-right: none;
}
.good-info {
.detail {
width: 408px;
}
}
}
.for-return {
display: block;
}
}
.common-column {
width: 208px;
.refund-status {
margin-bottom: 10px;
}
.refund-type {
position: static;
}
}
}
}
... ...