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

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

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