choose.html
5.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
<!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/login.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/augly.css" />
<title>选择年龄</title>
<style type="text/css">
body,html{
height:100%;
}
.container {
height: 100%;
background: url(__TMPL__/public/mobile/images/login_bg.png) center no-repeat;
background-size: 100% 100%;
padding-top: 1rem;
}
.input_num {
position: relative;
}
.input_num p {
font-size: 0.3rem;
margin-left: 0.4rem;
margin-right: 0.34rem;
}
.jiantou {
width: 0.3rem;
height: 0.3rem;
position: absolute;
top: 50%;
transform: translateY(-0.15rem);
right: 0.3rem;
}
</style>
</head>
<body>
<div class="test_num"></div>
<div class="header">
<div class="return">
<span class="back_href">
<i class="iconfont icon-jiantou-copy"></i>返回
</span>
</div>
选择宝宝年龄
</div>
<div class="container">
<!--<div class="header_wrap"></div>-->
<!--banner-->
<div class="login_img" style="margin-top: 2.9rem;">
<div class="baby_img">
<img src="__TMPL__/public/mobile/images/login_pic2.png" class="img_detail" />
</div>
<div class="login_text">
<p style="font-weight: bold;">选择宝宝年龄</p>
<span style="color: #CCCCCC;">Choose age</span>
</div>
</div>
<div class="input_num">
<p>宝宝年龄</p>
<input type="text" name="baby_age" id="age" value="" readonly class="input_text" placeholder="请选择宝宝年龄" />
<img src="__TMPL__/public/mobile/images/youjiantou.png" class="jiantou" />
<!--<select name="baby_age" class="input_text">-->
<!--<volist name="babyList" id="vo">-->
<!--<option value="{$vo.id}">{$vo.age}</option>-->
<!--</volist>-->
<!--</select>-->
<!--<input type="text" name="" id="age" value="" class="input_text" placeholder="7~35月龄" />-->
<!--<img src="__TMPL__/public/mobile/images/youjiantou.png" class="jiantou" />-->
</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>
<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 src="__TMPL__/public/mobile/js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
// $('.input_num').click(function() {
// weui.datePicker({
// start: 2000,
// end: 2030,
// defaultValue: [2015, 6, 9],
// onChange: function(result) {
// console.log(result);
// },
// onConfirm: function(result) {
// var birthday = result[0].label + result[1].label + result[2].label
// $('#age').val(birthday)
// },
// id: 'datePicker'
// });
// })
var age_id = '';
$('#age').click(function() {
var babyList = JSON.parse(`{$babyList}`);
weui.picker(babyList, {
onChange: function(result) {
console.log(result);
},
onConfirm: function(result) {
$('#age').val(result[0].label);
age_id = result[0].value;
console.log(result);
},
id: 'multiPickerBtn'
});
});
$('.btn').click(function(){
if($('#age').val() == '') {
_error('请选择宝宝年龄');
return false;
}
var data = {
id: age_id
};
$.ajax({
url: "{:url('user/Login/chooseSubmit')}",
type: "POST",
data: data,
dataType: "JSON",
success: function(res){
if(res.code == 1) {
window.location.href = res.url;
} else {
_error(res.msg);
}
}
});
});
// 弹窗提示
var popup_switch = true;
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
}
}
</script>
</body>
</html>