提交 cfc4ec0d 作者: 方治民

合并分支 '3.0' 到 'main'

feat(common): 添加版本更新 loading 动画

查看合并请求 !6
{ {
"name": "basic-app", "name": "basic-app",
"version": "3.0.2.1", "version": "3.0.2.2",
"description": "APP 基础工程", "description": "APP 基础工程",
"keywords": [ "keywords": [
"app", "app",
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nanoid": "^4.0.1", "nanoid": "^4.0.1",
"pinia": "^2.0.32", "pinia": "^2.0.33",
"qs": "~6.9.7", "qs": "~6.9.7",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"urijs": "^1.19.11", "urijs": "^1.19.11",
...@@ -110,8 +110,8 @@ ...@@ -110,8 +110,8 @@
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@types/stompjs": "^2.3.5", "@types/stompjs": "^2.3.5",
"@types/urijs": "^1.19.19", "@types/urijs": "^1.19.19",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.1",
"commitizen": "^4.3.0", "commitizen": "^4.3.0",
"conventional-changelog-cli": "^2.2.2", "conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
"czg": "^1.5.3", "czg": "^1.5.3",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.9.0", "eslint-plugin-vue": "^9.9.0",
"husky": "^8.0.3", "husky": "^8.0.3",
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"rimraf": "^4.3.0", "rimraf": "^4.3.1",
"sass": "^1.58.3", "sass": "^1.58.3",
"sort-package-json": "^2.4.1", "sort-package-json": "^2.4.1",
"stylelint": "^14.16.1", "stylelint": "^14.16.1",
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
"terser": "^5.16.5", "terser": "^5.16.5",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"unplugin-auto-import": "^0.15.1", "unplugin-auto-import": "^0.15.1",
"unplugin-vue-components": "^0.24.0", "unplugin-vue-components": "^0.24.1",
"vite": "^4.1.4", "vite": "^4.1.4",
"vue-eslint-parser": "^9.1.0" "vue-eslint-parser": "^9.1.0"
}, },
......
...@@ -74,4 +74,20 @@ export const Message = { ...@@ -74,4 +74,20 @@ export const Message = {
// #endif // #endif
}) })
}, },
/**
* 加载中
* @param text 加载中文字
*/
loading: (text = '加载中...'): void => {
uni.showLoading({
title: text,
mask: true,
})
},
/**
* 隐藏加载中
*/
hideLoading: (): void => {
uni.hideLoading()
},
} }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "Beta App", "name" : "Beta App",
"appid" : "__UNI__2E9441A", "appid" : "__UNI__2E9441A",
"description" : "APP 基础工程", "description" : "APP 基础工程",
"versionName" : "3.0.2.1", "versionName" : "3.0.2.2",
"versionCode" : 107, "versionCode" : 108,
"transformPx" : false, "transformPx" : false,
"locale" : "zh-Hans", "locale" : "zh-Hans",
/* 5+App特有相关 */// 配置文件详细说明 /* 5+App特有相关 */// 配置文件详细说明
......
...@@ -5,10 +5,19 @@ import checkVersion from '@/uni_modules/uni-upgrade-center-app/utils/check-updat ...@@ -5,10 +5,19 @@ import checkVersion from '@/uni_modules/uni-upgrade-center-app/utils/check-updat
export function checkUpgrade(toast = false) { export function checkUpgrade(toast = false) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// 版本更新检查 // 版本更新检查
checkVersion().then((res) => { if (toast) {
if (toast && res?.result?.code === 0) { Message.loading('正在检查更新...')
Message.toast('已是最新版本~') }
} checkVersion()
}) .then((res) => {
if (toast && res?.result?.code === 0) {
Message.toast('已是最新版本~')
}
})
.finally(() => {
if (toast) {
Message.hideLoading()
}
})
// #endif // #endif
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论