diff --git a/App.vue b/App.vue index 0fba810..cd8ff5d 100644 --- a/App.vue +++ b/App.vue @@ -10,9 +10,6 @@ export default { // 1. 同步初始化配置(必须完成) this.initConfig(options) - // 2. 异步获取用户数据(不阻塞启动) - this.fetchUserDataAsync() - // 启动完成 console.log(`App 启动耗时: ${Date.now() - startTime}ms`) }, @@ -119,66 +116,6 @@ export default { // #endif } }) - }, - - /** - * 异步获取用户数据(不阻塞启动) - */ - fetchUserDataAsync() { - // 延迟到下一个事件循环,确保不阻塞启动 - setTimeout(async () => { - const fetchStart = Date.now() - try { - // 并行获取用户信息和配置 - const [userResult, configResult] = await Promise.allSettled([ - this.fetchUserInfo(), - this.fetchUserConfig() - ]) - - // 处理用户信息结果 - if (userResult.status === 'rejected') { - console.error('获取用户信息失败:', userResult.reason) - } - - // 处理用户配置结果 - if (configResult.status === 'rejected') { - console.error('获取用户配置失败:', configResult.reason) - } - - console.log(`用户数据获取耗时: ${Date.now() - fetchStart}ms`) - } catch (error) { - console.error('获取用户数据异常:', error) - // 不显示错误提示,避免打断用户 - } - }, 0) - }, - - /** - * 获取用户信息 - */ - async fetchUserInfo() { - const data = await get('', 'api/user', {}) - if (data.code === 0) { - uni.setStorageSync('userInfo', data.data) - console.log('用户信息获取成功') - return data.data - } else { - throw new Error(data.message || '获取用户信息失败') - } - }, - - /** - * 获取用户配置 - */ - async fetchUserConfig() { - const data = await get('', 'api/user/config', {}) - if (data.code === 0) { - uni.setStorageSync('config', data.data) - console.log('用户配置获取成功') - return data.data - } else { - throw new Error(data.message || '获取用户配置失败') - } } } } diff --git a/components/bill-management-popup/bill-management-popup.vue b/components/bill-management-popup/bill-management-popup.vue new file mode 100644 index 0000000..156b59d --- /dev/null +++ b/components/bill-management-popup/bill-management-popup.vue @@ -0,0 +1,293 @@ + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index ed8b450..2dc389e 100644 --- a/pages.json +++ b/pages.json @@ -50,6 +50,20 @@ "navigationBarTitleText": "账单详情页", "navigationStyle": "custom" } + }, + { + "path": "pages/index/alipay-annual-bill/alipay-annual-bill", + "style": { + "navigationBarTitleText": "支付宝年度账单", + "navigationStyle": "custom" + } + }, + { + "path": "pages/common/webview/webview", + "style": { + "navigationBarTitleText": "webView页面", + "navigationStyle": "custom" + } } ], "globalStyle": { @@ -61,6 +75,9 @@ "navigationBarBackgroundColor": "#00000000", // 完全透明 "navigationBarTextStyle": "white", // 虚拟按键图标颜色 "backgroundColor": "#00000000" // 背景透明 + }, + "app-plus": { + "bounce": "none" // 全局关闭回弹效果 } }, "uniIdRouter": {} diff --git a/pages/bill/add-bill/add-bill.vue b/pages/bill/add-bill/add-bill.vue index 02459d5..00b5d1e 100644 --- a/pages/bill/add-bill/add-bill.vue +++ b/pages/bill/add-bill/add-bill.vue @@ -238,6 +238,8 @@ + + @@ -252,82 +254,6 @@ - - @@ -335,9 +261,9 @@ import navBar from '@/components/nav-bar/nav-bar.vue' import addBillJson from '@/static/json/add-bill.json' import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue'; +import billManagementPopup from '@/components/bill-management-popup/bill-management-popup.vue' import { stringUtil, randomUtil, util, uiUtil } from '@/utils/common.js'; import hotIcon from "@/static/json/hot-icon.json" -import { storage } from '@/utils/storage.js' import { useStore } from '@/store/index.js' import { @@ -357,6 +283,8 @@ import { // 时间选择器 const timepopup = ref(null) +// 账单管理弹窗 +const billManagementPopupRef = ref(null) const { addBill, @@ -884,9 +812,11 @@ const onClickItemInfo = async (item, action) => { selectItemInfo.value = item timepopup.value.open() } else if (item.key == 'billClassify') { - // selectItemInfo.value = item - data.popupType = "billClassify" - timepopup.value.open() + // Use bill-management-popup component + const initData = { + classifyName: billData.value.merchantOption.billClassify + } + billManagementPopupRef.value.open('billClassify', initData) } else if (item.type == 'text' || item.type == 'number' || item.type == "digit") { item.focus = false nextTick(() => { @@ -902,10 +832,12 @@ const onClickItemInfo = async (item, action) => { }) } } else if (item.key == 'tag' || item.key == 'note') { - data.tempTags = JSON.parse(JSON.stringify(billData.value.merchantOption.tag)) - data.tempNote = JSON.parse(JSON.stringify(billData.value.merchantOption.note)) - data.popupType = "tagAndNote" - timepopup.value.open() + // Use bill-management-popup component + const initData = { + tags: billData.value.merchantOption.tag, + note: billData.value.merchantOption.note + } + billManagementPopupRef.value.open('tagAndNote', initData) } } @@ -1030,46 +962,6 @@ const settmes = () => { data.popupType = '' } -// 删除标签 -const deleteTag = (index) => { - data.tempTags.splice(index, 1) -} - -// 显示标签输入框 -const showTagInputFunc = () => { - data.showTagInput = true - data.tagInputValue = "" -} - -// 确认添加标签 -const confirmAddTag = () => { - if (data.tagInputValue && data.tagInputValue.trim()) { - data.tempTags.push(data.tagInputValue.trim()) - } - data.showTagInput = false - data.tagInputValue = "" -} - - -/** - * 设置分类选择 - */ -const confirmClassify = () => { - if (data.popupType == 'billClassify') { - billClassifyOptions.value.forEach(option => { - if (option.id == data.currentClassifyId) { - billData.value.merchantOption.billClassify = option.name - } - }) - } else if (data.popupType == 'tagAndNote') { - billData.value.merchantOption.tag = JSON.parse(JSON.stringify(data.tempTags)) - billData.value.merchantOption.note = JSON.parse(JSON.stringify(data.tempNote)) - } - - timepopup.value.close() - data.popupType = '' -} - /** * @param {Object} date * 切换时间 @@ -1077,6 +969,20 @@ const confirmClassify = () => { function onChangeStartDate(date) { datePickerData.value.selectDate = date; } + +/** + * 确认账单管理弹窗 + * @param data + */ +const handleBillManagementConfirm = (data) => { + console.log("确认账单管理弹窗", data) + if (data.type == 'billClassify') { + billData.value.merchantOption.billClassify = data.value + } else if (data.type == 'tagAndNote') { + billData.value.merchantOption.tag = data.tags + billData.value.merchantOption.note = data.note + } +} \ No newline at end of file diff --git a/pages/bill/bill-detail/bill-detail.vue b/pages/bill/bill-detail/bill-detail.vue index 3efb5a1..ea5c9bd 100644 --- a/pages/bill/bill-detail/bill-detail.vue +++ b/pages/bill/bill-detail/bill-detail.vue @@ -154,7 +154,7 @@ 账单分类 - + {{ billData.merchantOption.billClassify }} @@ -163,7 +163,8 @@ 标签 标签和备注 - + 添加 @@ -178,7 +179,8 @@ 备注 - + @@ -195,7 +197,8 @@ 计入收支 - + @@ -212,10 +215,14 @@ + + + diff --git a/pages/common/webview/webview.vue b/pages/common/webview/webview.vue new file mode 100644 index 0000000..00c492c --- /dev/null +++ b/pages/common/webview/webview.vue @@ -0,0 +1,132 @@ + + + + + + + \ No newline at end of file diff --git a/pages/index/alipay-annual-bill/alipay-annual-bill.vue b/pages/index/alipay-annual-bill/alipay-annual-bill.vue new file mode 100644 index 0000000..e4ccef9 --- /dev/null +++ b/pages/index/alipay-annual-bill/alipay-annual-bill.vue @@ -0,0 +1,934 @@ + + + + + \ No newline at end of file diff --git a/pages/index/index.nvue b/pages/index/index.nvue index 7f7d4b1..58a29fb 100644 --- a/pages/index/index.nvue +++ b/pages/index/index.nvue @@ -6,7 +6,7 @@ - + 小宝模拟器 @@ -14,68 +14,90 @@ - - - -