From 4fe03b6ba321418a0356e37de44417be03cda5af Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期五, 12 四月 2024 10:24:10 +0800 Subject: [PATCH] # --- pages/login/login.vue | 40 +++++++++++++++++++++++++++++++--------- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index f552833..bf4bbe6 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -90,6 +90,10 @@ <uni-popup-dialog :type="msgType" title="閫氱煡" :content="dialogContent" @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog> </uni-popup> + + <uni-popup ref="message" type="message"> + <uni-popup-message type="error" message="缃戠粶鏈繛鎺�" :duration="0"></uni-popup-message> + </uni-popup> </view> <!-- 鐗堟湰鍙� --> @@ -126,7 +130,8 @@ }, msgType: 'success', filename: '', - dialogContent: '' + dialogContent: '', + messageText:'' } }, onLoad() { @@ -139,17 +144,27 @@ if (!this.url) { this.url = {ip: '',port: '',project: ''} } - // this.getVersion() + + }, + mounted() { + let that = this + setInterval(()=>{ + uni.getNetworkType({ + success: function (res) { + console.log(res.networkType); + if(res.networkType != 'wifi'){ + that.$refs.message.open() + }else{ + that.$refs.message.close() + } + + } + }); + },3000) }, onShow () { - // 鎵嬫満绔増鏈彿 - // // #ifdef APP-PLUS - // var that = this - // plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) { - // that.version = wgtinfo.version - // }); - // // #endif this.getVersion() + }, methods: { // 鏄剧ず/闅愯棌瀵嗙爜 @@ -265,11 +280,18 @@ url: url, method: 'GET', success(res) { + console.log(res); var res = res.data if (res.data) { that.filename = res.data.path that.dialogContent = '鍙戠幇鏂扮増鏈�:' + res.data.version + ', 鏄惁绔嬪嵆鏇存柊' that.$refs.upVersion.open() + } else { + uni.showToast({ + title: res.msg, + icon: "none", + position: 'top' + }) } } -- Gitblit v1.9.1