|
@@ -42,12 +42,22 @@
|
|
</view>
|
|
</view>
|
|
<input v-model="confirmpwd" placeholder="请再次输入密码" :password="true" style="height: 28rpx;" maxlength="6" />
|
|
<input v-model="confirmpwd" placeholder="请再次输入密码" :password="true" style="height: 28rpx;" maxlength="6" />
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 验证码 -->
|
|
|
|
+ <view style="padding-bottom: 36rpx;display: flex;border-bottom: 1rpx solid #E0E0E0;margin-bottom: 60rpx" >
|
|
|
|
+ <!-- 图标 手机图标-->
|
|
|
|
+ <image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/Verification.png" style="width: 32rpx;height: 32rpx;margin-right: 20rpx;"></image>
|
|
|
|
+ <!-- 线条 方向是竖-->
|
|
|
|
+ <view style="margin-right: 20rpx;">
|
|
|
|
+ <u-line color="#D8D8D8" direction="col" />
|
|
|
|
+ </view>
|
|
|
|
+ <wInput v-model="verCode" type="number" maxlength="6" placeholder="请输入验证码" isShowCode ref="runCode" @setCode="getVerCode()"></wInput>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<!-- 按钮 -->
|
|
<!-- 按钮 -->
|
|
<view style="height: auto;padding: 0 80rpx;">
|
|
<view style="height: auto;padding: 0 80rpx;">
|
|
<!-- 登录 -->
|
|
<!-- 登录 -->
|
|
<u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate">注册并登录</u-button>
|
|
<u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate">注册并登录</u-button>
|
|
- <view style="margin: 60rpx 0 80rpx 0;">
|
|
|
|
|
|
+ <view style="margin: 30rpx 0 40rpx 0;">
|
|
<u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
|
|
<u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
|
|
</view>
|
|
</view>
|
|
<view style="width: 100%;text-align: center;">
|
|
<view style="width: 100%;text-align: center;">
|
|
@@ -69,22 +79,12 @@
|
|
phoneData: '', // 用户/电话
|
|
phoneData: '', // 用户/电话
|
|
password: "", //密码
|
|
password: "", //密码
|
|
confirmpwd: "", //确认密码
|
|
confirmpwd: "", //确认密码
|
|
- isRotate: false, //是否加载旋转
|
|
|
|
|
|
+ verCode: "", //验证码
|
|
|
|
+ sourceVerCode:"",// 后台返回的验证码
|
|
|
|
+ isRotate:false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // onShow() {
|
|
|
|
- // uni.checkSession({
|
|
|
|
- // success() {
|
|
|
|
- // console.log("已登录")
|
|
|
|
- // return;
|
|
|
|
- // },
|
|
|
|
- // fail() {
|
|
|
|
- // uni.navigateTo({
|
|
|
|
- // url: "../doctor_related/doctor_info"
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
|
|
+
|
|
components: {
|
|
components: {
|
|
wInput,
|
|
wInput,
|
|
wButton,
|
|
wButton,
|
|
@@ -93,7 +93,47 @@
|
|
_this = this;
|
|
_this = this;
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- isShowAgree() {},
|
|
|
|
|
|
+ //验证码点击事件
|
|
|
|
+ getVerCode: async function() {
|
|
|
|
+ //获取验证码
|
|
|
|
+ if (_this.phoneData.length != 11) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ position: 'bottom',
|
|
|
|
+ title: '手机号不正确'
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ console.log("手机号",_this.phoneData)
|
|
|
|
+ let res = await this.$request.post("common/putverfiy", {
|
|
|
|
+ 'phone': _this.phoneData
|
|
|
|
+ });
|
|
|
|
+ console.log("res.data",res.data)
|
|
|
|
+ if (res.status == 0) {
|
|
|
|
+ uni.setStorageSync('verfiyCode', );
|
|
|
|
+ this.sourceVerCode = res.data
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ position: 'bottom',
|
|
|
|
+ title: '验证码发送,请查收'
|
|
|
|
+ });
|
|
|
|
+ this.$refs.runCode.$emit('runCode'); //触发倒计时(一般用于请求成功验证码后调用)
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ // _this.$refs.runCode.$emit('runCode', 0); //假装模拟下需要 终止倒计时
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // position: 'bottom',
|
|
|
|
+ // title: '模拟倒计时终止'
|
|
|
|
+ // });
|
|
|
|
+ }, 3000)
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ position: 'bottom',
|
|
|
|
+ title: '请求失败'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
startReg() {
|
|
startReg() {
|
|
//注册
|
|
//注册
|
|
if (this.isRotate) {
|
|
if (this.isRotate) {
|
|
@@ -108,6 +148,14 @@
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ if (this.verCode != this.sourceVerCode) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ position: 'bottom',
|
|
|
|
+ title: '验证码不正确'
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
if (this.password.length != 6) {
|
|
if (this.password.length != 6) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -124,17 +172,18 @@
|
|
})
|
|
})
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- console.log("注册成功")
|
|
|
|
- _this.isRotate = true
|
|
|
|
- setTimeout(function() {
|
|
|
|
- _this.isRotate = false
|
|
|
|
- }, 3000)
|
|
|
|
|
|
+ _this.isRotate = true//开始加载动画
|
|
|
|
+
|
|
|
|
+ // setTimeout(function() {//三秒后关闭加载动画
|
|
|
|
+ // _this.isRotate = false
|
|
|
|
+ // }, 3000)
|
|
},
|
|
},
|
|
gologin() {
|
|
gologin() {
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
url: "login"
|
|
url: "login"
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|