Authored by htoooth

fix hbs

... ... @@ -212,11 +212,23 @@ exports.del = (uid, gender, channel, orderId) => {
/**
* 申请退款
*/
exports.refund = (orderId) => {
return api.get('', {
method: 'app.SpaceOrders.refundApply',
exports.refund = (uid, orderId, reasonId, reason) => {
let params = {
uid: uid,
order_code: orderId
});
};
if (reasonId) {
params.reason_id = reasonId;
}
if (reason) {
params.reason = reason;
}
return api.get('', Object.assign({
method: 'app.SpaceOrders.refundApply'
}, params));
};
/**
... ...
... ... @@ -105,6 +105,12 @@ const ORDER_OP_ALL = [
hrefFun: it => helpers.urlFormat('/home/orders/detail', {orderCode: it})
},
{
type: 'refund',
name: '申请退款',
refund: true,
hrefFun: () => 'javascript:void(0)'
},
{
type: 'deposit',
name: '定金预售商品只能在APP端操作',
deposit: true,
... ... @@ -764,6 +770,14 @@ const closeReason = () => {
});
};
const refundReason = () => {
return orderApi.refundReason().then((result) => {
return _.get(result, 'data', []);
});
};
const refund = orderApi.refund;
const detail = co(function * (uid, orderId) {
let apiData = yield Promise.props({
detailData: _getOrderDetail(uid, orderId),
... ... @@ -794,5 +808,7 @@ module.exports = {
detail,
getOrders,
closeReason,
express
express,
refund,
refundReason
};
... ...
<script id="cancel-dialog-tpl" type="text/html">
<header>取消订单</header>
<p class="tip">您取消订单的原因是:</p>
<ul class="cancel-reason clearfix">
{{# cancelReason}}
<li {{#if @last}}style="width:100%;"{{/if}}>
<input id="cancel-radio-{{id}}" type="radio" name="cancel-reason" value="{{id}}">
<label for="cancel-radio-{{id}}">{{reason}}</label>
{{#if @last}}<input type="text" id="reason_other" placeholder="50字以内" maxlength="50">{{/if}}
</li>
{{/ cancelReason}}
</ul>
<p class="tip reminder">温馨提示:</p>
<ul class="info-prompt">
<li><i>*</i>订单成功取消后无法恢复</li>
<li><i>*</i>该订单已付金额将原路返回</li>
<li><i>*</i>取消订单后,存在促销关系的子订单及优惠可能会一并取消</li>
</ul>
<p class="cancel-tip"></p>
</script>
... ...