Bladeren bron

地址修改

wcni 5 jaren geleden
bovenliggende
commit
3c680050a4
3 gewijzigde bestanden met toevoegingen van 30 en 19 verwijderingen
  1. 1 1
      pages/myCenter/index.vue
  2. 6 2
      pages/myCenter/logion.vue
  3. 23 16
      pages/myOrder/adressManger.vue

+ 1 - 1
pages/myCenter/index.vue

@@ -152,7 +152,6 @@
 			]),
 		},
 		onLoad() {
-		
 			if(this.successlogion && this.hasLogin) {
 				this.getuserinfo();
 		  	}else {
@@ -184,6 +183,7 @@
 			},
 			
 		},
+      
 		methods: {
 			// 跳转到我的订单
 			gomyorder(e) {

+ 6 - 2
pages/myCenter/logion.vue

@@ -59,7 +59,6 @@
 					     success: (res) => {
 							 that.login(res.userInfo);
 							 that.showDialog(true); // 改变haslogion的值
-							 console.log(this.userInfo);
 							 that.$msg("授权成功");
 							 if(this.successlogion) {
 								uni.navigateBack();
@@ -98,7 +97,12 @@
 													this.setOpenid(token);
 													this.islogionsuccess(true);
 													uni.navigateBack();
-												}
+												},
+												fail: (res) => {
+														 this.islogionsuccess(false);
+														 this.setOpenid('');
+														 this.$msg("获取失败")
+												     }
 											})
 											
 									    }

+ 23 - 16
pages/myOrder/adressManger.vue

@@ -87,6 +87,17 @@
 				this.area_id = item.area_id;
 				this.getadress();
 			},
+			changeshow() {
+				this.adress = '';
+				this.area_id = '';
+				this.getadress();
+				this.show = !this.show;
+				
+			},
+			cancelCity() {
+				this.addressData.addressName = this.adress;
+				this.show = false;
+			},
 			upper(e) {
 				console.log(e)
 				console.log("顶部")
@@ -120,19 +131,9 @@
 			switchChange(e){
 				this.addressData.default = e.detail;
 			},
-			changeshow() {
-				
-				this.adress = '';
-				this.area_id = '';
-				this.getadress();
-				this.show = !this.show;
-				
-			},
 			
-		    
-			cancelCity() {
-				this.show = false;
-			},
+			
+		 
 			// choseCity(e) {
 			// 	console.log(e);
 			// 	this.show = false;
@@ -176,10 +177,16 @@
 					method: 'post',
 					data: params,
 					success: (res) => {
-						uni.$emit('refeshadress')
-						setTimeout(()=>{
-						 	uni.navigateBack();
-						 }, 800)
+						console.log(res.data.code);
+						if(res.data.code == 1000) {
+							uni.$emit('refeshadress')
+							setTimeout(()=>{
+							 	uni.navigateBack();
+							 }, 800)
+						}else {
+							
+						}
+						
 					}
 				})