简单的微信小程序登录 注册 页面及逻辑

一、示例

二、示例代码

1.wxml

<!--pages/login.wxml-->
<!-- 登录注册文字 -->
<view class="title">{{TitleText}}</view>
<!-- 登录框 -->
<view class="inputBox">
    <input type="text" placeholder="请输入用户名" data-id="user" bindinput="getinput" value="{{userValue}}" placeholder-style="color:#ccc8c8"/>
</view>
<view class="inputBox">
    <input type="text" placeholder="请输入密码" data-id="password" bindinput="getinput" value="{{passwordValue}}" placeholder-style="color:#ccc8c8"/>
</view>
<!-- 登录注册按钮 共用 -->
<view class="btn">
    <van-button type="primary" round block color="#40ae36" disabled="{{btnState}}" bind:tap="login">{{btnText}}</van-button>
</view>

<!-- 新用户去注册 -->
<view class="toRegister" bind:tap="changes">
    <view class="btntTip">{{Totext}}</view>
    <van-icon name="arrow" size="16rpx" />
</view>
<!-- 其他登录方式 -->
<view class="bottom" wx:if="{{TitleText=='登录'}}">
    <view class="tip">其他登录方式</view>
    <image src="/images/帮助.png" mode="" />
</view>

2.scss代码 部分

.title{
  margin: 100rpx 0 54rpx 54rpx;
  font-size: 48rpx;
  font-weight: 400;
  color: #262424;
}
.inputBox{
  border-bottom: 1rpx solid #f0f0f0;
  margin: 0 60rpx;
}
input{
  height: 110rpx;
}
.btn{
  margin: 50rpx 60rpx 0;
}
.toRegister{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40rpx;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值