index.html
12.3 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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!doctype html>
<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="__TMPL__/public/assets/assets/css/weui.min.css">
<link rel="stylesheet" href="__TMPL__/public/assets/assets/css/swiper-3.4.2.min.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_970727_pul0ncci0v.css">
<link rel="stylesheet" href="__TMPL__/public/assets/assets/css/style.css">
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/fontsize.js"></script>
<!--<script type="text/javascript" src="__TMPL__/public/assets/assets/js/jquery-2.1.0.js"></script>-->
<link rel="stylesheet" href="__TMPL__/public/assets/assets/css/jquery-weui.css">
<title>{$title}</title>
<style>
.title{
margin:0
}
</style>
</head>
<body>
<div class="survey_item supple_top">
<div class="survey_itemtxt supple_itemtxt">姓名:</div>
<div class="survey_input supple_iteminput">
<input type="text" placeholder="请输入" id="name">
</div>
</div>
<div class="survey_item">
<div class="survey_itemtxt supple_itemtxt">手机号:</div>
<div class="survey_input supple_iteminput">
<input type="number" placeholder="请输入" id="tel">
</div>
<div class="sex_itemtxt sexsupple_itemtxt color_txt" >获取验证码</div>
</div>
<div class="survey_item">
<div class="survey_itemtxt supple_itemtxt">验证码:</div>
<div class="survey_input supple_iteminput">
<input type="number" placeholder="请输入" id="code">
</div>
</div>
<div class="survey_item date_choose">
<div class="survey_itemtxt supple_itemtxt">出生日期:</div>
<div class="survey_input supple_iteminput" id="date">
<div class="tishitxt">请选择</div>
<!--<input type="text" placeholder="请输入" >-->
</div>
<!--<div class="sex_itemtxt sexsupple_itemtxt date_choose">请选择</div>-->
</div>
<div class="survey_item">
<div class="survey_itemtxt supple_itemtxt">就职公司:</div>
<div class="survey_input supple_iteminput">
<input type="text" placeholder="请输入" id="company">
</div>
</div>
<div class="survey_item">
<div class="survey_itemtxt supple_itemtxt">所在地:</div>
<!--<div class="survey_input city-picker">-->
<!--<input type="text" id='start' placeholder="请选择"/>-->
<!--</div>-->
<div class="weui-cell__bd survey_input">
<input class="weui-input" id="start" type="text" value="" placeholder="请选择">
</div>
</div>
<!--<div class="survey_item companychoose">-->
<!--<div class="survey_itemtxt supple_itemtxt">就职公司:</div>-->
<!--<div class="survey_input supple_iteminput " id="company">-->
<!--<div class="tishitxt">请选择</div>-->
<!--</div>-->
<!--<!–<div class="sex_itemtxt sexsupple_itemtxt companychoose">请选择</div>–>-->
<!--</div>-->
<div class="survey_item">
<div class="survey_itemtxt supple_itemtxt">身份证号:</div>
<div class="survey_input supple_iteminput">
<input type="text" placeholder="请输入" id="sfid">
</div>
<!---->
</div>
<!--<div class="survey_item ">-->
<!--<div class="survey_itemtxt supple_itemtxt">展业证号:</div>-->
<!--<div class="survey_input supple_iteminput">-->
<!--<input type="text" placeholder="请输入" id="stand">-->
<!--</div>-->
<!--</div>-->
<!--<div class="trust_box supple_box">-->
<!--<div class="trust_title">请上传展业证照片</div>-->
<!--<div class="trust_imgs">-->
<!--<div class="trust_img">-->
<!--<div class="iconfont icon-close-b"></div>-->
<!--<img src="../assets/imgs/dfsdgffdgsga@2x.png" alt="">-->
<!--</div>-->
<!--<div class="trust_img add_img" style="position:relative;">-->
<!--<input type="file" id="doc" name="pic" class="upload_img" style="opacity: 0;position:absolute;width: 100%;height: 100%;" >-->
<!--<div class="iconfont icon-jia"></div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="reg_box actiidvetxt <if condition='$is_select eq 1'>activetxt</if>"><div class="iconfont icon-xuanzhong1"></div>
同意<a href="{:url('agreement/index2')}">《协议》</a></div>
<div class="regbtn survey_btn">提交</div>
<!--toast-->
<div id="toast" style="display: none;">
<div class="weui-mask_transparent"></div>
<div class="weui-toast">
<p class="weui-toast__content">已完成</p>
</div>
</div>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/jquery-2.1.4.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/swiper-3.4.2.jquery.min.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/weui.min.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/Augly_Verification.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/common.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/fastclick.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/jquery-weui.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/city-picker.min.js"></script>
<script>
$("#start").cityPicker({
title: "选择出发地",
onChange: function (picker, values, displayValues) {
console.log(values, displayValues);
}
});
$('.regbtn').click(function () {
toast('123')
var name=$('#name').val();
var tel=$('#tel').val();
var code=$('#code').val();
var date=$('#date').text();
var company=$('#company').val();
var site=$('#start').val();
var sfid=$('#sfid').val();
if(name==''){
toast("姓名不能为空");
} else if(tel==''){
toast("电话号码不能为空")
}else if(! AuglyTest_phone.test(tel)){
toast("电话号码输入不正确")
}else if(code == ''){
toast("验证码不能为空")
}else if(date==''){
toast("出生日期不能为空")
}else if(site == ''){
toast("请选择所在地")
}else if(company==''){
toast("就职公司不能为空")
}else if(sfid==''){
toast("身份证号不能为空")
}else if(!AuglyTest_ID.test(sfid)){
toast("身份证号输入有误")
} else if(!$('.reg_box').hasClass('activetxt')){
toast("请同意用户协议")
}
else{
$.ajax({
url:"{:url('agent_register_mobile/register_mobile')}",
type:"POST",
data:{'phone':tel,'name':name,'code':code,'date':date,'company':company,'site':site,'card_id':sfid,'consent':1},
success:function(data){
var result = eval("(" + data + ")");
if(result.code == 40001){
toast("缺少必要参数");
}else if(result.code == 40004){
toast("请同意用户协议");
}else if(result.code == 40002){
toast("验证码错误");
}else if(result.code == 40003){
toast("验证码已过期请重新获取");
}else if(result.code == 20000){
toast("已发送申请请耐心等待审核");
}else{
toast("与服务器断开连接");
}
}
})
}
})
$('.reg_box').click(function () {
if($(this).hasClass('activetxt')){
$(this).removeClass('activetxt')
}else{
$(this).addClass('activetxt')
}
})
$('.color_txt').click(function () {
var tel=$('#tel').val();
if(tel==''){
toast("电话号码不能为空")
}else if(! AuglyTest_phone.test(tel)){
toast("电话号码输入不正确")
}else{
$.ajax({
url:"{:url('agent_register_mobile/getCode')}",
type:"POST",
data:{'phone':tel},
success:function(data){
var result = eval("(" + data + ")");
if(result.code == 20000){
toast("短信已发送至您的手机请注意查看");
settime($(this))
}else if(result.code == 40000){
toast("短信发送失败");
}
}
})
}
})
//倒计时
var countdown=60;
function settime(val) {
if (countdown == 0) {
$('.color_txt').html('获取验证码');
$('.color_txt').attr('onclick','settime(this)');
countdown = 60;
} else {
$('.color_txt').html(countdown +"s");
$('.color_txt').attr('onclick','');
countdown--;
setTimeout(function() {
settime(val)
},1000)
}
}
// $("#start").cityPicker({
// title: "选择出发地",
// onChange: function (picker, values, displayValues) {
// console.log(values, displayValues);
// }
// });
$('.companychoose').click(function () {
weui.picker([{
label: '中银三星人寿保险有限公司',
value: '中银三星人寿保险有限公司'
}, {
label: '中银三星人寿保险有限公司',
value: '中银三星人寿保险有限公司'
}, {
label: '中银三星人寿保险有限公司',
value: '中银三星人寿保险有限公司'
}, {
label: '中银三星人寿保险有限公司',
value: '中银三星人寿保险有限公司'
}, {
label: '中银三星人寿保险有限公司',
value: '中银三星人寿保险有限公司'
}], {
onChange: function(result) {
},
onConfirm: function(result) {
$('#company').html(result[0].label);
$(this).find('.tishitxt').hide();
}
});
})
$('.date_choose').click(function () {
weui.datePicker({
start:new Date().getFullYear() - 90,
end: new Date(),
defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
onConfirm: function(result){
console.log(result);
let date='';
for(var i=0;i<result.length;i++){
if(i==(result.length-1)){
date += result[i].value
}else{
date += result[i].value+'-'
}
}
$('#date').html(date);
$(this).find('.tishitxt').hide();
},
id: 'ma_expect_date',
className: 'ma_expect_date_picker'
});
})
$('.add_img').click(function () {
let i=0;
$("input[name='pic']").on('change',function(){
i++;
if(i==1){
var file = $(this).val();
var imgurl = setImagePreview(file);
var html=' <div class="trust_img">\n' +
' <div class="iconfont icon-close-b"></div>\n' +
' <img src="'+imgurl+'" alt="">\n' +
' </div>';
$('.trust_imgs').prepend(html);
}else{
}
});
})
//选择图片上传
function setImagePreview(avalue,obj) {
var docObj = document.getElementById("doc");
var imgurl='';
if (docObj.files && docObj.files[0]) {
imgurl = window.URL.createObjectURL(docObj.files[0]);
} else {
//IE下,使用滤镜
docObj.select();
imgurl = document.selection.createRange().text;
}
return imgurl;
}
$('.trust_imgs').on('click','.icon-close-b',function (e) {
$(this).parents('.trust_img').remove();
})
</script>
</body>
</html>