Authored by Aiden Xu

分期订单

... ... @@ -255,11 +255,12 @@ const orderIndex = (req, res) => {
module: 'home',
page: 'installment.order',
title: '我的分期订单',
navBtn: false
navBtn: false,
isInstallmentPage: true
});
};
const orderList = (req, res) => {
const orderList = (req, res, next) => {
const params = {
uid: req.user.uid || 8041876, // TODO: fix me
type: req.query.type || 1,
... ... @@ -270,13 +271,14 @@ const orderList = (req, res) => {
installmentModel.getInstallmentOrders(params).then((result)=> {
res.render('installment/order-list', {
title: '我的分期订单',
orders: result.data.orderList,
layout: false
orders: result.data ? result.data.orderList : [],
layout: false,
isInstallmentPage: true
});
});
}).catch(next);
};
const orderDetail = (req, res) => {
const orderDetail = (req, res, next) => {
const params = {
uid: req.user.id || 8041876, // TODO: fix me
orderCode: req.params.id
... ... @@ -309,7 +311,7 @@ const orderDetail = (req, res) => {
}
}
});
});
}).catch(next);
};
// 还款详情
... ...
{{#each orders}}
<li>
<a href="/home/installment/order/{{orderCode}}">
{{#orderGoods}}
<div class="image-box">
<img src="{{image goodsImage 90 120}}" alt="{{productName}}">
</div>
<div class="title-box">
<div>{{productName}}</div>
<div class="date-box">{{../createTime}}</div>
</div>
{{/orderGoods}}
</a>
{{#if orders}}
{{#each orders}}
<li>
<a href="/home/installment/order/{{orderCode}}">
{{#orderGoods}}
<div class="image-box">
<img src="{{image goodsImage 90 120}}" alt="{{productName}}">
</div>
<div class="title-box">
<div class="product-name">{{productName}}</div>
<div class="date-box">{{../createTime}}</div>
</div>
{{/orderGoods}}
</a>
<div class="right-box">
<div class="amount">¥{{amount}}</div>
<div class="status">{{installStatus}}</div>
</div>
<div class="clearfix"></div>
</li>
{{/each}}
{{/if}}
<div class="right-box">
<div class="amount">¥{{amount}}</div>
<div class="status">{{installStatus}}</div>
</div>
<div class="clearfix"></div>
</li>
{{/each}}
... ...
<div class="installment-order-page">
<div class="repayment-list-page installment-order-page">
{{> resources/banner-top}}
<ul class="header-tab">
<li class="active">
... ... @@ -15,5 +15,10 @@
<div class="order-list-container">
<ul id="order-list" class="order-list">
</ul>
<div id="no-result" class="no-result" style="display: none;">
<i class="result-icon"></i>
<p class="txt">暂无分期订单记录</p>
<a href="/product/new" class="guang-btn">去逛逛</a>
</div>
</div>
</div>
... ...
... ... @@ -33,6 +33,14 @@ var loadOrderList = function(pageIndex, type) {
$(this).addClass('faded');
}
});
if ($('#order-list li').length === 0) {
$('#no-result').show();
$('#order-list').hide();
} else {
$('#order-list').show();
$('#no-result').hide();
}
});
}
};
... ...
... ... @@ -2,3 +2,31 @@
@import "starting-service";
@import "repayment-list";
@import "order";
.no-result {
.result-icon {
width: 153px;
height: 197px;
background: resolve("home/review-img-3.png") no-repeat;
background-size: contain;
margin: 198px auto 36px;
display: block;
}
.txt {
text-align: center;
color: #444;
}
.guang-btn {
width: 472px;
height: 88px;
background: #444;
color: #fff;
text-align: center;
line-height: 88px;
border-radius: 6px;
margin: 110px auto 0;
display: block;
}
}
... ...
... ... @@ -57,8 +57,14 @@
.title-box {
margin-left: 22px;
width: 240px;
overflow: hidden;
width: 320px;
.product-name {
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.date-box {
... ...
... ... @@ -124,34 +124,6 @@
}
}
.no-result {
.result-icon {
width: 153px;
height: 197px;
background: resolve("home/review-img-3.png") no-repeat;
background-size: contain;
margin: 198px auto 36px;
display: block;
}
.txt {
text-align: center;
color: #444;
}
.guang-btn {
width: 472px;
height: 88px;
background: #444;
color: #fff;
text-align: center;
line-height: 88px;
border-radius: 6px;
margin: 110px auto 0;
display: block;
}
}
.repay-now {
width: 100%;
background: #fff;
... ...