register.html
10.5 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<include file="public@head_common"/>
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/weui.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/myweui.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/register_login/register.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/augly.css" />
<title>注册</title>
</head>
<body>
<!--<div class="header">
<div class="return"><i class="iconfont icon-jiantou-copy"></i>返回</div>
巧虎
</div>-->
<!--banner-->
<div class="test_num"></div>
<div class="banner" style="background: url({:cmf_get_asset_url($slide['image'])}) center no-repeat;background-size: 100% 4.36rem;"></div>
<!--register-->
<div class="register_item baby_name">
<div class="text_item fitst_text">
<p class="text_tit">宝宝姓名</p>
<input type="text" name="baby_name" id="baby_name" value="" class="baby_input" placeholder="请输入宝宝的姓名" />
</div>
<div class="text_item" id="birthday">
<p class="text_tit">宝宝生日</p>
<input type="text" name="baby_birth" readonly="readonly" value="" id="birthday_input" class="baby_input" placeholder="请选择宝宝生日" />
<img src="__TMPL__/public/mobile/images/youjiantou.png" class="jiantou" />
</div>
</div>
<div class="register_item parent_name">
<div class="text_item fitst_text">
<p class="text_tit">家长姓名</p>
<input type="text" name="parent_name" id="parent_name" value="" class="baby_input" placeholder="请输入家长的姓名" />
</div>
<div class="parent_tit">家长身份</div>
<div class="input_wrap parent_status">
<p class="parent_input input_item" data-name="母亲">
母亲
</p>
<p class="parent_input input_item active" data-name="父亲">
父亲
</p>
<p class="parents_input input_item" data-name="祖父母/外祖父母">
祖父母/外祖父母
</p>
<p class="parent_input input_item" data-name="其他">
其他
</p>
</div>
<div class="parent_tit">是否为<span class="tiger_vip">巧虎会员></span></div>
<div class="vip_text">当前在订购《乐智小天地·巧虎》商品的用户。</div>
<div class="input_wrap is_member">
<p class="parent_input choose_vip" data-type="1">
是
</p>
<p class="parent_input choose_vip active" data-type="0">
否
</p>
</div>
</div>
<div class="register_item parent_name">
<div class="text_item fitst_text">
<p class="text_tit">手机号</p>
<input type="text" name="mobile" id="mobile" value="" class="baby_input" placeholder="请输入您的手机号" />
</div>
<div class="text_item">
<p class="text_tit">验证码</p>
<input type="number" name="code" id="code" maxlength="6" value="" class="baby_input" placeholder="请输入验证码" />
<p class="get_num">获取</p>
</div>
</div>
<div class="register_item parent_name agreement">
<img src="__TMPL__/public/mobile/images/register.png" class="agreement_icon" />
<p class="agreement_text">《{$info.post_title}》</p>
<p class="text_detail">{$info.post_excerpt}</p>
</div>
<div class="agree">
<input type="checkbox" name="" id="" value="" class="agree_agreement" checked />
<p>已阅读并同意<span>《{$info.post_title}》</span></p>
</div>
<div class="btn">
注册
</div>
<div class="bottom_icon">
<img src="__TMPL__/public/mobile/images/biglogo@2x.png" class="bottom_img" />
<p class="bottom_text">{$site_info.site_name}</p>
</div>
<!--选择支付方式-->
<div class="mask" style="">
<!--订单修改-->
<div class="order_lose" style="display: block;">
<div class="order_lose_pic">
<img src="__TMPL__/public/mobile/images/tucengs.png" />
</div>
<div class="lose_text" style="height: 2.34rem;">
<img src="__TMPL__/public/mobile/images/closeimg.png" class="change_close close" />
<p class="change_text_o">对不起,当前功能已暂停</p>
<p class="change_btnt">确认</p>
</div>
</div>
</div>
<script src="__TMPL__/public/mobile/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/weui.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/myweui.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/swiper-4.3.5.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
})
var dt = new Date();
var df= [dt.getFullYear(), (dt.getMonth() + 1), dt.getDate()];
$('#birthday').click(function() {
weui.datePicker({
start: 2000,
end: 2030,
defaultValue: dt,
onChange: function(result) {
console.log(result);
// $('.#birthday_input').val(result)
},
onConfirm: function(result) {
var birthday = result[0].label + result[1].label + result[2].label
console.log(birthday)
$('#birthday_input').val(birthday)
},
id: 'datePicker'
});
})
$('.input_item').click(function() {
$(this).addClass('active').siblings().removeClass('active')
});
$('.choose_vip').click(function() {
$(this).addClass('active').siblings().removeClass('active')
});
$('.tiger_vip').click(function() {
$('.vip_text').toggle()
});
// 关闭成功弹出框
$('.change_close').click(function() {
location.href = "{:url('portal/index/index')}";
});
$('.change_btnt').click(function() {
location.href = "{:url('portal/index/index')}";
});
var popup_switch = true;
$('.btn').click(function() {
var baby_name = $('input[name=baby_name]').val();
var baby_birth = $('input[name=baby_birth]').val();
var parent_name = $('input[name=parent_name]').val();
var parent_status = $('.parent_status').find('.active').data('name');
var is_member = $('.is_member').find('.active').data('type');
var mobile = $('input[name=mobile]').val();
var reg = /^1(3|4|5|7|8|9)\d{9}$/;
var code = $('input[name=code]').val();
if(baby_name.length == 0){
_error("请输入宝宝姓名");
return false;
} else if(baby_birth.length == 0){
_error("请选择宝宝生日");
return false;
} else if(parent_name.length == 0){
_error("请输入家长姓名");
return false;
} else if(!(reg.test(mobile))){
_error("手机号码错误");
return false;
} else if(code.length != 6){
_error("验证码错误");
return false;
} else {
var data = {
baby_name: baby_name,
baby_birth: baby_birth,
parent_name: parent_name,
parent_status: parent_status,
is_member: is_member,
mobile: mobile,
code: code
};
$.ajax({
url: "{:url('user/Register/doRegister')}",
type: "POST",
data: data,
dataType: "JSON",
success: function (res) {
console.log(res);
if (res.code == 1) {
_error(res.msg);
setTimeout(function() {
window.location.href = res.url;
},1000);
} else {
_error(res.msg);
}
}
});
}
});
var get_switch = true;
$('.get_num').click(function() {
var baby_name = $('input[name=baby_name]').val();
var baby_birth = $('input[name=baby_birth]').val();
var parent_name = $('input[name=parent_name]').val();
var mobile = $('input[name=mobile]').val();
var reg = /^1(3|4|5|7|8|9)\d{9}$/;
if(baby_name.length == 0){
_error("请输入宝宝姓名");
return false;
} else if(baby_birth.length == 0){
_error("请选择宝宝生日");
return false;
} else if(parent_name.length == 0){
_error("请输入家长姓名");
return false;
} else if(!(reg.test(mobile))){
_error("手机号码错误");
return false;
} else {
if(get_switch) {
var data = {
mobile: mobile
};
$.ajax({
url: "{:url('user/Common/sendCode')}",
type: "POST",
data: data,
dataType: "JSON",
success: function (res) {
console.log(res);
if (res.code == 1) {
_error(res.msg);
get_switchs();
} else {
_error(res.msg);
}
}
});
}
}
});
// 弹窗提示
function _error(test) {
if(popup_switch) {
popup_switch = false;
$('.test_num').html(test);
$('.test_num').removeClass('Augly-fadeout');
$('.test_num').addClass('Augly-fadein');
$('.test_num').show();
setTimeout(function() {
$('.test_num').removeClass('Augly-fadein');
$('.test_num').addClass('Augly-fadeout');
popup_switch = true
}, 1500)
} else {
popup_switch = true
}
}
// 倒计时
function get_switchs() {
console.log(get_switch);
if(get_switch) {
get_switch = false;
$('.get_num').html('60' + 's')
var num = parseInt(60);
var timer = setInterval(function() {
if(parseInt($('.get_num').html()) > 1) {
num--
$('.get_num').html(num + 's')
} else {
get_switch = true;
$('.get_num').html('获取')
clearInterval(timer)
}
}, 1000)
}
}
</script>
</body>
</html>