This commit is contained in:
whitechiina 2026-05-07 09:08:02 +08:00
parent 6d178a2502
commit 3dc8986586
22 changed files with 41 additions and 34 deletions

View File

@ -1512,13 +1512,17 @@ async function fetchPointsConvertList(pagination, requestOptions, interval) {
); );
} }
async function fetchPointsConvertHistoryListData(month, requestOptions) { async function fetchPointsConvertHistoryListData(
month,
pagination,
requestOptions,
) {
return fetchPayload( return fetchPayload(
createRequestOptions({ createRequestOptions({
url: serviceConfig.ENDPOINTS.pointsConvertHistoryList, url: serviceConfig.ENDPOINTS.pointsConvertHistoryList,
data: { data: buildPagingRequestData({
month: month, month: month,
}, }, pagination),
}, requestOptions), }, requestOptions),
"积分兑换列表加载失败", "积分兑换列表加载失败",
); );
@ -1621,10 +1625,24 @@ export async function fetchCouponRedeemLinkData(requestOptions) {
}; };
} }
export async function fetchPointsConvertHome(month, requestOptions) { export async function fetchPointsConvertHome(
month,
paginationOrRequestOptions,
requestOptions,
) {
const params = resolvePagingArguments(
paginationOrRequestOptions,
requestOptions,
);
const pagination = params.pagination;
const mergedRequestOptions = params.requestOptions;
const result = await Promise.all([ const result = await Promise.all([
fetchHomeBalanceData(requestOptions), fetchHomeBalanceData(mergedRequestOptions),
fetchPointsConvertHistoryListData(month, requestOptions), fetchPointsConvertHistoryListData(
month,
pagination,
mergedRequestOptions,
),
]); ]);
const balances = normalizeBalances(result[0]); const balances = normalizeBalances(result[0]);
const records = buildPointsHistoryRecords(result[1]).map(function (item) { const records = buildPointsHistoryRecords(result[1]).map(function (item) {
@ -1637,6 +1655,7 @@ export async function fetchPointsConvertHome(month, requestOptions) {
return { return {
availablePoints: formatHomeNumber(balances.points, 0), availablePoints: formatHomeNumber(balances.points, 0),
records: records, records: records,
pagination: buildPaginationMeta(result[1], pagination),
}; };
} }

View File

@ -40,7 +40,8 @@
"path": "pages/assets/points-convert", "path": "pages/assets/points-convert",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"backgroundColor": "#191E32" "backgroundColor": "#191E32",
"enablePullDownRefresh": true
} }
}, },
{ {

View File

@ -154,6 +154,12 @@ export default {
this.hasShown = true; this.hasShown = true;
}, },
onPullDownRefresh() {
this.resetPagingState();
this.loadPage(false, 1, {
isPullRefresh: true,
});
},
onReachBottom() { onReachBottom() {
this.loadMore(); this.loadMore();
}, },
@ -241,9 +247,12 @@ export default {
this.resetPagingState(); this.resetPagingState();
this.loadPage(true, 1); this.loadPage(true, 1);
}, },
async loadPage(showLoading, targetPage) { async loadPage(showLoading, targetPage, extraOptions) {
const page = Number(targetPage || 1); const page = Number(targetPage || 1);
const isLoadMore = page > 1; const isLoadMore = page > 1;
const options =
extraOptions && typeof extraOptions === "object" ? extraOptions : {};
const isPullRefresh = Boolean(options.isPullRefresh);
if (isLoadMore && this.loadingMore) { if (isLoadMore && this.loadingMore) {
return; return;
@ -294,6 +303,10 @@ export default {
if (isLoadMore) { if (isLoadMore) {
this.loadingMore = false; this.loadingMore = false;
} }
if (isPullRefresh && typeof uni !== "undefined" && uni.stopPullDownRefresh) {
uni.stopPullDownRefresh();
}
} }
}, },
loadMore() { loadMore() {

View File

@ -1,2 +0,0 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>白马交易所</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/bmt/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/bmt/static/js/chunk-vendors.a58c62f3.js></script><script src=/bmt/static/js/index.ae648d7a.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB