124 lines
3.5 KiB
Vue
124 lines
3.5 KiB
Vue
<template>
|
|
<!-- 注册 页面 -->
|
|
<view class="content">
|
|
<HeaderTop page_title='注cc册'></HeaderTop>
|
|
<view class="uni-common-mt">
|
|
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
|
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
|
<input class="uni-input" type="number" focus placeholder="请输入手机号" v-model="phone" />
|
|
</view>
|
|
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
|
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
|
<input class="uni-input flex-1" type="number" placeholder="验证码" v-model="code" />
|
|
<view class="get_code x-text-red x-text-font24" v-if="get_code==false" @click="getCode()">获取验证码</view>
|
|
<view class="get_code x-text-red x-text-font24 w-50" v-else>{{count_time}}s后再次获取验证码</view>
|
|
</view>
|
|
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
|
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
|
<input class="uni-input" type="password" placeholder="请设置密码" v-model="new_password" />
|
|
</view>
|
|
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
|
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
|
<input class="uni-input" type="password" placeholder="确认密码" v-model="sure_password" />
|
|
</view>
|
|
</view>
|
|
<button class="public_blue_btn sure w-90 bg-linear-gradient" @click="sure()">注册</button>
|
|
<view class="agree">点击“注册”即表示您已阅读并同意<text class="x-text-red">《医点医滴会员服务协议》</text></view>
|
|
</view>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
import verification from '../../common/verification.js' //正则验证
|
|
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
|
import {http_use,http_post} from '../../utils/http.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
get_code: false,
|
|
count_time: 60,
|
|
phone: '',
|
|
code: '',
|
|
new_password: '',
|
|
sure_password: '',
|
|
}
|
|
},
|
|
comments:{
|
|
HeaderTop
|
|
},
|
|
methods: {
|
|
// 获取验证码
|
|
getCode() {
|
|
this.get_code = !this.get_code
|
|
this.timer();
|
|
},
|
|
// 验证码计时器
|
|
timer() {
|
|
if (this.count_time > 0) {
|
|
this.count_time--;
|
|
this.get_code = true
|
|
setTimeout(this.timer, 1000);
|
|
} else {
|
|
this.count_time = 60;
|
|
this.get_code = false
|
|
|
|
}
|
|
},
|
|
sure() {
|
|
verification.isNull(this.phone, this.code, this.new_password, this.sure_password) // 非空验证
|
|
if (verification.isNull.prototype.the_Null == true) {
|
|
verification.isPhone(this.phone); // 手机号格式验证
|
|
}
|
|
if (verification.isPhone.prototype.the_isPhone == true) {
|
|
verification.isSamePsd(this.new_password, this.sure_password); // 两次密码是否相同
|
|
}
|
|
|
|
if (
|
|
verification.isNull.prototype.the_Null == true &&
|
|
verification.isPhone.prototype.the_isPhone == true &&
|
|
verification.isSamePsd.prototype.the_isSamePsd == true
|
|
) {
|
|
uni.navigateTo({
|
|
url: 'authentication'
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.content {
|
|
|
|
|
|
.uni-common-mt {
|
|
|
|
padding: 138upx 100upx 0 ;
|
|
|
|
.uni-form-item {
|
|
border-bottom: 2upx solid #ECE4E4;
|
|
padding-top: 60upx;
|
|
|
|
.login_icon {
|
|
margin-right: 40upx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.sure {
|
|
margin-top: 70upx;
|
|
|
|
}
|
|
|
|
.agree {
|
|
display: -webkit-box;
|
|
overflow: hidden;
|
|
white-space: normal !important;
|
|
text-overflow: ellipsis;
|
|
word-wrap: break-word;
|
|
-webkit-line-clamp: 3;
|
|
-webkit-box-orient: vertical
|
|
}
|
|
}
|
|
</style>
|