info.html
4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>十方台公众号</title>
<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
<script src="__TMPL__/public/assets/js/fontsize.js"></script>
<script src="__TMPL__/public/assets/js/weui.js"></script>
<script src="__TMPL__/public/assets/js/myweui.js"></script>
<link href="__TMPL__/public/assets/css/weui.css" rel="stylesheet">
<link href="__TMPL__/public/assets/css/myweui.css" rel="stylesheet">
<link href="__TMPL__/public/assets/css/personal-info.css" rel="stylesheet">
</head>
<body>
<div class="content">
<div class="name-box">
<div class="input-box">
<text>姓名</text>
<input class="input" type="text" placeholder="请输入姓名" cursor="100" placeholder-class="placeholder-style"
id="user_name" value="" bindinput="inputName"/>
</div>
</div>
<div class="age-box">
<div class="input-box">
<text>年龄</text>
<input class="input" type="number" placeholder="请输入年龄" cursor="100" placeholder-class="placeholder-style"
id="age" value="" bindinput="inputName"/>
</div>
</div>
<div class="age-box" id='showDatePicker'>
<div class="input-box">
<text>生日</text>
<text id="date" class="date"></text>
<!--<input type="text" id='showDatePicker' bindblur="birthBlur"/>-->
</div>
</div>
<div class="sex-box">
<div class="input-box">
<text>性别</text>
<div class="man active" data-id="1">男</div>
<div class="women" data-id="2">女</div>
</div>
</div>
<div class="family-box">
<div class="input-box">家庭住址(选填)</div>
<div class="address-input">
<input class="input" type="text" placeholder="请填写您的家庭住址(选填)" cursor="100"
placeholder-class="placeholder-style"
value="" id="address" bindinput="inputName"/>
</div>
</div>
<div class="footer" onclick="goNext()">
<div class="confirm-btn">
<text>确定</text>
</div>
</div>
</div>
</body>
<script>
// $("#showDatePicker").blur(function(){$("keyboard").hide();});
$('#showDatePicker').on('click', function () {
weui.datePicker({
start: 1990,
end: new Date().getFullYear(),
onChange: function (result) {
// console.log(result);
},
onConfirm: function (result) {
$('#date').text(result[0].label + result[1].label + result[2].label)
}
});
});
$(".man").click(function () {
$(".man").addClass('active');
$(".women").removeClass('active');
})
$(".women").click(function () {
$(".women").addClass('active');
$(".man").removeClass('active');
})
function goNext() {
var user_name = $('#user_name').val()
var age = $('#age').val()
var sex = $('.active').data("id")
// console.log(sex)
var address = $('#address').val()
if (user_name == "") {
alert('请输入姓名')
return false
}
if (age == "") {
alert('请输入年龄')
return false
}
alert($('#date').text());
if ($('#date').text()==""){
alert('请选择出生日期')
return false
}
$.ajax({
url: "{:url('user/register/postInfo')}",
type: "post",
data: {
birthday:$('#date').text(),
user_name: user_name,
age: age,
sex: sex,
address: address,
},
success: function (data) {
if (data == 1) {
alert('十方台温馨提示:\n注册成功')
window.location.href = "{:url('portal/index/index')}";
} else {
alert('十方台温馨提示:\n注册失败')
return false
}
}
})
}
</script>
</html>