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/setInviteCode.vue |   46 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/uniapp/pages/login/setInviteCode.vue b/uniapp/pages/login/setInviteCode.vue
index 59e2ca3..11fb697 100644
--- a/uniapp/pages/login/setInviteCode.vue
+++ b/uniapp/pages/login/setInviteCode.vue
@@ -1,5 +1,5 @@
-<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>
@@ -66,17 +66,20 @@
 		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');
@@ -150,7 +153,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 +164,14 @@
 						uni.switchTab({
 						  url: '../index/index'
 						})
-					}
+					 }*/
 				}).catch(function (err) {
 					console.log(err)
 				})
 			},
 			setCode()
 			{
+				console.log("纭畾");
 				var that=this;
 				if(this.inviteCode)
 				{
@@ -174,11 +181,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