Sfoglia il codice sorgente

修改默认头像, 手机号修改

zhengkaixin 1 anno fa
parent
commit
0add00fd98

+ 38 - 29
pages/tab/mine/mine.vue

@@ -472,7 +472,7 @@
 				// #endif
 			},
 			changePhoneUser(phone) {
-				console.log("createUser",phone)
+				
 				API.changePhone(phone).then((res2) => {
 					
 					
@@ -487,28 +487,35 @@
 			},
 			
 			createUser(phone) {
-				console.log("createUser",phone)
-				API.createUser({
-					phone: phone,
-					openId: this.carhelp.getOpenId()
-				}).then((res2) => {
+				
+				if (this.userInfo.id) {
+					console.log("changePhoneUser",phone)
+					this.changePhoneUser(phone)
 					
-					API_weixin.saveLoginRecord({
-						openId:this.carhelp.getOpenId()
-					}).then((res) => {
-						console.log('App createUser  记录用户登陆')
-					}).catch(error => {
-						console.log('App createUser  记录用户登陆 失败')
+				} else{
+					console.log("createUser",phone)
+					API.createUser({
+						phone: phone,
+						openId: this.carhelp.getOpenId()
+					}).then((res2) => {
+						
+						API_weixin.saveLoginRecord({
+							openId:this.carhelp.getOpenId()
+						}).then((res) => {
+							console.log('App createUser  记录用户登陆')
+						}).catch(error => {
+							console.log('App createUser  记录用户登陆 失败')
+						})
+						
+						this.findByOpenId()
+
+					}).catch(error2 => {
+						uni.showToast({
+							icon: 'none',
+							title: error2
+						})
 					})
-					
-					this.findByOpenId()
-
-				}).catch(error2 => {
-					uni.showToast({
-						icon: 'none',
-						title: error2
-					})
-				})
+				}
 			},
 			
 			decryptPhoneNumberH5() {
@@ -553,13 +560,9 @@
 								
 								console.log(res)
 								if (res.data) {
-									if (_this.userInfo.id) {
-										_this.changePhoneUser(res.data)
-										
-									} else{
-										_this.createUser(res.data)
-										
-									}
+									console.log(_this.userInfo.id)
+									
+									_this.createUser(res.data)
 
 								} else {
 									uni.showToast({
@@ -709,7 +712,13 @@
 			.tel {
 				margin-top: 8rpx;
 				font-size: 32rpx;
-				display: flex;
+				display: flex;
+				
+				img {
+					width: 40rpx;
+					height: 40rpx;
+				
+				}
 			}
 		}
 

File diff suppressed because it is too large
+ 4 - 4
uni_modules/uview-ui/components/u-avatar/u-avatar.vue


Some files were not shown because too many files changed in this diff