From 20744820b799a99ec9ed7b1db75d03efda9d5ebd Mon Sep 17 00:00:00 2001 From: denghaohaoya <1725652099@qq.com> Date: Sat, 28 Mar 2026 21:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=BF=9B=E8=A1=8C=E5=88=86?= =?UTF-8?q?=E5=8C=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BrandSelector/BrandSelector.vue | 4 +- manifest.json | 3 +- .../BrandSelector/BrandSelector.vue | 0 {pages => package_a}/addBrand/addBrand.vue | 0 .../addProduct/addProduct.vue | 11 ++-- {pages => package_a}/asset/asset.vue | 0 {pages => package_a}/back/back.vue | 0 .../batchDeleteProduct/batchDeleteProduct.vue | 0 {pages => package_a}/category/category.vue | 0 .../common/textview/index.vue | 0 {pages => package_a}/common/webview/index.vue | 0 {pages => package_a}/edit/edit.vue | 4 +- {pages => package_a}/enter/enter.vue | 4 +- {pages => package_a}/import/import.vue | 0 {pages => package_a}/mine/about/index.vue | 0 {pages => package_a}/mine/avatar/index.vue | 0 {pages => package_a}/mine/help/index.vue | 2 +- {pages => package_a}/mine/info/edit.vue | 0 {pages => package_a}/mine/info/index.vue | 0 {pages => package_a}/mine/pwd/index.vue | 0 {pages => package_a}/mine/setting/index.vue | 2 +- {pages => package_a}/product/product.vue | 10 +-- {pages => package_a}/settings/settings.vue | 0 .../storeSelect/storeSelect.vue | 0 .../translation/translation.vue | 4 +- {pages => package_a}/user/user.vue | 0 .../userStores/userStores.vue | 0 pages.json | 62 ++++++++----------- pages/index.vue | 10 +-- pages/login.vue | 6 +- pages/mine/index.vue | 12 ++-- permission.js | 2 +- 32 files changed, 66 insertions(+), 70 deletions(-) rename {pages => package_a}/BrandSelector/BrandSelector.vue (100%) rename {pages => package_a}/addBrand/addBrand.vue (100%) rename {pages => package_a}/addProduct/addProduct.vue (98%) rename {pages => package_a}/asset/asset.vue (100%) rename {pages => package_a}/back/back.vue (100%) rename {pages => package_a}/batchDeleteProduct/batchDeleteProduct.vue (100%) rename {pages => package_a}/category/category.vue (100%) rename {pages => package_a}/common/textview/index.vue (100%) rename {pages => package_a}/common/webview/index.vue (100%) rename {pages => package_a}/edit/edit.vue (99%) rename {pages => package_a}/enter/enter.vue (99%) rename {pages => package_a}/import/import.vue (100%) rename {pages => package_a}/mine/about/index.vue (100%) rename {pages => package_a}/mine/avatar/index.vue (100%) rename {pages => package_a}/mine/help/index.vue (96%) rename {pages => package_a}/mine/info/edit.vue (100%) rename {pages => package_a}/mine/info/index.vue (100%) rename {pages => package_a}/mine/pwd/index.vue (100%) rename {pages => package_a}/mine/setting/index.vue (97%) rename {pages => package_a}/product/product.vue (98%) rename {pages => package_a}/settings/settings.vue (100%) rename {pages => package_a}/storeSelect/storeSelect.vue (100%) rename {pages => package_a}/translation/translation.vue (98%) rename {pages => package_a}/user/user.vue (100%) rename {pages => package_a}/userStores/userStores.vue (100%) diff --git a/components/BrandSelector/BrandSelector.vue b/components/BrandSelector/BrandSelector.vue index ba1fdb3..b418caf 100644 --- a/components/BrandSelector/BrandSelector.vue +++ b/components/BrandSelector/BrandSelector.vue @@ -124,8 +124,8 @@ export default { // 跳转到添加品牌页面 goToAddBrand() { uni.navigateTo({ - url: '/pages/addBrand/addBrand' - }) + url: '/package_a/addBrand/addBrand' + }) } } } diff --git a/manifest.json b/manifest.json index fac9463..fb9395e 100644 --- a/manifest.json +++ b/manifest.json @@ -51,10 +51,11 @@ "appid" : "wx025fc2befe501fda", "setting" : { "urlCheck" : false, - "es6" : false, + "es6" : true, "minified" : true, "postcss" : true }, + "lazyCodeLoading": "requiredComponents", "optimization" : { "subPackages" : true }, diff --git a/pages/BrandSelector/BrandSelector.vue b/package_a/BrandSelector/BrandSelector.vue similarity index 100% rename from pages/BrandSelector/BrandSelector.vue rename to package_a/BrandSelector/BrandSelector.vue diff --git a/pages/addBrand/addBrand.vue b/package_a/addBrand/addBrand.vue similarity index 100% rename from pages/addBrand/addBrand.vue rename to package_a/addBrand/addBrand.vue diff --git a/pages/addProduct/addProduct.vue b/package_a/addProduct/addProduct.vue similarity index 98% rename from pages/addProduct/addProduct.vue rename to package_a/addProduct/addProduct.vue index 76229ed..46bdb06 100644 --- a/pages/addProduct/addProduct.vue +++ b/package_a/addProduct/addProduct.vue @@ -13,7 +13,7 @@ @@ -25,7 +25,7 @@ @@ -295,12 +295,15 @@ export default { }, onLoad(options) { console.log('页面参数:', options,apiUrl); - this.url = apiUrl + this.url = apiUrl // 从扫码页面传入的条形码 if (options && options.fromData) { try { this.productInfo.barcode = options.barcode - const fromData = JSON.parse(options.fromData)[0]; + // 使用 decodeURIComponent 解码乱码数据 + const decodedData = decodeURIComponent(options.fromData); + console.log('解码数据',decodedData); + const fromData = JSON.parse(decodedData)[0]; this.productInfo.name = fromData.productName || ''; this.productInfo.cost = fromData.costPrice || ''; this.productInfo.barcode = fromData.productBarCode || ''; diff --git a/pages/asset/asset.vue b/package_a/asset/asset.vue similarity index 100% rename from pages/asset/asset.vue rename to package_a/asset/asset.vue diff --git a/pages/back/back.vue b/package_a/back/back.vue similarity index 100% rename from pages/back/back.vue rename to package_a/back/back.vue diff --git a/pages/batchDeleteProduct/batchDeleteProduct.vue b/package_a/batchDeleteProduct/batchDeleteProduct.vue similarity index 100% rename from pages/batchDeleteProduct/batchDeleteProduct.vue rename to package_a/batchDeleteProduct/batchDeleteProduct.vue diff --git a/pages/category/category.vue b/package_a/category/category.vue similarity index 100% rename from pages/category/category.vue rename to package_a/category/category.vue diff --git a/pages/common/textview/index.vue b/package_a/common/textview/index.vue similarity index 100% rename from pages/common/textview/index.vue rename to package_a/common/textview/index.vue diff --git a/pages/common/webview/index.vue b/package_a/common/webview/index.vue similarity index 100% rename from pages/common/webview/index.vue rename to package_a/common/webview/index.vue diff --git a/pages/edit/edit.vue b/package_a/edit/edit.vue similarity index 99% rename from pages/edit/edit.vue rename to package_a/edit/edit.vue index 3de5101..4c0be14 100644 --- a/pages/edit/edit.vue +++ b/package_a/edit/edit.vue @@ -842,7 +842,7 @@ export default { goToBrandManagement() { this.showBrandSelector = false; uni.navigateTo({ - url: '/pages/addBrand/addBrand' + url: '/package_a/addBrand/addBrand' }); }, // 分类选择弹窗方法 @@ -873,7 +873,7 @@ export default { goToCategoryManagement() { this.showCategorySelector = false; uni.navigateTo({ - url: '/pages/category/category' + url: '/package_a/category/category' }); } } diff --git a/pages/enter/enter.vue b/package_a/enter/enter.vue similarity index 99% rename from pages/enter/enter.vue rename to package_a/enter/enter.vue index 9e69810..aec82bf 100644 --- a/pages/enter/enter.vue +++ b/package_a/enter/enter.vue @@ -145,10 +145,10 @@ export default { uni.navigateBack({ delta: 1 }); }, goImport() { - uni.navigateTo({ url: '/pages/import/import' }); + uni.navigateTo({ url: '/package_a/import/import' }); }, goNoCode() { - uni.navigateTo({ url: '/pages/NoCode/NoCode' }); + uni.navigateTo({ url: '/package_a/NoCode/NoCode' }); }, goRecord() { uni.showToast({ title: '记录功能开发中', icon: 'none' }); diff --git a/pages/import/import.vue b/package_a/import/import.vue similarity index 100% rename from pages/import/import.vue rename to package_a/import/import.vue diff --git a/pages/mine/about/index.vue b/package_a/mine/about/index.vue similarity index 100% rename from pages/mine/about/index.vue rename to package_a/mine/about/index.vue diff --git a/pages/mine/avatar/index.vue b/package_a/mine/avatar/index.vue similarity index 100% rename from pages/mine/avatar/index.vue rename to package_a/mine/avatar/index.vue diff --git a/pages/mine/help/index.vue b/package_a/mine/help/index.vue similarity index 96% rename from pages/mine/help/index.vue rename to package_a/mine/help/index.vue index d2e4374..a477f7c 100644 --- a/pages/mine/help/index.vue +++ b/package_a/mine/help/index.vue @@ -55,7 +55,7 @@ }, methods: { handleText(item) { - this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`) + this.$tab.navigateTo(`/package_a/common/textview/index?title=${item.title}&content=${item.content}`) } } } diff --git a/pages/mine/info/edit.vue b/package_a/mine/info/edit.vue similarity index 100% rename from pages/mine/info/edit.vue rename to package_a/mine/info/edit.vue diff --git a/pages/mine/info/index.vue b/package_a/mine/info/index.vue similarity index 100% rename from pages/mine/info/index.vue rename to package_a/mine/info/index.vue diff --git a/pages/mine/pwd/index.vue b/package_a/mine/pwd/index.vue similarity index 100% rename from pages/mine/pwd/index.vue rename to package_a/mine/pwd/index.vue diff --git a/pages/mine/setting/index.vue b/package_a/mine/setting/index.vue similarity index 97% rename from pages/mine/setting/index.vue rename to package_a/mine/setting/index.vue index 87f1f06..a0a8900 100644 --- a/pages/mine/setting/index.vue +++ b/package_a/mine/setting/index.vue @@ -39,7 +39,7 @@ }, methods: { handleToPwd() { - this.$tab.navigateTo('/pages/mine/pwd/index') + this.$tab.navigateTo('/package_a/mine/pwd/index') }, handleToUpgrade() { this.$modal.showToast('模块建设中~') diff --git a/pages/product/product.vue b/package_a/product/product.vue similarity index 98% rename from pages/product/product.vue rename to package_a/product/product.vue index 59e82e2..e42dd15 100644 --- a/pages/product/product.vue +++ b/package_a/product/product.vue @@ -358,7 +358,7 @@ goToStockDetail(item) { // 跳转到编辑页面,传递商品ID uni.navigateTo({ - url: `/pages/edit/edit?id=${item.id}` + url: `/package_a/edit/edit?id=${item.id}` }); }, @@ -403,7 +403,7 @@ addNewGoods() { uni.navigateTo({ - url: '/pages/translation/translation' + url: '/package_a/translation/translation' }) }, @@ -473,21 +473,21 @@ batchDeleteGoods() { this.$refs.popup.close(); uni.navigateTo({ - url: '/pages/batchDeleteProduct/batchDeleteProduct' + url: '/package_a/batchDeleteProduct/batchDeleteProduct' }); }, // 分类管理 goToCategoryManagement() { this.$refs.popup.close(); uni.navigateTo({ - url: '/pages/category/category' + url: '/package_a/category/category' }); }, // 品牌管理 goToBrandManagement() { this.$refs.popup.close(); uni.navigateTo({ - url: '/pages/addBrand/addBrand' + url: '/package_a/addBrand/addBrand' }); }, // 条码规则设置 diff --git a/pages/settings/settings.vue b/package_a/settings/settings.vue similarity index 100% rename from pages/settings/settings.vue rename to package_a/settings/settings.vue diff --git a/pages/storeSelect/storeSelect.vue b/package_a/storeSelect/storeSelect.vue similarity index 100% rename from pages/storeSelect/storeSelect.vue rename to package_a/storeSelect/storeSelect.vue diff --git a/pages/translation/translation.vue b/package_a/translation/translation.vue similarity index 98% rename from pages/translation/translation.vue rename to package_a/translation/translation.vue index a142904..17861dd 100644 --- a/pages/translation/translation.vue +++ b/package_a/translation/translation.vue @@ -191,7 +191,7 @@ if(res.code == 200){ data = res.data; uni.navigateTo({ - url: `/pages/addProduct/addProduct?barcode=${this.lastResult}&fromData=${JSON.stringify(data)}` + url: `/package_a/addProduct/addProduct?barcode=${this.lastResult}&fromData=${encodeURIComponent(JSON.stringify(data))}` }) } else{ @@ -314,7 +314,7 @@ if(res.code == 200){ let data = res.data; uni.navigateTo({ - url: `/pages/addProduct/addProduct?barcode=6901028064835&fromData=${JSON.stringify(data)}` + url: `/package_a/addProduct/addProduct?barcode=6901028064835&fromData=${encodeURIComponent(JSON.stringify(data))}` }) } else{ diff --git a/pages/user/user.vue b/package_a/user/user.vue similarity index 100% rename from pages/user/user.vue rename to package_a/user/user.vue diff --git a/pages/userStores/userStores.vue b/package_a/userStores/userStores.vue similarity index 100% rename from pages/userStores/userStores.vue rename to package_a/userStores/userStores.vue diff --git a/pages.json b/pages.json index 17555a2..b3e7cf4 100644 --- a/pages.json +++ b/pages.json @@ -24,45 +24,37 @@ "style": { "navigationBarTitleText": "我的" } - }, {"path": "pages/product/product", - "style": { - "navigationBarTitleText": "" - } -}, -{ - "path": "pages/translation/translation", - "style": { "navigationBarTitleText": "录入清单" } -}, -{ "path": "pages/addProduct/addProduct", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/batchDeleteProduct/batchDeleteProduct", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/edit/edit", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/addBrand/addBrand", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/BrandSelector/BrandSelector", "style": { "navigationBarTitleText": "选择品牌" } }, -{ "path": "pages/user/user", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/settings/settings", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/asset/asset", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/enter/enter", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/storeSelect/storeSelect", "style": { "navigationBarTitleText": "选择门店" } }, -{ "path": "pages/import/import", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/userStores/userStores", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/category/category", "style": { "navigationBarTitleText": "" } }, -{ "path": "pages/back/back", "style": { "navigationBarTitleText": "" } } + } ], "subPackages": [ { - "root": "pages/common", + "root": "package_a", "pages": [ - {"path": "webview/index", - "style": { - "navigationBarTitleText": "浏览网页" - } - }, - { - "path": "textview/index", - "style": { - "navigationBarTitleText": "浏览文本" - } - } + { "path": "product/product", "style": { "navigationBarTitleText": "" } }, + { "path": "translation/translation", "style": { "navigationBarTitleText": "录入清单" } }, + { "path": "addProduct/addProduct", "style": { "navigationBarTitleText": "" } }, + { "path": "batchDeleteProduct/batchDeleteProduct", "style": { "navigationBarTitleText": "" } }, + { "path": "edit/edit", "style": { "navigationBarTitleText": "" } }, + { "path": "addBrand/addBrand", "style": { "navigationBarTitleText": "" } }, + { "path": "BrandSelector/BrandSelector", "style": { "navigationBarTitleText": "选择品牌" } }, + { "path": "user/user", "style": { "navigationBarTitleText": "" } }, + { "path": "userStores/userStores", "style": { "navigationBarTitleText": "" } }, + { "path": "settings/settings", "style": { "navigationBarTitleText": "" } }, + { "path": "asset/asset", "style": { "navigationBarTitleText": "" } }, + { "path": "enter/enter", "style": { "navigationBarTitleText": "" } }, + { "path": "storeSelect/storeSelect", "style": { "navigationBarTitleText": "选择门店" } }, + { "path": "import/import", "style": { "navigationBarTitleText": "" } }, + { "path": "category/category", "style": { "navigationBarTitleText": "" } }, + { "path": "back/back", "style": { "navigationBarTitleText": "" } }, + { "path": "mine/info/index", "style": { "navigationBarTitleText": "个人信息" } }, + { "path": "mine/info/edit", "style": { "navigationBarTitleText": "编辑资料" } }, + { "path": "mine/setting/index", "style": { "navigationBarTitleText": "应用设置" } }, + { "path": "mine/avatar/index", "style": { "navigationBarTitleText": "修改头像" } }, + { "path": "mine/help/index", "style": { "navigationBarTitleText": "常见问题" } }, + { "path": "mine/about/index", "style": { "navigationBarTitleText": "关于我们" } }, + { "path": "mine/pwd/index", "style": { "navigationBarTitleText": "修改密码" } }, + { "path": "common/webview/index", "style": { "navigationBarTitleText": "浏览网页" } }, + { "path": "common/textview/index", "style": { "navigationBarTitleText": "浏览文本" } } ] } ], diff --git a/pages/index.vue b/pages/index.vue index d09fa6f..b6ed29c 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -343,27 +343,27 @@ export default { }, goToUser() { uni.navigateTo({ - url: '/pages/user/user' + url: '/package_a/user/user' }) }, goSetting(){ uni.navigateTo({ - url: '/pages/settings/settings' + url: '/package_a/settings/settings' }) }, goToProduct() { uni.navigateTo({ - url: '/pages/product/product' + url: '/package_a/product/product' }) }, goToAsset() { uni.navigateTo({ - url: '/pages/asset/asset' + url: '/package_a/asset/asset' }) }, goToBack(){ uni.navigateTo({ - url:'/pages/back/back' + url:'/package_a/back/back' }) }, // reLaunchToA() { diff --git a/pages/login.vue b/pages/login.vue index c5ca15e..64afe9c 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -76,12 +76,12 @@ // 隐私协议 handlePrivacy() { let site = this.globalConfig.appInfo.agreements[0] - this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`) + this.$tab.navigateTo(`/package_a/common/webview/index?title=${site.title}&url=${site.url}`) }, // 用户协议 handleUserAgrement() { let site = this.globalConfig.appInfo.agreements[1] - this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`) + this.$tab.navigateTo(`/package_a/common/webview/index?title=${site.title}&url=${site.url}`) }, // 获取图形验证码 getCode() { @@ -131,7 +131,7 @@ // 跳转到门店选择页面 uni.redirectTo({ - url: '/pages/storeSelect/storeSelect' + url: '/package_a/storeSelect/storeSelect' }) }) } diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 2ead74b..76e8c22 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -93,25 +93,25 @@ }, methods: { handleToInfo() { - this.$tab.navigateTo('/pages/mine/info/index') + this.$tab.navigateTo('/package_a/mine/info/index') }, handleToEditInfo() { - this.$tab.navigateTo('/pages/mine/info/edit') + this.$tab.navigateTo('/package_a/mine/info/edit') }, handleToSetting() { - this.$tab.navigateTo('/pages/mine/setting/index') + this.$tab.navigateTo('/package_a/mine/setting/index') }, handleToLogin() { this.$tab.reLaunch('/pages/login') }, handleToAvatar() { - this.$tab.navigateTo('/pages/mine/avatar/index') + this.$tab.navigateTo('/package_a/mine/avatar/index') }, handleHelp() { - this.$tab.navigateTo('/pages/mine/help/index') + this.$tab.navigateTo('/package_a/mine/help/index') }, handleAbout() { - this.$tab.navigateTo('/pages/mine/about/index') + this.$tab.navigateTo('/package_a/mine/about/index') }, handleJiaoLiuQun() { this.$modal.showToast('QQ群:①133713780(满)、②146013835(满)、③189091635') diff --git a/permission.js b/permission.js index cbaec53..7f8a24a 100644 --- a/permission.js +++ b/permission.js @@ -5,7 +5,7 @@ const loginPage = "/pages/login" // 页面白名单 const whiteList = [ - '/pages/login', '/pages/register', '/pages/common/webview/index' + '/pages/login', '/pages/register', '/package_a/common/webview/index' ] // 检查地址白名单