1.页面效果
2.login.wxml
<view class="login-container"> <view class="title">微信小程序App</view> <view class="login-box"> <label>用户名</label> <input placeholder="请输入用户名"/> <label>密码</label> <input placeholder="请输入密码"/> <button class="login-btn">立即登录</button> <view class="three-line">一一一一一第三方登录一一一一一</view> <button class="login-btn" style="background-color:green;">微信登录</button> </view> </view>
3. login.wxss
/* pages/login/login.wxss */ page{ height: 100%; /* 使用page的height可以使页面占全屏 */ background-color: #fafafa; } .login-container{ padding: 0 10%; height: 100%; } .title{ font-size: large; text-align: center; padding-top: 10%; font-weight: bold; } .login-box{ margin-top: 10%; padding: 10% 5%; background-color: white; border-radius: 10px; box-shadow: 0 4px 4px #888888; } .login-box>input{ margin: 5% 0 8% 0; border-bottom: 1rpx solid lightgray; } .login-btn{ width: 100%!important; background-color: #2f6afd; color: white; font-weight: normal; } .three-line{ margin: 8% 0; text-align: center; font-size: 12px; color: gray; }