Authored by biao

update for pagination

... ... @@ -14,6 +14,8 @@ const returnsAPI = require('./returns-api');
const helpers = global.yoho.helpers;
const pageSize = 10;
const getUserReturn = (uid, page) => {
return api.get('', {
... ... @@ -33,6 +35,14 @@ const getUserReturn = (uid, page) => {
const data = camelCase(result.data);
const paginationOpts = data.total > pageSize ? {
paginationOpts: {
total: data.total,
page: data.page,
limit: pageSize
}
} : false;
data.list.forEach(item => {
item.orderGoods = item.goods;
item.createTime = item.orderCreateTime;
... ... @@ -46,7 +56,7 @@ const getUserReturn = (uid, page) => {
});
return {
returnsList: Object.assign(data, basicData)
returnsList: Object.assign(data, paginationOpts, basicData)
};
});
};
... ...
... ... @@ -25,6 +25,9 @@
</div>
</div>
{{/list}}
{{#if paginationOpts}}
{{{ pagination paginationOpts }}}
{{/if}}
{{/ returnsList}}
</div>
</div>
... ...
... ... @@ -15,20 +15,20 @@
}
.goods-container {
&.no-price {
.good-info {
border-right: none;
}
.for-return {
display: block;
}
}
.good-info {
.detail {
width: 408px;
}
}
.no-price {
.good-info {
border-right: none;
}
.for-return {
display: block;
.good-info {
.detail {
width: 408px;
}
}
}
... ... @@ -43,4 +43,8 @@
}
}
}
.blk-pagination {
text-align: center;
}
}
... ...