From d9d1b4332986fae66a00ef1f309d50560588920c Mon Sep 17 00:00:00 2001 From: jt <jt@activesoft.com> Date: 星期四, 09 二月 2023 17:06:28 +0800 Subject: [PATCH] test --- pages/login/index.vue | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pages/login/index.vue b/pages/login/index.vue index 3286684..b3ed9cc 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -146,8 +146,11 @@ </label> </checkbox-group> </form> - <button id='login' type="default" @tap="logind" class="btn_login">{{login}}</button> - </div> + <button id='login' type="default" @tap="logind" class="btn_login">{{login}}</button> + <p style="float:right; margin: 10px 10px;color:#c8c7cc"> + <span>鐗堟湰鍙凤細</span> + <span>{{version}}</span> + </p> <div class="" style="text-align: center;background: white;border-top: 0px solid #C0C0C0;color: #7cd0f8;position: absolute;bottom: 0;width: 100%;height: 24px;padding-top:3px;font-size: 11px;"> </div> </div> @@ -191,6 +194,7 @@ userName:account, userPwd:password, ischecked:ischecked, + version:"1.0.0", } }, // computed: mapState({ @@ -252,6 +256,18 @@ // }, logind(){ + if(!this.userServer){ + uni.showModal({title:"鎻愮ず",content:"鏈緭鍏ョ綉绔欏湴鍧�紝璇烽噸鏂伴厤缃緭鍏ワ紒",showCancel:false,confirmText:"鍙栨秷"}); + return; + } + if(!this.userName){ + uni.showModal({title:"鎻愮ず",content:"鏈緭鍏ョ敤鎴峰悕锛岃閲嶆柊杈撳叆锛�,showCancel:false,confirmText:"鍙栨秷"}); + return; + } + if(!this.userPwd){ + uni.showModal({title:"鎻愮ず",content:"鏈緭鍏ュ瘑鐮侊紝璇烽噸鏂拌緭鍏ワ紒",showCancel:false,confirmText:"鍙栨秷"}); + return; + } //妫�煡 "鐧诲綍鐘舵�/閿佸睆鐘舵�" 缁撴潫 var loginInfo = { server: this.userServer, @@ -265,8 +281,15 @@ this.$data.login="loading......"; //鐧诲綍 this.$store.dispatch('login',loginInfo).then(success=>{ - // console.log(success); + console.log(success); if (success.code == '00000') { + //鐧诲綍鎴愬姛鍚庢竻绌虹紦瀛樻暟鎹�+ this.$store.commit("areaFunc",null); + this.$store.commit("classAttrList",null); + this.$store.commit("classGridStyleInfo",null); + this.$store.commit("dicValueInfo",null); + this.$store.commit("subClassAttrList",null); + this.$store.commit("subClassGridStyleInfo",null); //璁剧疆鍏ㄥ眬鍙傛暟锛歶ser-鐢ㄦ埛淇℃伅 uni.setStorageSync('server',loginInfo.server); // uni.setStorageSync('account',loginInfo.uname); @@ -282,19 +305,23 @@ // url:'../index/index?args=9999999999' // }); this.login="寮�鐧诲綍"; + }else{ uni.showModal({title:"閿欒",content:success.msg,showCancel:false,confirmText:"鍙栨秷"}); this.login="寮�鐧诲綍"; } }).catch(ex=>{ - // console.log(ex); + console.log(ex); uni.showModal({title:"閿欒",content:ex.errMsg,showCancel:false,confirmText:"鍙栨秷"}); this.login="寮�鐧诲綍"; }); } }, onLoad() { - + plus.runtime.getProperty(plus.runtime.appid,(info)=>{ + // console.log(info); + this.$data.version=info.version; + }); } } </script> -- Gitblit v1.9.1