my.html
5.8 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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="../assets/css/swiper-3.4.2.min.css">
<script src="../assets/js/base.js" type="text/javascript"></script>
<link rel="stylesheet" href="//at.alicdn.com/t/font_939574_unwnof3vehp.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_773803_41eb3jmg59k.css">
<link rel="stylesheet" href="../assets/css/style.css">
<style>
.pop_up{
display: none;
position: fixed;
top:0;
left:0;
width:100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
z-index:1000;
}
.pop_mold{
background: #fff;
position: absolute;
bottom:-1000px;
left:0;
width:100%;
}
.pop_title{
padding:0 0.32rem;
height: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
color:#252729;
font-size: 0.3rem;
}
.pop_item{
height: 0.8rem;
display: flex;
justify-content: center;
align-items: center;
color:#252729;
font-size: 0.3rem;
}
.pop_item .iconfont{
margin: 0 0.2rem 0 0;
}
.queding_txt{
color:#3988E5;
}
.pop_active{
color:#3988E5;
}
</style>
<title>个人中心</title>
</head>
<body>
<div class="container">
<div class="topmain my_top" style="background-image: url('../assets/imgs/aicon_02@2x.png')">
<div class="headerimg">
<img src="../assets/imgs/aicon_03@2x.png" alt="">
</div>
</div>
<div class="input_box">
<div class="input_in">
<div class="input_tab">负责人姓名:</div>
<div class="input_cell">
<input type="text" value="孙晓晓" class="name">
</div>
</div>
<div class="input_in">
<div class="input_tab">负责人手机号:</div>
<div class="input_cell">
<input type="number" value="15732136232" class="tel">
</div>
</div>
</div>
<div class="my_btn">修改资料</div>
</div>
<div class="pop_up">
<div class="pop_mold">
<div class="pop_title">
<div class="no_queding_txt">不需要</div>
<div>单人间(一人一房)</div>
<div class="queding_txt">需要</div>
</div>
<div class="pop_item_box">
<div class="pop_item pop_active" data-id="1" data-val="需要">
<i class="iconfont icon-xuanzhong4"></i>
需要
</div>
<div class="pop_item" data-id="2" data-val="需要">
<i class="iconfont icon-xuanzhong4"></i>
需要
</div>
<div class="pop_item" data-id="3" data-val="需要">
<i class="iconfont icon-xuanzhong4"></i>
需要
</div>
</div>
</div>
</div>
<!--toast-->
<div id="toast" style="display: none;">
<div class="weui-mask_transparent"></div>
<div class="weui-toast">
<i class="weui-icon-success-no-circle weui-icon_toast"></i>
<p class="weui-toast__content">已完成</p>
</div>
</div>
<script type="text/javascript" src="../assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="../assets/js/common.js"></script>
<script type="text/javascript" src="../assets/js/Augly_Verification.js"></script>
<script type="text/javascript" src="../assets/js/swiper-3.4.2.jquery.min.js"></script>
<script>
$('.my_btn').click(function () {
if($('.name').val()==''){
toast('请填写姓名')
}else if($('.tel').val()==''){
toast('请填写电话号码')
}else if(! AuglyTest_phone.test($('.tel').val())){
toast('请电话号码不正确')
}else{
toast('验证通过');
}
})
//测试部分
$('.input_box').click(function () {
//ajax渲染数据
$('.pop_up').show();
$(".pop_mold").animate({bottom:0+'px'});
})
$('.pop_up').click(function () {
$(".pop_mold").animate({bottom:-1000+'px'});
setTimeout(function(){
$('.pop_up').hide();
},500);
})
$('.pop_mold').click(function (e) {
e.stopPropagation();
})
$(".pop_item_box").on('click','.pop_item',function(){
if(false){//单选(需要这个)
$(this).addClass('pop_active').siblings().removeClass('pop_active');
}else{//多选(多选要这个)
if($(this).hasClass('pop_active')){
$(this).removeClass('pop_active')
}else {
$(this).addClass('pop_active');
}
}
})
//点击不需要
$('.no_queding_txt').click(function () {
$(".pop_mold").animate({bottom:-1000+'px'});
setTimeout(function(){
$('.pop_up').hide();
},500);
})
//点击需要
$('.queding_txt').click(function () {
var idarr=[];
var valstr='';
$(".pop_item_box .pop_item").each(function (i,e) {
console.log(i);
console.log(e);
if($(this).hasClass('pop_active')){
var id=$(this).attr('data-id');
var val=$(this).attr('data-val');
idarr.push(id);
valstr += val + ' ';
console.log(id+val);
}
console.log('idarr:',idarr);
console.log('valstr',valstr);
})
})
</script>
</body>
</html>