From c5f1a3589bd8924c11dbe01aabe1e760a14df3e4 Mon Sep 17 00:00:00 2001 From: zhao_js <349234519@qq.com> Date: 星期一, 21 十月 2024 19:34:29 +0800 Subject: [PATCH] no message --- uniapp/pages/login/login.vue | 95 +++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 78 insertions(+), 17 deletions(-) diff --git a/uniapp/pages/login/login.vue b/uniapp/pages/login/login.vue index 50fdbff..c5e2c1d 100644 --- a/uniapp/pages/login/login.vue +++ b/uniapp/pages/login/login.vue @@ -23,7 +23,6 @@ </view> </view> </view> - <view class="input-container colCen" v-else> <view class="outSidebox rowCenBet" data-type='pass' :class="selectedInput=='code'?'outSidebox-active':''"> <input @focus="changeType" @blur="cleanActive" data-type='code' type="number" v-model="code" placeholder="璇疯緭鍏ラ獙璇佺爜" @@ -41,9 +40,9 @@ </view> <view class="bottom-fixed colCen"> - <view class="verification-Code" @click="changeWay()"> + <view v-if="issh" class="verification-Code" @click="changeWay()"> {{ifPasslogin?'楠岃瘉鐮�':'瀵嗙爜'}}鐧诲綍 - </view> + </view> <view class="explain-text rowCen"> <switch type="checkbox" @change="changeread" :checked='isread' style="transform:scale(0.6)"/> 鐧婚檰浠h〃宸茶缁嗛槄璇诲苟鍚屾剰<text @click="goPage('agreement')">銆婄敤鎴峰崗璁��</text>鍜�<text @click="goPage('policy')">銆婇殣绉佹斂绛栥��</text> @@ -67,6 +66,7 @@ }, data() { return { + issh:false, ifPasslogin: false, pass: '', phone: '', @@ -78,12 +78,11 @@ showPass: true, second: 60, canGetCode: true, - prevent: true, - clientid:"" + prevent: true }; }, onLoad() { - + this.shShow(); }, methods: { ...mapMutations(['login']), @@ -95,16 +94,38 @@ changeread(e){ this.isread = e.target.value }, + shShow() + { + var that=this; + this.$u.api.comminInt({}).then(e => { + console.log(e) + that.hasshow=true; + // #ifdef APP-PLUS + if (plus.os.name == 'iOS') { + if (e.data.basic.iosExamine && plus.runtime.version == e.data.basic.IosExamineV) { + console.log('1') + that.issh=true; + } else { + console.log(0) + that.issh=false; + } + } + // #endif + }).catch(function(err) { + console.log(err); + }) + }, dologin() { var that = this; - // #ifdef APP-PLUS - plus.push.getClientInfoAsync((info) => { - that.clientid = info["clientid"]; - }); - // #endif - + let clientInfo = uni.getStorageSync('clientInfo'); + var pushCid=""; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid; + } if(this.isread){ if (this.ifPasslogin) { + //瀵嗙爜鐧诲綍 var param = { account: this.phone, password: this.pass, @@ -112,23 +133,33 @@ } this.$u.api.login(param).then(e => { if(e.code != 0) return that.$alert(e.msg) - that.login(e.data.userinfo); + this.targetToIndex(e); + /* that.login(e.data.userinfo); that.$alert('鐧诲綍鎴愬姛') setTimeout(function(){ uni.switchTab({ url: '../index/index' }); - },1000) + },1000) */ }).catch(function (err) { }) } else { + let strsr={ + mobile: this.phone, + captcha: this.code, + pushCid:pushCid + }; + console.log(strsr) + //楠岃瘉鐮佺櫥褰� this.$u.api.mobileLogin({ mobile: this.phone, captcha: this.code, - push_cid:this.clientid + pushCid:pushCid }).then(e => { - if(e.code != 0) return that.$alert(e.msg) that.login(e.data.userinfo); + if(e.code != 0) return that.$alert(e.msg) + this.targetToIndex(e); + /* that.login(e.data.userinfo); utils.setCache('userInfo', e.data.userinfo) getApp().globalData.userInfo = e.data.userinfo that.$alert('鐧诲綍鎴愬姛') @@ -142,7 +173,7 @@ url: '../index/index' }) } - },1000) + },1000) */ }).catch(function (err) { }) @@ -190,6 +221,36 @@ }); } }, + + targetToIndex(e) + { + var that = this; + + that.login(e.data.userinfo); + utils.setCache('userInfo', e.data.userinfo) + getApp().globalData.userInfo = e.data.userinfo + that.$alert('鐧诲綍鎴愬姛') + setTimeout(function(){ + console.log(e.data.userinfo) + if(!e.data.userinfo.invitation_code) + { + uni.redirectTo({ + url: './setInviteCode' + }) + } + /* else if (e.data.userinfo.isPwd == 'N') { + uni.redirectTo({ + url: './setPass' + }) + } */else { + //鏇存柊pushcid + getApp().updatePushCid(); + uni.switchTab({ + url: '../index/index' + }) + } + },1000) + }, showPassfnc() { this.showPass = !this.showPass -- Gitblit v1.9.3