From 6d0c45931b709095bfcc54fbae4c7b4be1e48523 Mon Sep 17 00:00:00 2001 From: wangyilin <1454641981@qq.com> Date: Mon, 2 Dec 2024 16:09:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E4=BF=9D=E5=AE=89=E8=AF=81=E5=8F=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collect_information/project.config.json | 9 +++-- collect_information/src/app.ts | 34 +++++++++++++++++++ .../securityUserForm/securityUserForm.scss | 8 +++++ .../securityUserForm/securityUserForm.vue | 13 ++++--- 4 files changed, 57 insertions(+), 7 deletions(-) diff --git a/collect_information/project.config.json b/collect_information/project.config.json index 2d18dde..780ca20 100644 --- a/collect_information/project.config.json +++ b/collect_information/project.config.json @@ -5,11 +5,14 @@ "appid": "touristappid", "setting": { "urlCheck": false, - "es6": false, + "es6": true, "enhance": false, + "minified": true, + "minifyWXSS": true, + "minifyWXML": true, "compileHotReLoad": false, - "postcss": false, - "minified": false + "postcss": true, + "minified": true }, "compileType": "miniprogram" } diff --git a/collect_information/src/app.ts b/collect_information/src/app.ts index 28f74dd..b9729bb 100644 --- a/collect_information/src/app.ts +++ b/collect_information/src/app.ts @@ -24,6 +24,40 @@ const App = createApp({ }) } }, + onShow(){ + const updateManager = Taro.getUpdateManager() + updateManager.onCheckForUpdate(function(res) { + // 请求完新版本信息的回调 + if (res.hasUpdate) { + // 新版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + } + }) + updateManager.onUpdateReady(function() { + // 新版本已经准备好,可以提示用户更新 + Taro.showModal({ + title: '更新提示', + content: '发现新版本,是否重启应用?', + success: function (res) { + if (res.confirm) { + // 新的版本已经准备好,调用 applyUpdate 应用新版本 + updateManager.applyUpdate() + } + } + }).then(res=>{ + console.log(res) + }) + }) + updateManager.onUpdateFailed(function() { + // 新版本下载失败,可进行一些提示用户的操作 + Taro.showModal({ + title: '已有新版本', + content: '请删除当前小程序,重新从搜索界面打开获取最新版本', + }).then(res => { + console.log(res) + }) + }) + } // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 }) diff --git a/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss index c0a88ff..89857bc 100644 --- a/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss +++ b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss @@ -10,3 +10,11 @@ height: 140px } } +.uploadPictures{ + display: flex; + justify-content: center; + align-items: center; + width: 220px; + height: 254px; + border: 2px solid #d5d3d3; +} diff --git a/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue index 3d027b6..a01a944 100644 --- a/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue +++ b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue @@ -1,7 +1,13 @@