zhaojs
2023-07-18 0e1bce71603c5cbb92b3fe6387c87430528d18a9
uniapp/pages/login/setInviteCode.vue
@@ -168,6 +168,7 @@
         },
         setCode()
         {
            console.log("确定");
            var that=this;
            if(this.inviteCode)
            {
@@ -177,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>