注册流程
This commit is contained in:
79
pages/register/index.js
Normal file
79
pages/register/index.js
Normal file
@@ -0,0 +1,79 @@
|
||||
Page({
|
||||
data: {
|
||||
nameConfirm: false,
|
||||
checkedId: '',
|
||||
checkedName: '',
|
||||
userNameList: [
|
||||
{"id":1,"userName":"浙A88123","checked":false},
|
||||
{"id":2,"userName":"浙A88dae","checked":false},
|
||||
{"id":3,"userName":"浙A88F32","checked":false},
|
||||
{"id":4,"userName":"浙A88231","checked":false},
|
||||
{"id":5,"userName":"浙A88F213","checked":false},
|
||||
{"id":6,"userName":"浙A88F1U7","checked":false},
|
||||
{"id":7,"userName":"浙A81237","checked":false},
|
||||
{"id":8,"userName":"浙A1238FU7","checked":false},
|
||||
{"id":9,"userName":"浙A88FU7","checked":false},
|
||||
{"id":10,"userName":"浙A88FU7","checked":false},
|
||||
{"id":11,"userName":"浙A88FU7","checked":false},
|
||||
{"id":12,"userName":"浙A88FU7","checked":false},
|
||||
{"id":13,"userName":"浙A88FU7","checked":false},
|
||||
{"id":14,"userName":"浙A88FU7","checked":false},
|
||||
{"id":15,"userName":"浙A88FU7","checked":false},
|
||||
{"id":16,"userName":"浙A88FU7","checked":false},
|
||||
{"id":17,"userName":"浙A88FU7","checked":false},
|
||||
{"id":18,"userName":"浙A88FU7","checked":false},
|
||||
{"id":19,"userName":"浙A88FU7","checked":false},
|
||||
{"id":20,"userName":"浙A88FU7","checked":false},
|
||||
{"id":21,"userName":"浙A88FU7","checked":false},
|
||||
{"id":22,"userName":"浙A88FU7","checked":false},
|
||||
{"id":23,"userName":"浙A88FU7","checked":false},
|
||||
{"id":24,"userName":"浙A88FU7","checked":false},
|
||||
{"id":25,"userName":"浙A88FU7","checked":false},
|
||||
{"id":26,"userName":"浙A88FU7","checked":false},
|
||||
{"id":27,"userName":"浙A88FU7","checked":false},
|
||||
{"id":28,"userName":"浙A88FU7","checked":false},
|
||||
{"id":29,"userName":"浙A88FU7","checked":false},
|
||||
{"id":30,"userName":"浙A88FU7","checked":false},
|
||||
{"id":31,"userName":"浙A88FU7","checked":false},
|
||||
{"id":32,"userName":"浙A88FU7","checked":false},
|
||||
{"id":33,"userName":"浙A88FU7","checked":false},
|
||||
{"id":34,"userName":"浙A88FU7","checked":false},
|
||||
{"id":35,"userName":"浙A88FU7","checked":false},
|
||||
{"id":36,"userName":"浙A88FU7","checked":false},
|
||||
{"id":37,"userName":"浙A88FU7","checked":false},
|
||||
{"id":38,"userName":"浙A88FU7","checked":false},
|
||||
{"id":39,"userName":"浙A88FU7","checked":false},
|
||||
{"id":40,"userName":"浙A88FU7","checked":false}
|
||||
],
|
||||
},
|
||||
|
||||
checkName() {
|
||||
this.closeDialog();
|
||||
wx.navigateTo({url:"/pages/register/password/index?name=" + this.data.checkedName})
|
||||
},
|
||||
|
||||
changeCheckEasy() {
|
||||
let dataList = this.data.userNameList;
|
||||
let dataCheck = dataList[this.data.checkedId];
|
||||
dataCheck.checked = !dataCheck.checked;
|
||||
dataList[this.data.checkedId] = dataCheck;
|
||||
this.setData({
|
||||
userNameList: dataList,
|
||||
})
|
||||
},
|
||||
|
||||
closeDialog() {
|
||||
this.changeCheckEasy();
|
||||
this.setData({ nameConfirm : false });
|
||||
},
|
||||
|
||||
handleCheckTagChange(e){
|
||||
this.setData({
|
||||
checkedId : e.currentTarget.id - 1,
|
||||
checkedName : e.currentTarget.dataset.name,
|
||||
nameConfirm : true
|
||||
})
|
||||
this.changeCheckEasy();
|
||||
}
|
||||
|
||||
});
|
||||
10
pages/register/index.json
Normal file
10
pages/register/index.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-grid": "/components/grid/grid",
|
||||
"t-grid-item": "/components/grid/grid-item",
|
||||
"t-tag": "/components/tag/tag",
|
||||
"t-steps": "/components/steps/steps",
|
||||
"t-step-item": "/components/steps/step-item",
|
||||
"t-dialog": "/components/dialog/dialog"
|
||||
}
|
||||
}
|
||||
22
pages/register/index.wxml
Normal file
22
pages/register/index.wxml
Normal file
@@ -0,0 +1,22 @@
|
||||
<view>
|
||||
<t-steps class="demo-steps" defaultCurrent="0" readonly>
|
||||
<t-step-item title="用户名" content="选择用户名" />
|
||||
<t-step-item title="密码" content="设置密码" />
|
||||
<t-step-item title="成功" content="完成注册" />
|
||||
</t-steps>
|
||||
</view>
|
||||
<t-grid class="five" column="{{4}}" align="center" border="{{border}}">
|
||||
<t-grid-item wx:for="{{userNameList}}" wx:key="index" text="{{item.id}}">
|
||||
<t-tag wx:if="{{item.checked}}" theme="success" bind:tap="handleCheckTagChange" id="{{item.id}}" data-name="{{item.userName}}" size="large">{{item.userName}}</t-tag>
|
||||
<t-tag wx:else theme="primary" bind:tap="handleCheckTagChange" id="{{item.id}}" data-name="{{item.userName}}" size="large">{{item.userName}}</t-tag>
|
||||
</t-grid-item>
|
||||
</t-grid>
|
||||
<t-dialog
|
||||
visible="{{nameConfirm}}"
|
||||
title="确定选择【{{checkedName}}】?"
|
||||
t-class-confirm="custom-confirm-btn"
|
||||
confirm-btn="就它了"
|
||||
cancel-btn="再想想"
|
||||
bind:confirm="checkName"
|
||||
bind:cancel="closeDialog"
|
||||
/>
|
||||
3
pages/register/index.wxss
Normal file
3
pages/register/index.wxss
Normal file
@@ -0,0 +1,3 @@
|
||||
.custom-confirm-btn {
|
||||
color: #ff4646 !important;
|
||||
}
|
||||
13
pages/register/ok/index.js
Normal file
13
pages/register/ok/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
Page({
|
||||
data: {
|
||||
userName:'',
|
||||
},
|
||||
onLoad: function (options) {
|
||||
this.setData({
|
||||
userName:options.name
|
||||
})
|
||||
},
|
||||
toLongin(){
|
||||
wx.redirectTo({url:"/pages/login/index"});
|
||||
}
|
||||
});
|
||||
8
pages/register/ok/index.json
Normal file
8
pages/register/ok/index.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-steps": "/components/steps/steps",
|
||||
"t-step-item": "/components/steps/step-item",
|
||||
"t-result": "/components/result/result",
|
||||
"t-button": "/components/button/button"
|
||||
}
|
||||
}
|
||||
13
pages/register/ok/index.wxml
Normal file
13
pages/register/ok/index.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<view>
|
||||
<t-steps class="demo-steps" defaultCurrent="2" readonly>
|
||||
<t-step-item title="用户名" content="选择用户名" />
|
||||
<t-step-item title="密码" content="设置密码" />
|
||||
<t-step-item title="成功" content="完成注册" />
|
||||
</t-steps>
|
||||
</view>
|
||||
<view class="leaveTop">
|
||||
<t-result theme="success" title="成功" description="恭喜{{userName}}注册成功!" />
|
||||
</view>
|
||||
<view class="leaveTop">
|
||||
<t-button block theme="danger" bind:tap="toLongin">去登录>>></t-button>
|
||||
</view>
|
||||
3
pages/register/ok/index.wxss
Normal file
3
pages/register/ok/index.wxss
Normal file
@@ -0,0 +1,3 @@
|
||||
.leaveTop{
|
||||
margin-top: 88rpx;
|
||||
}
|
||||
15
pages/register/password/index.js
Normal file
15
pages/register/password/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
Page({
|
||||
data: {
|
||||
userName:'',
|
||||
},
|
||||
onLoad: function (options) {
|
||||
this.setData({
|
||||
userName:options.name
|
||||
})
|
||||
},
|
||||
|
||||
toRegister(){
|
||||
wx.navigateTo({url:"/pages/register/ok/index?name=" + this.data.userName})
|
||||
}
|
||||
|
||||
});
|
||||
7
pages/register/password/index.json
Normal file
7
pages/register/password/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-steps": "/components/steps/steps",
|
||||
"t-step-item": "/components/steps/step-item",
|
||||
"t-button": "/components/button/button"
|
||||
}
|
||||
}
|
||||
15
pages/register/password/index.wxml
Normal file
15
pages/register/password/index.wxml
Normal file
@@ -0,0 +1,15 @@
|
||||
<view>
|
||||
<t-steps class="demo-steps" defaultCurrent="1" readonly>
|
||||
<t-step-item title="用户名" content="选择用户名" />
|
||||
<t-step-item title="密码" content="设置密码" />
|
||||
<t-step-item title="成功" content="完成注册" />
|
||||
</t-steps>
|
||||
</view>
|
||||
<view class="leaveTop">
|
||||
<t-input label="用户名" value="{{userName}}" disabled />
|
||||
<t-input label="输入密码" placeholder="请输入密码" type="password" bindchange="inputChange" data-type='password' clearable />
|
||||
<t-input label="重复输入密码" placeholder="请重复输入密码" type="password" bindchange="inputChange" data-type='rePassword' clearable />
|
||||
</view>
|
||||
<view class="leaveTop">
|
||||
<t-button block theme="danger" bind:tap="toRegister">注册</t-button>
|
||||
</view>
|
||||
3
pages/register/password/index.wxss
Normal file
3
pages/register/password/index.wxss
Normal file
@@ -0,0 +1,3 @@
|
||||
.leaveTop{
|
||||
margin-top: 88rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user