更新 .gitignore,添加 .claude/ 目录;新增 MY_REQUIREMENTS.md 文件,记录个人需求清单;优化小键盘组件,调整布局并添加删除按钮;修改路由配置,禁用某些页面的动画效果;全局样式中调整过渡时长。
This commit is contained in:
@@ -6,8 +6,11 @@
|
||||
<div class="margin-top padding-horizontal" v-if="hint">
|
||||
<span>{{ hint }}</span>
|
||||
</div>
|
||||
<div class="numpad-values" @click="onDisplayValueClick">
|
||||
<span id="numpad-value" class="numpad-value" :class="currentDisplayNumClass">{{ currentDisplay }}</span>
|
||||
<div class="numpad-values">
|
||||
<span id="numpad-value" class="numpad-value" :class="currentDisplayNumClass" @click="onDisplayValueClick">{{ currentDisplay }}</span>
|
||||
<f7-button class="numpad-backspace-button" @click="backspace" @taphold="clear()">
|
||||
<f7-icon class="icon-with-direction" f7="delete_left"></f7-icon>
|
||||
</f7-button>
|
||||
</div>
|
||||
|
||||
<f7-popover class="numpad-paste-popover" target-el="#numpad-value"
|
||||
@@ -54,20 +57,18 @@
|
||||
<f7-button class="numpad-button numpad-button-function no-right-border" @click="setSymbol('+')">
|
||||
<span class="numpad-button-text numpad-button-text-normal">+</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-num" @click="clear()">
|
||||
<span class="numpad-button-text numpad-button-text-normal">C</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-num" @click="inputNum(0)">
|
||||
<span class="numpad-button-text numpad-button-text-normal">{{ digits[0] }}</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-num" v-if="supportDecimalSeparator" @click="inputDecimalSeparator()">
|
||||
<span class="numpad-button-text numpad-button-text-normal">{{ decimalSeparator }}</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-num" v-if="!supportDecimalSeparator" @click="inputDoubleNum(0)">
|
||||
<span class="numpad-button-text numpad-button-text-normal">{{ `${digits[0]}${digits[0]}` }}</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-num" @click="inputNum(0)">
|
||||
<span class="numpad-button-text numpad-button-text-normal">{{ digits[0] }}</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-num" @click="backspace" @taphold="clear()">
|
||||
<span class="numpad-button-text numpad-button-text-normal">
|
||||
<f7-icon class="icon-with-direction" f7="delete_left"></f7-icon>
|
||||
</span>
|
||||
</f7-button>
|
||||
<f7-button class="numpad-button numpad-button-confirm no-right-border no-bottom-border" fill @click="confirm()">
|
||||
<span :class="{ 'numpad-button-text': true, 'numpad-button-text-confirm': !currentSymbol }">{{ confirmText }}</span>
|
||||
</f7-button>
|
||||
@@ -467,12 +468,15 @@ watch(() => props.flipNegative, (newValue) => {
|
||||
}
|
||||
|
||||
.numpad-values {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--f7-page-bg-color);
|
||||
}
|
||||
|
||||
.numpad-value {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex: 1;
|
||||
padding-inline-start: 16px;
|
||||
line-height: 1;
|
||||
height: var(--ebk-numpad-value-height);
|
||||
@@ -481,6 +485,22 @@ watch(() => props.flipNegative, (newValue) => {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.numpad-backspace-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20%;
|
||||
height: var(--ebk-numpad-value-height);
|
||||
font-size: 22px;
|
||||
color: var(--f7-color-black);
|
||||
flex-shrink: 0;
|
||||
border-left: 1px solid var(--f7-page-bg-color);
|
||||
}
|
||||
|
||||
.dark .numpad-backspace-button {
|
||||
color: var(--f7-color-white);
|
||||
}
|
||||
|
||||
.numpad-value-small {
|
||||
font-size: var(--ebk-numpad-value-small-font-size);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,8 @@ const routes: Router.RouteParameters[] = [
|
||||
{
|
||||
path: '/transaction/list',
|
||||
async: asyncResolve(TransactionListPage),
|
||||
beforeEnter: [checkLogin]
|
||||
beforeEnter: [checkLogin],
|
||||
options: { animate: false }
|
||||
},
|
||||
{
|
||||
path: '/transaction/filter/amount',
|
||||
@@ -184,7 +185,8 @@ const routes: Router.RouteParameters[] = [
|
||||
{
|
||||
path: '/account/list',
|
||||
async: asyncResolve(AccountListPage),
|
||||
beforeEnter: [checkLogin]
|
||||
beforeEnter: [checkLogin],
|
||||
options: { animate: false }
|
||||
},
|
||||
{
|
||||
path: '/account/add',
|
||||
@@ -209,7 +211,8 @@ const routes: Router.RouteParameters[] = [
|
||||
{
|
||||
path: '/statistic/transaction',
|
||||
async: asyncResolve(StatisticsTransactionPage),
|
||||
beforeEnter: [checkLogin]
|
||||
beforeEnter: [checkLogin],
|
||||
options: { animate: false }
|
||||
},
|
||||
{
|
||||
path: '/statistic/settings',
|
||||
@@ -259,7 +262,8 @@ const routes: Router.RouteParameters[] = [
|
||||
{
|
||||
path: '/settings',
|
||||
async: asyncResolve(SettingsPage),
|
||||
beforeEnter: [checkLogin]
|
||||
beforeEnter: [checkLogin],
|
||||
options: { animate: false }
|
||||
},
|
||||
{
|
||||
path: '/app_lock',
|
||||
|
||||
@@ -3,6 +3,15 @@ html, body {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
:root {
|
||||
--f7-page-transition-duration: 150ms;
|
||||
--f7-sheet-transition-duration: 150ms;
|
||||
--f7-actions-transition-duration: 150ms;
|
||||
--f7-popup-transition-duration: 150ms;
|
||||
--f7-dialog-transition-duration: 150ms;
|
||||
--f7-popover-transition-duration: 150ms;
|
||||
}
|
||||
|
||||
body {
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
|
||||
@@ -459,10 +459,12 @@
|
||||
<f7-actions-button @click="showTransactionPictures = true">{{ tt('Add Picture') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
<f7-actions-group v-if="pageTypeAndMode?.type === TransactionEditPageType.Transaction && mode === TransactionEditPageMode.View && transaction.type !== TransactionType.ModifyBalance">
|
||||
<f7-actions-button @click="navigateToEdit()">{{ tt('Edit') }}</f7-actions-button>
|
||||
<f7-actions-button @click="duplicate(false, false)">{{ tt('Duplicate') }}</f7-actions-button>
|
||||
<f7-actions-button @click="duplicate(true, false)">{{ tt('Duplicate (With Time)') }}</f7-actions-button>
|
||||
<f7-actions-button @click="duplicate(false, true)" v-if="transaction.geoLocation">{{ tt('Duplicate (With Geographic Location)') }}</f7-actions-button>
|
||||
<f7-actions-button @click="duplicate(true, true)" v-if="transaction.geoLocation">{{ tt('Duplicate (With Time and Geographic Location)') }}</f7-actions-button>
|
||||
<f7-actions-button color="red" @click="remove()">{{ tt('Delete') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
<f7-actions-group>
|
||||
<f7-actions-button bold close>{{ tt('Cancel') }}</f7-actions-button>
|
||||
@@ -640,6 +642,7 @@ const pictureInput = useTemplateRef<HTMLInputElement>('pictureInput');
|
||||
const isSupportClipboard = !!navigator.clipboard;
|
||||
|
||||
const loadingError = ref<unknown | null>(null);
|
||||
const isFirstEntry = ref<boolean>(true);
|
||||
const removingPictureId = ref<string | null>(null);
|
||||
const transactionDateTimeSheetMode = ref<string>('time');
|
||||
const showTimeInDefaultTimezone = ref<boolean>(false);
|
||||
@@ -1319,6 +1322,28 @@ function duplicate(withTime?: boolean, withGeoLocation?: boolean): void {
|
||||
props.f7router.navigate(`/transaction/add?id=${transaction.value.id}&type=${transaction.value.type}&withTime=${withTime ?? false}&withGeoLocation=${withGeoLocation ?? false}`);
|
||||
}
|
||||
|
||||
function navigateToEdit(): void {
|
||||
props.f7router.navigate(`/transaction/edit?id=${transaction.value.id}&type=${transaction.value.type}`);
|
||||
}
|
||||
|
||||
function remove(): void {
|
||||
showConfirm('Are you sure you want to delete this transaction?', () => {
|
||||
showLoading();
|
||||
transactionsStore.deleteTransaction({
|
||||
transaction: transaction.value,
|
||||
defaultCurrency: defaultCurrency.value
|
||||
}).then(() => {
|
||||
hideLoading();
|
||||
props.f7router.back();
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
if (!error.processed) {
|
||||
showToast(error.message || error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function onPageAfterIn(): void {
|
||||
routeBackOnError(props.f7router, loadingError);
|
||||
|
||||
@@ -1326,6 +1351,21 @@ function onPageAfterIn(): void {
|
||||
&& !geoLocationStatus.value && !transaction.value.geoLocation) {
|
||||
updateGeoLocation(false);
|
||||
}
|
||||
|
||||
if (isFirstEntry.value) {
|
||||
isFirstEntry.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode.value === TransactionEditPageMode.View && query['id']) {
|
||||
transactionsStore.getTransaction({ transactionId: query['id'], withPictures: true }).then(t => {
|
||||
setTransactionModel(t, {}, true);
|
||||
}).catch(error => {
|
||||
if (!error.processed) {
|
||||
showToast(error.message || error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onPageBeforeOut(): void {
|
||||
|
||||
Reference in New Issue
Block a user