Authored by 陈轩

Merge remote-tracking branch 'origin/release/5.1' into release/5.1

... ... @@ -2,7 +2,6 @@
const api = global.yoho.API;
const helpers = global.yoho.helpers;
const camelCase = global.yoho.camelCase;
const _ = require('lodash');
/**
... ... @@ -126,6 +125,13 @@ const _getOrderStatus = (order, showLogistics) => {
// 支付方式为非货到付款时,计算订单状态。
if (parseInt(order.payment_type, 10) !== 2) {
switch (order.status) {
case -1:
/* 预售商品,不能进行任何操作 */
Object.assign(result, {
isAdvance: true
});
break;
case 0:
/* 待付款 */
... ... @@ -321,7 +327,7 @@ const getOrders = (params) => {
});
}
return camelCase(finalResult);
return finalResult;
});
};
... ...
... ... @@ -16,43 +16,46 @@
{{!-- 对应订单状态的操作逻辑 --}}
{{!-- 完成和取消订单显示删除按钮 --}}
{{#unless unpaid}}
<div class="order-opt">
{{#unless unreceived}}
<span class="btn del">删除订单</span>
{{#if isVirtual}}
<!--虚拟商品-->
{{else}}
<span class="btn rebuy">再次购买</span>
{{/if}}
{{/unless}}
{{#unless isAdvance}}
{{#unless unpaid}}
<div class="order-opt">
{{#unless unreceived}}
<span class="btn del">删除订单</span>
{{#if isVirtual}}
<!--虚拟商品-->
{{else}}
<span class="btn rebuy">再次购买</span>
{{/if}}
{{/unless}}
{{#if qrcode}}
<a class="locHref" href="{{qrcode}}">
<span class="btn check-logistics">查看二维码</span>
</a>
{{/if}}
</div>
{{#if qrcode}}
<a class="locHref" href="{{qrcode}}">
<span class="btn check-logistics">查看二维码</span>
</a>
{{/if}}
</div>
{{/unless}}
{{/unless}}
{{#unless isAdvance}}
{{#if unpaid}}
<div class="order-opt">
<ul class="count-down hide">
<li>
<span class="iconfont count-down-icon">&#xe64a;</span>
</li>
<li>
<span class="hours">{{leftTime}}</span>
</li>
</ul>
<span class="btn cancel">取消订单</span>
{{#if payUrl}}
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
</a>
{{/if}}
</div>
{{/if}}
{{/unless}}
{{#if unpaid}}
<div class="order-opt">
<ul class="count-down hide">
<li>
<span class="iconfont count-down-icon">&#xe64a;</span>
</li>
<li>
<span class="hours">{{leftTime}}</span>
</li>
</ul>
<span class="btn cancel">取消订单</span>
{{#if payUrl}}
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
</a>
{{/if}}
</div>
{{/if}}
{{!-- 包含未发货和已发货状态,未发货不传logisticsUrl --}}
{{#if unreceived}}
... ...