From fc9bd6378d3bfbde6d5c71535757a3d44de8d8ff Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期四, 20 七月 2023 15:18:06 +0800 Subject: [PATCH] Merge branch 'feature/1.1.4开发' into develop --- uniapp/pages/login/setInviteCode.vue | 33 +++++++++++++++++++++++++++++---- 1 files changed, 29 insertions(+), 4 deletions(-) diff --git a/uniapp/pages/login/setInviteCode.vue b/uniapp/pages/login/setInviteCode.vue index 59e2ca3..efa0c41 100644 --- a/uniapp/pages/login/setInviteCode.vue +++ b/uniapp/pages/login/setInviteCode.vue @@ -150,7 +150,10 @@ this.$u.api.getUserInfo({}).then(e => { console.log(e) util.setCache('userInfo', e.data.userinfo); - if (e.data.userinfo.isPwd == 'N') { + uni.switchTab({ + url: '../index/index' + }) + /* if (e.data.userinfo.isPwd == 'N') { uni.redirectTo({ url: './setPass' }) @@ -158,13 +161,14 @@ uni.switchTab({ url: '../index/index' }) - } + }*/ }).catch(function (err) { console.log(err) }) }, setCode() { + console.log("纭畾"); var that=this; if(this.inviteCode) { @@ -174,11 +178,32 @@ console.log(e) if(e.code != 0) return that.$alert(e.msg) uni.setStorageSync('inviterInfo',e.data) - this.inviterShow = true + //this.inviterShow = true + this.setinvite(); }).catch(function (err) { }) } - } + }, + setinvite() { + var that = this; + let deviceInfo = uni.getDeviceInfo(); + console.log(deviceInfo.deviceId); + this.$u.api.bindInvitation({ + invite_code:this.inviteCode, + deviceid:deviceInfo.deviceId + }).then(e => { + if(e.code != 0) return that.$alert(e.msg) + uni.showToast({ + title:'缁戝畾鎴愬姛锛�', + icon:'none' + }) + setTimeout(function(){ + that.getuserInfo(); + },1000) + }).catch(function (err) { + }) + + }, } } </script> -- Gitblit v1.9.3