mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 07:55:53 +08:00
优化app版本升级逻辑
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
"name" : "lili商城",
|
"name" : "lili商城",
|
||||||
"appid" : "__UNI__C100675",
|
"appid" : "__UNI__C100675",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.0.14",
|
"versionName" : "4.0.16",
|
||||||
"versionCode" : 4000014,
|
"versionCode" : 4000016,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const $iconUrl = "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/app/upgrade.p
|
|||||||
export const getCurrentNo = function (callback) {
|
export const getCurrentNo = function (callback) {
|
||||||
// 获取本地应用资源版本号
|
// 获取本地应用资源版本号
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
||||||
|
|
||||||
callback && callback({
|
callback && callback({
|
||||||
versionCode: inf.version.replace(/\./g, ""),
|
versionCode: inf.version.replace(/\./g, ""),
|
||||||
version: inf.version
|
version: inf.version
|
||||||
@@ -802,6 +803,9 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
export default function (isPrompt = false) {
|
export default function (isPrompt = false) {
|
||||||
getCurrentNo(version => {
|
getCurrentNo(version => {
|
||||||
getServerNo( res => {
|
getServerNo( res => {
|
||||||
|
|
||||||
|
if( res.version.replace(/\./g, "") > version.versionCode){return false}
|
||||||
|
|
||||||
if (res.forceUpdate) {
|
if (res.forceUpdate) {
|
||||||
if (/\.wgt$/i.test(res.downloadUrl)) {
|
if (/\.wgt$/i.test(res.downloadUrl)) {
|
||||||
getDownload(res);
|
getDownload(res);
|
||||||
|
|||||||
Reference in New Issue
Block a user