From 3ee7795d29420b41e4c74678eed0a0490528476f Mon Sep 17 00:00:00 2001 From: zhengshuiqi Date: Thu, 24 Nov 2022 11:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AE=E8=AF=A2=E7=BD=91=E7=BB=9C=E5=88=A4?= =?UTF-8?q?=E6=96=AD(=E7=99=BD=E5=B1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 1 + common/base.js | 0 main.js | 4 ++ manifest.json | 2 +- pages/account/index.vue | 2 +- pages/index/index.vue | 80 ++++++++++++++++++++++++------------ pages/order/confirmation.vue | 4 ++ 7 files changed, 64 insertions(+), 29 deletions(-) create mode 100644 common/base.js diff --git a/App.vue b/App.vue index 8c7dd9b..2c6e748 100644 --- a/App.vue +++ b/App.vue @@ -94,6 +94,7 @@ onHide: function() { // console.log('App Hide') }, + } diff --git a/common/base.js b/common/base.js new file mode 100644 index 0000000..e69de29 diff --git a/main.js b/main.js index 6dfa9ba..4b2d064 100644 --- a/main.js +++ b/main.js @@ -3,6 +3,10 @@ import store from '@/store/store.js' import ios from '@/ios/index.js' // #ifndef VUE3 import Vue from 'vue' + +Vue.prototype.$onLaunched = new Promise(resolve => { + Vue.prototype.$isResolve = resolve +}) Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ diff --git a/manifest.json b/manifest.json index 126004a..1a19141 100644 --- a/manifest.json +++ b/manifest.json @@ -112,7 +112,7 @@ "xxhdpi" : "unpackage/res/icons/dope2.png" }, "useOriginalMsgbox" : false, - "iosStyle" : "common", + "iosStyle" : "default", "ios" : { "iphone" : { "retina47" : "unpackage/res/icons/dope2.png", diff --git a/pages/account/index.vue b/pages/account/index.vue index 41e0a80..df87d53 100644 --- a/pages/account/index.vue +++ b/pages/account/index.vue @@ -535,7 +535,7 @@ align-items: center; position: absolute; width: 100%; - top: 13.5%; + top: 15.5%; // left: 15%; // z-index: 1111; diff --git a/pages/index/index.vue b/pages/index/index.vue index d366f32..c929a33 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -157,21 +157,50 @@ }, 2000) }, onReady() { - + // 轮询判断 + // typee = 2 有网络 //判断是否有网络(尝试解决IOS白屏) - uni.getNetworkType({ - success: function (res) { - console.log(res.networkType);//网络类型 wifi、2g、3g、4g、ethernet、unknown、none - if(res.networkType === "none"){ - - this.typee = 1; - console.log("当前无网络",this.typee); - }else{ - this.typee = 2 - console.log("有网络",this.typee); - } - } - }); + let that = this; + let s = 0; + let time = setInterval(()=>{ + console.log('6666') + uni.getNetworkType({ + success:(res)=>{ + console.log(res.networkType,s); + if(res.networkType !== 'none'){ + that.typee = 2; + clearInterval(time); + console.log('清楚网络..') + } + } + }) + s++; + },1000); + /* uni.getNetworkType({ + success: function(res) { + console.log(res.networkType); + //网络类型 wifi、2g、3g、4g、ethernet、unknown、none + setTimeout(function() { + if (res.networkType === "none") { + that.typee = 1; + console.log("当前无网络", that.typee); + uni.showToast({ + title: '网络不佳,请重新打开........', + duration: 20000 + }); + + } else { + that.typee = 2 + console.log("有网络", that.typee); + uni.showToast({ + title: '网络不佳,请重新打开........', + duration: 2000 + }); + + } + }, 3000) + } + }); */ }, onLoad() { let home = 'HOME' @@ -1134,7 +1163,7 @@