refine: shorten pull action stages
This commit is contained in:
parent
39bf725200
commit
45ecb39359
|
|
@ -783,7 +783,8 @@ input:focus-visible {
|
||||||
.ledger-pull-space { display:flex; align-items:center; justify-content:center; gap:5px; flex:0 0 auto; color:#7d8c88; font-size:11px; opacity:var(--pull-progress); pointer-events:none; overflow:hidden; }
|
.ledger-pull-space { display:flex; align-items:center; justify-content:center; gap:5px; flex:0 0 auto; color:#7d8c88; font-size:11px; opacity:var(--pull-progress); pointer-events:none; overflow:hidden; }
|
||||||
.ledger-pull-space.top { margin:0 -16px; }
|
.ledger-pull-space.top { margin:0 -16px; }
|
||||||
.ledger-pull-space.bottom { margin:0 -16px; }
|
.ledger-pull-space.bottom { margin:0 -16px; }
|
||||||
.ledger-pull-space.refresh,.ledger-pull-space.previous { color:#087f72; }
|
.ledger-pull-space.refresh { color:#087f72; }
|
||||||
|
.ledger-pull-space.previous { color:#b05f22; }
|
||||||
.ledger-pull-space.next { color:#3478e5; }
|
.ledger-pull-space.next { color:#3478e5; }
|
||||||
.conversion-notice span { display:flex; align-items:center; gap:6px; }
|
.conversion-notice span { display:flex; align-items:center; gap:6px; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,20 +152,20 @@ onBeforeUnmount(() => loadMoreObserver?.disconnect());
|
||||||
const pullAction = computed(() => {
|
const pullAction = computed(() => {
|
||||||
if (pullEdge.value === "bottom") return pullDistance.value >= 72 ? "next" : null;
|
if (pullEdge.value === "bottom") return pullDistance.value >= 72 ? "next" : null;
|
||||||
if (pullEdge.value !== "top") return null;
|
if (pullEdge.value !== "top") return null;
|
||||||
if (pullDistance.value >= 112) return "previous";
|
if (pullDistance.value >= 88) return "previous";
|
||||||
if (pullDistance.value >= 52) return "refresh";
|
if (pullDistance.value >= 44) return "refresh";
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
const pullLabel = computed(() => {
|
const pullLabel = computed(() => {
|
||||||
if (pullAction.value === "previous") return "松开以加载上一月流水";
|
if (pullAction.value === "previous") return "加载上一月流水";
|
||||||
if (pullAction.value === "refresh") return "松开以刷新流水";
|
if (pullAction.value === "refresh") return "刷新流水";
|
||||||
if (pullEdge.value === "bottom") return "继续上拉加载下一月流水";
|
if (pullEdge.value === "bottom") return "继续上拉加载下一月流水";
|
||||||
return "继续下拉刷新流水";
|
return "继续下拉刷新流水";
|
||||||
});
|
});
|
||||||
|
|
||||||
const pullProgress = computed(() => {
|
const pullProgress = computed(() => {
|
||||||
const threshold = pullEdge.value === "bottom" ? 72 : pullDistance.value < 52 ? 52 : 112;
|
const threshold = pullEdge.value === "bottom" ? 72 : pullDistance.value < 44 ? 44 : 88;
|
||||||
return Math.min(1, pullDistance.value / threshold);
|
return Math.min(1, pullDistance.value / threshold);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -521,7 +521,8 @@ async function shareLedger() {
|
||||||
:style="{ height: `${pullDistance}px`, '--pull-progress': pullProgress }"
|
:style="{ height: `${pullDistance}px`, '--pull-progress': pullProgress }"
|
||||||
role="status"
|
role="status"
|
||||||
>
|
>
|
||||||
<RefreshCw :size="15" :class="{ spinning: pullLoading }" />
|
<RefreshCw v-if="pullAction !== 'previous'" :size="15" :class="{ spinning: pullLoading }" />
|
||||||
|
<ChevronDown v-else :size="15" />
|
||||||
<span>{{ pullLoading ? "正在加载" : pullLabel }}</span>
|
<span>{{ pullLoading ? "正在加载" : pullLabel }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue