项目预览
登陆界面
注册界面
功能分析
登陆模块:
Login按钮:点击Login按钮,将文本框内容通过http协议的POST方法传递至后端服务器,成功则提示登陆成功,失败则提示登陆失败
Register按钮:点击Register按钮,跳转至注册界面
Reset按钮:点击Reset按钮,清空表单内容
注册模块:
Login按钮:点击Login按钮,跳转至登陆界面
Register按钮:点击Register按钮,将文本框内容通过http协议的POST方法传递至后端服务器,成功则提示注册成功,失败则提示注册失败
Reset按钮:点击Reset按钮,清空表单内容
目录结构
代码部分(附详细注释)
login.wxml
<view class="container">
<view class="page-body">
<view>这是一个登陆界面</view>
<form catchsubmit="formSubmit" catchreset="formReset">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__bd" style="margin: 30rpx 0" >
<input class="weui-input" name="name" placeholder="用户名" />
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__bd" style="margin: 30rpx 0" >
<input class="weui-input" password type="text" name="pwd" placeholder="密码" />
</view>