From bcb487daab144dca408379f1cbdfbcfec0b17c61 Mon Sep 17 00:00:00 2001 From: tangxinyue <524779910@qq.com> Date: Thu, 15 Jan 2026 18:42:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=94=AF=E4=BB=98=E5=AE=9D?= =?UTF-8?q?=E5=88=86=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 16 +- .../bill-management-popup.vue | 5 +- main.js | 8 +- manifest.json | 84 ++++++----- pages.json | 141 +++++++++++------- .../alipay-annual-bill/alipay-annual-bill.vue | 0 pages/index/index.nvue | 19 ++- store/index.js | 55 ++++--- 8 files changed, 190 insertions(+), 138 deletions(-) rename pages/{index => common}/alipay-annual-bill/alipay-annual-bill.vue (100%) diff --git a/App.vue b/App.vue index 0c218dd..af6c65d 100644 --- a/App.vue +++ b/App.vue @@ -4,7 +4,21 @@ export default { const startTime = Date.now() console.log('App Launch', options) - // 1. 同步初始化配置(必须完成) + // 1. 获取并存储系统信息(只获取一次) + const systemInfo = uni.getSystemInfoSync() + uni.setStorageSync('systemInfo', { + platform: systemInfo.platform, + system: systemInfo.system, + osName: systemInfo.osName, + osVersion: systemInfo.osVersion, + statusBarHeight: systemInfo.statusBarHeight, + windowWidth: systemInfo.windowWidth, + windowHeight: systemInfo.windowHeight, + isIOS: systemInfo.platform === 'ios', + isAndroid: systemInfo.platform === 'android' + }) + + // 2. 同步初始化配置(必须完成) this.initConfig(options) // 启动完成 diff --git a/components/bill-management-popup/bill-management-popup.vue b/components/bill-management-popup/bill-management-popup.vue index 156b59d..de6a783 100644 --- a/components/bill-management-popup/bill-management-popup.vue +++ b/components/bill-management-popup/bill-management-popup.vue @@ -83,10 +83,7 @@ import { reactive, toRefs, - ref, - defineExpose, - defineProps, - defineEmits + ref } from 'vue' import addBillJson from '@/static/json/add-bill.json' diff --git a/main.js b/main.js index 95f64d2..9286993 100644 --- a/main.js +++ b/main.js @@ -20,15 +20,11 @@ export function createApp() { // 将store挂载到全局 app.config.globalProperties.$store = store - // 获取系统信息并挂载到全局 - const systemInfo = uni.getSystemInfoSync() + // 从缓存读取系统信息(已在App.vue中获取) + const systemInfo = uni.getStorageSync('systemInfo') || {} app.config.globalProperties.$platform = systemInfo.platform app.config.globalProperties.$systemInfo = systemInfo - // 获取系统信息 - const { getSystemInfo } = useStore() - getSystemInfo() - return { app } diff --git a/manifest.json b/manifest.json index b3f860e..edd1b1a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,30 +1,34 @@ { - "name" : "alipay-emulator", - "appid" : "__UNI__D535736", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, + "name": "alipay-emulator", + "appid": "__UNI__D535736", + "description": "", + "versionName": "1.0.0", + "versionCode": "100", + "transformPx": false, /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 }, + "optimization": { + "subPackages": true + }, + "runmode": "liberate", // 开启分包优化后,必须配置资源释放模式 /* 模块配置 */ - "modules" : { - "Camera" : {} + "modules": { + "Camera": {} }, /* 应用发布信息 */ - "distribute" : { + "distribute": { /* android打包配置 */ - "android" : { - "permissions" : [ + "android": { + "permissions": [ "", "", "", @@ -43,35 +47,35 @@ ] }, /* ios打包配置 */ - "ios" : { - "dSYMs" : false + "ios": { + "dSYMs": false }, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs": {} }, - "nvueLaunchMode" : "" + "nvueLaunchMode": "" }, /* 快应用特有相关 */ - "quickapp" : {}, + "quickapp": {}, /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "", - "setting" : { - "urlCheck" : false + "mp-weixin": { + "appid": "", + "setting": { + "urlCheck": false }, - "usingComponents" : true + "usingComponents": true }, - "mp-alipay" : { - "usingComponents" : true + "mp-alipay": { + "usingComponents": true }, - "mp-baidu" : { - "usingComponents" : true + "mp-baidu": { + "usingComponents": true }, - "mp-toutiao" : { - "usingComponents" : true + "mp-toutiao": { + "usingComponents": true }, - "uniStatistics" : { - "enable" : false + "uniStatistics": { + "enable": false }, - "vueVersion" : "3" -} + "vueVersion": "3" +} \ No newline at end of file diff --git a/pages.json b/pages.json index 2dc389e..b02292f 100644 --- a/pages.json +++ b/pages.json @@ -7,65 +7,92 @@ "navigationBarTitleText": "uni-app", "navigationStyle": "custom" } - }, - { - "path": "pages/balance/index", - "style": { - "navigationBarTitleText": "余额页面", - "navigationStyle": "custom", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/bill/bill-list/bill-list", - "style": { - "navigationBarTitleText": "账单列表页面", - "navigationStyle": "custom" - } - }, - { - "path": "pages/bill/add-bill/add-bill", - "style": { - "navigationBarTitleText": "新增账单", - "navigationStyle": "custom" - } - }, - { - "path": "pages/common/hot-icon/hot-icon", - "style": { - "navigationBarTitleText": "热门图标", - "navigationStyle": "custom" - } - }, - { - "path": "pages/balance/fast-entrance-management/fast-entrance-management", - "style": { - "navigationBarTitleText": "快速入口页面", - "navigationStyle": "custom" - } - }, - { - "path": "pages/bill/bill-detail/bill-detail", - "style": { - "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" - } } ], + "subPackages": [ + { + "root": "pages/balance", + "pages": [ + { + "path": "index", + "style": { + "navigationBarTitleText": "余额页面", + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } + }, + { + "path": "fast-entrance-management/fast-entrance-management", + "style": { + "navigationBarTitleText": "快速入口页面", + "navigationStyle": "custom" + } + } + ] + }, + { + "root": "pages/bill", + "pages": [ + { + "path": "bill-list/bill-list", + "style": { + "navigationBarTitleText": "账单列表页面", + "navigationStyle": "custom" + } + }, + { + "path": "add-bill/add-bill", + "style": { + "navigationBarTitleText": "新增账单", + "navigationStyle": "custom" + } + }, + { + "path": "bill-detail/bill-detail", + "style": { + "navigationBarTitleText": "账单详情页", + "navigationStyle": "custom" + } + } + ] + }, + { + "root": "pages/common", + "pages": [ + { + "path": "hot-icon/hot-icon", + "style": { + "navigationBarTitleText": "热门图标", + "navigationStyle": "custom" + } + }, + { + "path": "webview/webview", + "style": { + "navigationBarTitleText": "webView页面", + "navigationStyle": "custom" + } + }, + { + "path": "alipay-annual-bill/alipay-annual-bill", + "style": { + "navigationBarTitleText": "支付宝年度账单", + "navigationStyle": "custom" + } + } + ] + } + ], + "preloadRule": { + "pages/index/index": { + "network": "all", + "packages": [ + "pages/balance", + "pages/bill", + "pages/common" + ] + } + }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", diff --git a/pages/index/alipay-annual-bill/alipay-annual-bill.vue b/pages/common/alipay-annual-bill/alipay-annual-bill.vue similarity index 100% rename from pages/index/alipay-annual-bill/alipay-annual-bill.vue rename to pages/common/alipay-annual-bill/alipay-annual-bill.vue diff --git a/pages/index/index.nvue b/pages/index/index.nvue index 31d9f5c..ed8d9ff 100644 --- a/pages/index/index.nvue +++ b/pages/index/index.nvue @@ -70,8 +70,7 @@ - + + @click="util.goPage(`/pages/common/alipay-annual-bill/alipay-annual-bill`)"> @@ -103,7 +102,7 @@