From e589cf9e97d0fcb1abeb0fe52e97ace03df74fba Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Wed, 17 Sep 2025 18:02:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(manifest):=20=E5=AE=8C=E5=96=84=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=85=8D=E7=BD=AE=E5=92=8C=E9=A1=B5=E9=9D=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加详细的 manifest 配置,包括平台特定设置和权限 新增全局样式、easycom 配置和 tabBar 设置 扩展页面路由结构,添加登录、关于等页面和子包配置 --- scripts/create-base-files.js | 214 ++++++++++++++++++++++++++++++++++- 1 file changed, 209 insertions(+), 5 deletions(-) diff --git a/scripts/create-base-files.js b/scripts/create-base-files.js index 9d65d9d..bd21e21 100644 --- a/scripts/create-base-files.js +++ b/scripts/create-base-files.js @@ -8,20 +8,224 @@ const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) const manifest = { - name: 'unibest', - description: 'unibest - 最好的 uniapp 开发模板', - versionName: '1.0.0', - versionCode: '100', + 'name': 'unibest', + 'appid': '__UNI__D1E5001', + 'description': '', + 'versionName': '1.0.0', + 'versionCode': '100', + 'transformPx': false, + 'app-plus': { + usingComponents: true, + nvueStyleCompiler: 'uni-app', + compilerVersion: 3, + splashscreen: { + alwaysShowBeforeRender: true, + waiting: true, + autoclose: true, + delay: 0, + }, + modules: {}, + distribute: { + android: { + permissions: [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + minSdkVersion: 21, + targetSdkVersion: 30, + abiFilters: [ + 'armeabi-v7a', + 'arm64-v8a', + ], + }, + ios: {}, + sdkConfigs: {}, + icons: { + android: { + hdpi: 'static/app/icons/72x72.png', + xhdpi: 'static/app/icons/96x96.png', + xxhdpi: 'static/app/icons/144x144.png', + xxxhdpi: 'static/app/icons/192x192.png', + }, + ios: { + appstore: 'static/app/icons/1024x1024.png', + ipad: { + 'app': 'static/app/icons/76x76.png', + 'app@2x': 'static/app/icons/152x152.png', + 'notification': 'static/app/icons/20x20.png', + 'notification@2x': 'static/app/icons/40x40.png', + 'proapp@2x': 'static/app/icons/167x167.png', + 'settings': 'static/app/icons/29x29.png', + 'settings@2x': 'static/app/icons/58x58.png', + 'spotlight': 'static/app/icons/40x40.png', + 'spotlight@2x': 'static/app/icons/80x80.png', + }, + iphone: { + 'app@2x': 'static/app/icons/120x120.png', + 'app@3x': 'static/app/icons/180x180.png', + 'notification@2x': 'static/app/icons/40x40.png', + 'notification@3x': 'static/app/icons/60x60.png', + 'settings@2x': 'static/app/icons/58x58.png', + 'settings@3x': 'static/app/icons/87x87.png', + 'spotlight@2x': 'static/app/icons/80x80.png', + 'spotlight@3x': 'static/app/icons/120x120.png', + }, + }, + }, + }, + compatible: { + ignoreVersion: true, + }, + }, + 'quickapp': {}, + 'mp-weixin': { + appid: 'wxa2abb91f64032a2b', + setting: { + urlCheck: false, + es6: true, + minified: true, + }, + usingComponents: true, + optimization: { + subPackages: true, + }, + }, + 'mp-alipay': { + usingComponents: true, + styleIsolation: 'shared', + optimization: { + subPackages: true, + }, + }, + 'mp-baidu': { + usingComponents: true, + }, + 'mp-toutiao': { + usingComponents: true, + }, + 'uniStatistics': { + enable: false, + }, + 'vueVersion': '3', + 'h5': { + router: { + base: '/', + }, + }, } const pages = { + globalStyle: { + navigationStyle: 'default', + navigationBarTitleText: 'unibest', + navigationBarBackgroundColor: '#f8f8f8', + navigationBarTextStyle: 'black', + backgroundColor: '#FFFFFF', + }, + easycom: { + autoscan: true, + custom: { + '^fg-(.*)': '@/components/fg-$1/fg-$1.vue', + '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)': 'z-paging/components/z-paging$1/z-paging$1.vue', + }, + }, + tabBar: { + custom: true, + color: '#999999', + selectedColor: '#018d71', + backgroundColor: '#F8F8F8', + borderStyle: 'black', + height: '50px', + fontSize: '10px', + iconWidth: '24px', + spacing: '3px', + list: [ + { + text: '首页', + pagePath: 'pages/index/index', + }, + { + text: '关于', + pagePath: 'pages/about/about', + }, + { + text: '我的', + pagePath: 'pages/me/me', + }, + ], + }, pages: [ { path: 'pages/index/index', + type: 'home', style: { - navigationBarTitleText: 'uni-app', + navigationStyle: 'custom', + navigationBarTitleText: '首页', }, }, + { + path: 'pages/about/about', + type: 'page', + style: { + navigationBarTitleText: '关于', + }, + excludeLoginPath: false, + }, + { + path: 'pages/about/alova', + type: 'page', + style: { + navigationBarTitleText: 'Alova 演示', + }, + }, + { + path: 'pages/login/login', + type: 'page', + style: { + navigationBarTitleText: '登录', + }, + }, + { + path: 'pages/login/register', + type: 'page', + style: { + navigationBarTitleText: '注册', + }, + }, + { + path: 'pages/me/me', + type: 'page', + style: { + navigationBarTitleText: '我的', + }, + }, + ], + subPackages: [ + { + root: 'pages-sub', + pages: [ + { + path: 'demo/index', + type: 'page', + style: { + navigationBarTitleText: '分包页面', + }, + }, + ], + }, ], }