张文飞 před 3 roky
rodič
revize
30979c33ed
2 změnil soubory, kde provedl 48 přidání a 1 odebrání
  1. 2 1
      pages.json
  2. 46 0
      pages/homePage/homePage.vue

+ 2 - 1
pages.json

@@ -7,6 +7,7 @@
 				"enablePullDownRefresh": true,
 				"onReachBottomDistance": 50,
 				"scrollIndicator": "none",
+				"navigationStyle":"custom",
 				"app-plus": {
 					"pullToRefresh": {
 						"support": true,
@@ -22,7 +23,7 @@
 		"navigationBarTitleText": "uni-app",
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8",
-		"navigationStyle": "custom",
+		"navigationStyle":"default",
 		"app-plus": {
 			"titleView": false
 		}

+ 46 - 0
pages/homePage/homePage.vue

@@ -147,11 +147,14 @@
            return{
 			   color4:'#F5F5F7',
 			   houseList:[],
+			   userId:"",
+			   token:"",
 		   }
 		},
 		mounted() {
           this.color4 = app.globalData.color4;
 		  this.getHomePage();
+		  this.regist();
 		},
 		methods: {
             async getHomePage(){
@@ -167,6 +170,49 @@
 				if(ret.data.success){
 					let pageModel = ret.data.pageModel;
 					this.houseList = pageModel.resultSet||[];
+				}
+			},
+			async regist(){
+				let ret =await this.$myRequest({
+					url:"/regist",
+					data:{
+						"code": "o08gpwOfRgwnhh1WCBYGLbaszur8",
+						"shareToken": ""
+					}
+				});
+				if(ret.data.success){
+					this.userId = ret.data.single.userId;
+					if(ret.data.single.authed==1){
+						this.token = ret.data.single.token;
+						this.getUserInfo()
+					}else{
+						this.getToken()
+					}
+				}
+			},
+			async getToken(){
+				let ret =await this.$myRequest({
+					url:"/authorizedPhone",
+					data:{
+						"code": (new Date()).getTime(),
+						"phone": "18721775127",
+						"userId": this.userId
+					}
+				});
+				if(ret.data.success){
+					this.token = ret.data.single;
+					this.getUserInfo()
+				}
+			},
+			async getUserInfo(){
+				let ret = await this.$myRequest({
+					url:"/user/userInfo",
+					data:{
+						
+					},
+					method:"GET"
+				});
+				if(ret.data.success){
 					
 				}
 			}