|
@@ -3,7 +3,22 @@
|
|
|
<m-header />
|
|
|
<m-step style="margin-top: .12rem" />
|
|
|
|
|
|
- <m-button text="下一步" />
|
|
|
+ <div class="title">基本信息</div>
|
|
|
+ <van-form ref="form" :show-error="false" validate-first @submit="onSubmit" @failed="onFailed">
|
|
|
+ <van-field v-model="form.phone" name="phone" label="手机号" placeholder="请输入手机号" :rules="[{ pattern: patternPhone, message: '手机号输入有误' }]" />
|
|
|
+
|
|
|
+ <van-field v-model="form.code" clearable name="code" label="验证码" placeholder="请输入验证码" :rules="[{ required: true, message: '请输入验证码' }]" >
|
|
|
+ <template #button>
|
|
|
+ <span class="codeText">获取验证码</span>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+
|
|
|
+ <van-field v-model="form.password" name="passwrod" label="设置密码" placeholder="6-16位数字或字母" :rules="[{ pattern: patternPhone, message: '6-16位数字或字母' }]" />
|
|
|
+
|
|
|
+ <van-field v-model="form.rePassword" name="rePassword" label="再次输入密码" placeholder="6-16位数字或字母" :rules="[{ pattern: patternPhone, message: '6-16位数字或字母' }]" />
|
|
|
+
|
|
|
+ <m-button class="stepBtn" text="下一步" native-type="submit" />
|
|
|
+ </van-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -16,6 +31,13 @@ export default {
|
|
|
components: { MHeader, MStep, MButton },
|
|
|
data () {
|
|
|
return {
|
|
|
+ patternPhone: /1(3|4|5|6|7|8|9)\d{9}/,
|
|
|
+ form: {
|
|
|
+ phone: null,
|
|
|
+ code: null,
|
|
|
+ password: null,
|
|
|
+ rePassword: null
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -27,6 +49,14 @@ export default {
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
+ onSubmit() {
|
|
|
+ // console.log('submit', values)
|
|
|
+ },
|
|
|
+ onFailed() {
|
|
|
+ // console.log('failed', errorInfo);
|
|
|
+ // console.log(this.$refs['form'].scrollToField(errorInfo.errors[0].name))
|
|
|
+ // this.$refs['form'].scrollToField(errorInfo.errors[0].name, false)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -38,18 +68,30 @@ export default {
|
|
|
overflow-y: auto;
|
|
|
overflow-x: hidden;
|
|
|
background-color: #F3F4F8;
|
|
|
+ .title {
|
|
|
+ font-size: .16rem;
|
|
|
+ color: #999999;
|
|
|
+ padding: .12rem .16rem;
|
|
|
+ }
|
|
|
+ /deep/.van-cell {
|
|
|
+ padding: .13rem .16rem;
|
|
|
+ }
|
|
|
+ /deep/.van-field__label {
|
|
|
+ font-size: .17rem;
|
|
|
+ color: #333;
|
|
|
+ width: 1.15rem;
|
|
|
+ }
|
|
|
+ /deep/.van-field__body {
|
|
|
+ font-size: .16rem
|
|
|
+ }
|
|
|
+
|
|
|
+ .codeText {
|
|
|
+ font-size: .16rem;
|
|
|
+ color: #2DC7AA;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-.van-button--primary {
|
|
|
- position: absolute;
|
|
|
- bottom: .5rem;
|
|
|
- background-color: #2DC7AA;
|
|
|
- border: 1px solid #2DC7AA;
|
|
|
- color: #FFFFFF;
|
|
|
- font-size: .18rem;
|
|
|
- height: .5rem;
|
|
|
- line-height: .52rem;
|
|
|
- width: 90%;
|
|
|
- margin-left: 5%;
|
|
|
+.stepBtn {
|
|
|
+ margin-top: .35rem;
|
|
|
}
|
|
|
</style>
|