提交 eb4ce641 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 新增URL参数控制是否显示密码登录

上级 aaf12860
<template>
<van-popup v-model="popupVisiable" position="bottom" class="buy-popup" :style="{ height: '60%' }" >
<van-popup v-model="popupVisiable" position="bottom" class="buy-popup" :style="{ height: '60%' }">
<h5>手机号登录</h5>
<van-form :show-error="false" @submit="handleSuccess">
<van-field v-model="form.mobile" name="mobile" label="手机号" placeholder="请输入您的手机号" :rules="[{ required: true, message: '请输入您的手机号' }, { pattern: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/, message: '手机号格式有误' }]" clearable/>
<van-field v-model="form.code" name="code" label="验证码" placeholder="请输入手机验证码" :rules="[{ required: true, message: '请输入手机验证码' }]" maxlength="4" clearable>
<van-field
v-model="form.mobile"
name="mobile"
label="手机号"
placeholder="请输入您的手机号"
:rules="[
{ required: true, message: '请输入您的手机号' },
{ pattern: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/, message: '手机号格式有误' }
]"
clearable
/>
<van-field v-model="form.code" name="code" label="验证码" placeholder="请输入手机验证码" :rules="[{ required: true, message: '请输入手机验证码' }]" maxlength="4" clearable>
<template #button>
<van-button class="code-btn" native-type="button" size="small" type="primary" color="#F8F8F8" :disabled="btnDisabled" id="checkedCode" @click="sendCode">获取验证码</van-button>
</template>
</van-field>
<div style="margin: 16px;">
<p class="account-login" @click="goLogin">账号密码登录</p>
<p class="account-login" @click="goLogin" v-if="pageOptions.hasPasswordLogin">账号密码登录</p>
<van-button type="primary" round block color="#C01540" size="small" :disabled="payBtnDisabled">登录</van-button>
</div>
</van-form>
......@@ -38,6 +48,14 @@ export default {
payBtnDisabled: false
}
},
computed: {
pageOptions() {
const query = this.$route.query
return {
hasPasswordLogin: query.has_password_login !== '0'
}
}
},
watch: {
value: {
handler(nv) {
......@@ -115,30 +133,30 @@ export default {
}
</script>
<style lang="scss" scoped>
h5{
color:#333333;
font-size:0.32rem;
line-height:0.8rem;
h5 {
color: #333333;
font-size: 0.32rem;
line-height: 0.8rem;
text-indent: 0.24rem;
}
.van-field{
::v-deep.van-field__label{
line-height:33px;
height:33px;
.van-field {
::v-deep.van-field__label {
line-height: 33px;
height: 33px;
}
::v-deep.van-field__control{
line-height:33px;
::v-deep.van-field__control {
line-height: 33px;
}
}
.account-login{
color:#C01540;
font-size:12px;
margin-bottom:15px;
.account-login {
color: #c01540;
font-size: 12px;
margin-bottom: 15px;
}
.code-btn{
.van-button__text{
color:#C01540;
width:66px;
.code-btn {
.van-button__text {
color: #c01540;
width: 66px;
}
}
</style>
\ No newline at end of file
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论