diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue
index 02d117d..a5601e7 100644
--- a/pages/detail/detail.vue
+++ b/pages/detail/detail.vue
@@ -214,6 +214,16 @@
+
+ 交易时间
+
+
+ {{ transactionForm.transactionDate }}
+
+
+
+
+
备注
{
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = String(now.getMonth() + 1).padStart(2, '0');
+ const day = String(now.getDate()).padStart(2, '0');
+ return `${year}-${month}-${day}`;
+};
+
const transactionForm = ref({
stockCode: '',
amount: '',
price: '',
currency: 'CNY',
+ transactionDate: getCurrentDate(),
remark: ''
});
@@ -285,6 +305,10 @@ const onCurrencyChange = (e) => {
transactionForm.value.currency = currencyList.value[currencyIndex.value].code;
};
+const onDateChange = (e) => {
+ transactionForm.value.transactionDate = e.detail.value;
+};
+
// 股票搜索相关
const searchResults = ref([]);
const searchTimer = ref(null);
@@ -398,6 +422,7 @@ const resetTransactionForm = () => {
amount: '',
price: '',
currency: 'CNY',
+ transactionDate: getCurrentDate(),
remark: ''
};
};
@@ -421,6 +446,7 @@ const submitTransaction = async () => {
amount: parseFloat(transactionForm.value.amount),
price: parseFloat(transactionForm.value.price),
currency: transactionForm.value.currency,
+ transactionDate: transactionForm.value.transactionDate,
remark: transactionForm.value.remark
};