From 0bd15917637362c104eb157d5163f65bf9503780 Mon Sep 17 00:00:00 2001 From: wk Date: 星期六, 14 九月 2024 16:53:14 +0800 Subject: [PATCH] feat:通行证 --- pages/login/insideUser.vue | 42 +++++++++++++++++++++++++++++------------- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/pages/login/insideUser.vue b/pages/login/insideUser.vue index f1d4a98..9bd65eb 100644 --- a/pages/login/insideUser.vue +++ b/pages/login/insideUser.vue @@ -9,16 +9,26 @@ v-model="username" @changeInput="changeInput2" @input="handleInput2" + :placeholder="'璇疯緭鍏ョ櫥褰曡处鍙�'" ></customPagination> </view> </view> <view class="loginBtn"> - <u-button type="primary" - text="浜鸿劯鐧诲綍" - @click="submit()" - :loading="submitLoading"> - </u-button> - </view> + <view class="loginbutton"> + <u-button type="primary" + text="浜鸿劯鐧诲綍" + @click="submit()" + :loading="submitLoading"> + </u-button> + </view> + <view class="loginbutton"> + <u-button type="primary" + text="瀵嗙爜鐧诲綍" + @click="gologin()" + :loading="submitLoading"> + </u-button> + </view> + </view> </view> </template> <script> @@ -52,14 +62,21 @@ window.identifyResult = this.identifyResult; }, methods: { + gologin(){ + redirectLogin() + }, async identifyResult(result){ - if(result==true){ + if(result=='true'){ this.$u.toast('浜鸿劯妫�娴嬪畬鎴�'); //鐧诲綍鎺ュ彛 uni.showLoading({ title: '鐧诲綍涓�...' }); this.submitLoading = true + let obj = this.userList.find(item => item.username.trim() === this.username.trim()); + if (obj) { + this.password = obj.password; + } await apiLoginPassword({ username: this.username, password: this.password, @@ -107,7 +124,7 @@ }); }else{ this.submitLoading = false - this.$u.toast('鐧诲綍澶辫触锛�'); + this.$u.toast('浜鸿劯妫�娴嬪け璐ワ紒'); } }, changeInput2(e){ @@ -119,15 +136,11 @@ ...mapMutations(['setUserTabbar']), //鐧诲綍 async submit() { - uni.showLoading({ - title: '鐧诲綍涓�...' - }); - //琛ㄥ崟鏍¢獙 if (this.username.length === 0) { this.$u.toast('璇疯緭鍏ヨ处鍙�'); return; } - if (this.userList.filter(item=> item.username == this.username).length == 0){ + if (this.userList.filter(item=> item.username.trim() == this.username.trim()).length == 0){ this.$u.toast('璇ヨ处鍙锋湭鐧诲綍璇峰厛鐧诲綍'); setTimeout(() => { redirectLogin(); @@ -146,6 +159,9 @@ .dengluBtn { margin-top: 130rpx; } + .loginbutton{ + margin: 40rpx 0; + } /* #ifdef H5 */ .loginBtn{ width: 80%; -- Gitblit v1.9.1