Преглед изворни кода

新老系统切换页面重写

zhanghui пре 2 година
родитељ
комит
5f010e068a
1 измењених фајлова са 29 додато и 8 уклоњено
  1. 29 8
      myPages/systemSwitch/index.vue

+ 29 - 8
myPages/systemSwitch/index.vue

@@ -122,14 +122,19 @@
 				scrollHeight: '',
 				swiperHeight: '',
 				recordIndex: 0,
-				userInfo: {},
+				tips: '',
+				re:'^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-9])|(18[0-9])|166|195|198|199|191|(147))\\d{8}$', //手机号正则表达式
 				labelStyle: {
 					fontSize: '28rpx',
 					color: '#333333',
 					fontWeight: 'bold'
 				},
-
-				tips: '',
+				userInfo: {
+					phone:'',
+					memberName:'',
+					phonenumber:'',
+					smsCode:''
+				},
 				rules: {
 					phone: {
 						type: 'string',
@@ -176,7 +181,18 @@
 
 			selectUserMsg() {
 				//查询个人信息 todo
-				this.pageIndex = 1
+				this.$refs.uForm.validate().then(res => {
+					this.$api.getOldMember(this.userInfo).then((res) => {
+						console.log(res.data.data)
+
+						if (res.data.data){
+							this.pageIndex = 1
+						}
+
+					})
+
+				}).catch(errors => {
+				})
 			},
 			lastStep() {
 				this.pageIndex = 0
@@ -200,18 +216,23 @@
 				this.tips = text;
 			},
 			getCode() {
+				let regExp=new RegExp(this.re);
+				let b= regExp.test(this.userInfo.phonenumber)
+				if (!b){
+					uni.$u.toast('请输入正确的手机号')
+					return
+				}
 				if (this.$refs.uCode.canGetCode) {
 					// 模拟向后端请求验证码
 					uni.showLoading({
 						title: '正在获取验证码'
 					})
-					setTimeout(() => {
-						uni.hideLoading();
-						// 这里此提示会被this.start()方法中的提示覆盖
+					this.$api.getSmsCode({phonenumber: this.userInfo.phonenumber}).then(res=>{
 						uni.$u.toast('验证码已发送');
 						// 通知验证码组件内部开始倒计时
 						this.$refs.uCode.start();
-					}, 2000);
+					})
+
 				} else {
 					uni.$u.toast('倒计时结束后再发送');
 				}