| | |
| | | <template style="background:#fff"> |
| | | <view class="invite-code-container colCen borderBox"> |
| | | <template style="background:#fff"> |
| | | <view v-if="isshowpage" class="invite-code-container colCen borderBox"> |
| | | <view class="model-title rowCenCen"> |
| | | 请输入邀请码 |
| | | </view> |
| | |
| | | data(){ |
| | | return{ |
| | | isShowCode:false, |
| | | inviteCode:'', |
| | | inviteCode:'DAFANGUAN', |
| | | appInfo:'', |
| | | inviterShow:false, |
| | | platform:'', |
| | | commonInvite:[], |
| | | inviteIndex:0 |
| | | inviteIndex:0, |
| | | isshowpage:false |
| | | } |
| | | }, |
| | | onLoad() |
| | | { |
| | | this.getInviter(); |
| | | //this.getInviter(); |
| | | //去除邀请码 |
| | | this.setCode(); |
| | | }, |
| | | mounted() { |
| | | this.appInfo = uni.getStorageSync('appInfo'); |
| | |
| | | }, |
| | | setCode() |
| | | { |
| | | console.log("确定"); |
| | | var that=this; |
| | | if(this.inviteCode) |
| | | { |
| | |
| | | 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> |