Browse Source

Merge remote-tracking branch 'remotes/origin/wanghao'

7 months ago
parent
commit
fb976970ec
3 changed files with 42 additions and 33 deletions
  1. 1 1
      pages/my/myCompany.vue
  2. 3 1
      pages/my/userinfo.vue
  3. 38 31
      pages/my/userphone.vue

+ 1 - 1
pages/my/myCompany.vue

@@ -134,7 +134,7 @@
 				uni.showLoading({
 					title: '处理中...'
 				});
-				that.$Request.get("/app/company/deleteCompany").then(res => {
+				that.$Request.postJson("/app/company/deleteCompany").then(res => {
 					uni.hideLoading();
 					if (res.code === 0) {
 						if (this.leaveType === 1) {

+ 3 - 1
pages/my/userinfo.vue

@@ -406,10 +406,12 @@
 						content: '确定保存信息',
 						success: e => {
 							if (e.confirm) {
+								let phone = that.$queue.getData('newPhone') ? this.$queue.getData('newPhone') :
+									that.phone
 								that.$Request.postJson("/app/user/updateUser", {
 									userName: that.userName,
 									avatar: that.avatar,
-									phone: that.phone,
+									phone,
 									sex: that.sex,
 									age: that.age,
 									weChatNum: that.weChatNum

+ 38 - 31
pages/my/userphone.vue

@@ -177,25 +177,37 @@ export default {
 			
 			try {
 				// 调用发送验证码API
-				const res = await this.request({
-					url: '/msg/sendMsg/' + this.newPhone + '/changePhone',
-					method: 'GET'
+				this.$Request.getT("/app/Login/sendMsg/" + this.newPhone + "/1").then((res) => {
+					uni.hideLoading();
+					if (res.code === 0) {
+						uni.showToast({
+							title: '验证码发送成功',
+							icon: 'success'
+						});
+						this.startCountdown();
+					} else {
+						uni.showToast({
+							title: res.msg || '发送失败,请重试',
+							icon: 'none'
+						});
+					}
 				});
+				// const res = await this.$Request.getT("/app/Login/sendMsg/" + this.newPhone + "/1")
 				
-				uni.hideLoading();
+				// uni.hideLoading();
 				
-				if (res.status === 0) {
-					uni.showToast({
-						title: '验证码发送成功',
-						icon: 'success'
-					});
-					this.startCountdown();
-				} else {
-					uni.showToast({
-						title: res.msg || '发送失败,请重试',
-						icon: 'none'
-					});
-				}
+				// if (res.status === 0) {
+				// 	uni.showToast({
+				// 		title: '验证码发送成功',
+				// 		icon: 'success'
+				// 	});
+				// 	this.startCountdown();
+				// } else {
+				// 	uni.showToast({
+				// 		title: res.msg || '发送失败,请重试',
+				// 		icon: 'none'
+				// 	});
+				// }
 			} catch (error) {
 				uni.hideLoading();
 				uni.showToast({
@@ -239,29 +251,24 @@ export default {
 			
 			try {
 				const userId = uni.getStorageSync('userId');
-				const res = await this.request({
-					url: '/user/changePhone',
-					method: 'GET',
-					data: {
-						userId: userId,
-						phone: this.newPhone,
-						msg: this.verificationDigits.join('')
-					}
-				});
-				
+				// 验证手机号接口  
+				const res = await this.$Request.postJson("/xxx/xxx/xxx", {
+											phone: this.newPhone,
+											code: this.verificationDigits.join(''),
+										})
 				uni.hideLoading();
-				
-				if (res.status === 0) {
+				if (res.code === 0) {
 					uni.showToast({
-						title: '修改成功',
+						title: '手机号验证成功',
 						icon: 'success'
 					});
 					setTimeout(() => {
-						uni.navigateBack();
+						this.$queue.setData('newPhone', this.newPhone);
+						uni.navigateBack()
 					}, 1500);
 				} else {
 					uni.showToast({
-						title: res.msg || '修改失败',
+						title: res.msg || '手机号验证失败',
 						icon: 'none'
 					});
 				}