Browse Source

添加inviteid

306132416@qq.com 6 years ago
parent
commit
b5af1404c7
3 changed files with 8 additions and 5 deletions
  1. 2 1
      App.vue
  2. 3 3
      pages/auth/index.vue
  3. 3 1
      pages/index/index.vue

+ 2 - 1
App.vue

@@ -21,7 +21,8 @@
 			isIos:false,
 			globalShareCounts:10,
 			isGetDayCounts:false,
-			isShowDayCountsModal:true
+			isShowDayCountsModal:true,
+			inviteId:''
 		},
 		onLaunch: function() {
 			console.log('App Launch')

+ 3 - 3
pages/auth/index.vue

@@ -30,10 +30,8 @@
 			getUserInfo(e) {
 				console.log(e);
 				if (e.detail.errMsg == "getUserInfo:ok") {
-					
 					this.iv = e.detail.iv;
 					this.encryptedData = e.detail.encryptedData;
-					
 					this.loginUserInfo()
 				} else {
 					console.log("用户信息授权失败");
@@ -46,6 +44,7 @@
 			},
 			loginUserInfo(){
 				let that = this;
+				console.log('inviteId:',getApp().globalData.inviteId)
 				uni.request({
 					url:getApp().globalData.shareUrl, //需要设置为全局
 					method: 'POST',
@@ -61,7 +60,8 @@
 						headimg:getApp().globalData.user_headUrl,
 						iv:that.iv,
 						session_key:getApp().globalData.session_key,
-						encryptedData:that.encryptedData
+						encryptedData:that.encryptedData,
+						invited:getApp().globalData.inviteId
 					},
 					success: res => {
 						getApp().globalData.user_id = res.data.msg.id;

+ 3 - 1
pages/index/index.vue

@@ -196,7 +196,9 @@ export default {
 
 	onLoad(options) {
 		if(options.inviteId){
-			this.inviteId = options.inviteId;
+			this.inviteId = options.inviteId;
+			getApp().globalData.inviteId = options.inviteId;
+			console.log('inviteId:',getApp().globalData.inviteId)
 		}
 		this.userLogin();
 		this.getEquipmentHeight();