From 573fc2fda08fac5f8ee63ba0e22030278bb55226 Mon Sep 17 00:00:00 2001 From: jia <1451658316@qq.com> Date: Wed, 13 Sep 2023 20:14:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 2 - pages/nongKe/cloud_entrepot/index.vue | 1 - store/modules/app.js | 62 +++++++++++++++++---------- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 90aa999..6d5d98e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -221,13 +221,11 @@ }, onTabItemTap(e) { - uni.pageScrollTo({ selector: ".Circle_friends", scrollTop: 0 }) - }, onHide() { diff --git a/pages/nongKe/cloud_entrepot/index.vue b/pages/nongKe/cloud_entrepot/index.vue index 1ee6771..851c7e4 100644 --- a/pages/nongKe/cloud_entrepot/index.vue +++ b/pages/nongKe/cloud_entrepot/index.vue @@ -435,7 +435,6 @@ onShow() { this.cartFn() }, - // 分页 onReachBottom() { if (this.flag || !this.goodsList.length) return diff --git a/store/modules/app.js b/store/modules/app.js index 9d86afa..58f10bd 100644 --- a/store/modules/app.js +++ b/store/modules/app.js @@ -117,38 +117,54 @@ const actions = { } else { apptype = 1 } -console.log(os) + Appversion({ version: os.appWgtVersion, - type: apptype + type: apptype, + phone_brand: os.brand + }).then((res) => { - + if (Object.keys(res.data.appInfo).length > 0) { - - // if(res.data.appInfo.version) uni.showLoading({ + // if(res.data.appInfo.version) uni.showLoading({ // title: '检查更新中' // }) - // 版本更新 - if (compareVersions(res.data.appInfo.version, os.appWgtVersion || wgt_v) == 1 && - compareVersions(res.data.appInfo.version, - wgt_v) == 1) { - try { - let info = res.data.appInfo || {}; - let version = { - title: info.title || '发现新版本', - content: info.content || '修复了部分BUG', - versionName: info.version || '1.0.1', - downUrl: info.dow_url || '', - force: info.force == 1 ? true : false, // 是否强制更新 - quiet: info.quiet == 1 ? true : false // 是否静默更新 - } - Updater.update(version); - } catch (e) { - console.log(e); + if (res.data.appInfo.phone_brand.length > 0) { + if (plus.os.name == "Android") { + // 跳转安卓应用市场 + let appurl = res.data.appInfo. + .dow_url //这个是通用应用市场,如果想指定某个应用商店,需要单独查这个应用商店的包名或scheme及参数 + plus.runtime.openURL(appurl) + } else { + // 跳转AppStore + plus.runtime.launchApplication({ + action: res.data.appInfo..dow_url, + }) + } + } else { + + // 版本更新 + if (compareVersions(res.data.appInfo.version, os.appWgtVersion || wgt_v) == 1 && + compareVersions(res.data.appInfo.version, + wgt_v) == 1) { + try { + let info = res.data.appInfo || {}; + let version = { + title: info.title || '发现新版本', + content: info.content || '修复了部分BUG', + versionName: info.version || '1.0.1', + downUrl: info.dow_url || '', + force: info.force == 1 ? true : false, // 是否强制更新 + quiet: info.quiet == 1 ? true : false // 是否静默更新 + } + Updater.update(version); + } catch (e) { + console.log(e); + } + // uni.hideLoading(); } - // uni.hideLoading(); } }