|
@@ -74,16 +74,17 @@ |
|
@@ -74,16 +74,17 @@ |
74
|
<div class="infup">
|
74
|
<div class="infup">
|
75
|
<span style="color:#999797">性别 </span>
|
75
|
<span style="color:#999797">性别 </span>
|
76
|
<span class="right sex">
|
76
|
<span class="right sex">
|
77
|
- <input type="radio" id="male" name="sex" />
|
77
|
+ <input type="radio" id="male" value="男" name="sex" />
|
78
|
<label for="male">男</label>
|
78
|
<label for="male">男</label>
|
79
|
- <input type="radio" id="female" name="sex" />
|
79
|
+ <input type="radio" id="female" value="女" name="sex" />
|
80
|
<label for="female">女</label>
|
80
|
<label for="female">女</label>
|
81
|
</span>
|
81
|
</span>
|
82
|
</div>
|
82
|
</div>
|
83
|
|
83
|
|
84
|
<div class="perp">
|
84
|
<div class="perp">
|
85
|
<span>手机</span>
|
85
|
<span>手机</span>
|
86
|
- <span class="right phonesp" id="phonesp">18611022356
|
86
|
+ <span class="right">
|
|
|
87
|
+ <input id="phonesp" value="" placeholder="18611022356"/>
|
87
|
<img src="images/pergo_03.jpg" />
|
88
|
<img src="images/pergo_03.jpg" />
|
88
|
</span>
|
89
|
</span>
|
89
|
</div>
|
90
|
</div>
|
|
@@ -158,28 +159,23 @@ |
|
@@ -158,28 +159,23 @@ |
158
|
<div class="mPicker hide">
|
159
|
<div class="mPicker hide">
|
159
|
<div class="mPicker-mask hide"></div>
|
160
|
<div class="mPicker-mask hide"></div>
|
160
|
</div>
|
161
|
</div>
|
|
|
162
|
+ <script type="text/javascript" src="js/jquery.min.js"></script>
|
161
|
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
163
|
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
162
|
- <script type="text/javascript" src="js/common.js"/>
|
|
|
163
|
- <script type="text/javascript" src="js/weui.js"/>
|
164
|
+ <script type="text/javascript" src="js/common.js"s></script>
|
|
|
165
|
+
|
|
|
166
|
+ <script type="text/javascript" src="js/weui.js"></script>
|
164
|
<script type="text/javascript" src="js/date.js"></script>
|
167
|
<script type="text/javascript" src="js/date.js"></script>
|
165
|
<script type="text/javascript" src="js/iscroll.js"></script>
|
168
|
<script type="text/javascript" src="js/iscroll.js"></script>
|
166
|
<script src="js/base.js"></script>
|
169
|
<script src="js/base.js"></script>
|
167
|
- <script type="text/javascript" src="js/jquery.min.js"></script>
|
|
|
168
|
<script src="js/per.js"></script>
|
170
|
<script src="js/per.js"></script>
|
169
|
<script type="text/javascript">
|
171
|
<script type="text/javascript">
|
170
|
$(document).ready(function () {
|
172
|
$(document).ready(function () {
|
171
|
getMedical()
|
173
|
getMedical()
|
172
|
getCulture()
|
174
|
getCulture()
|
173
|
- //上传图片
|
|
|
174
|
- // var obj = document.getElementById('#input_file')
|
|
|
175
|
- // imgPreview(obj)
|
|
|
176
|
- // 获取个人信息
|
175
|
+
|
177
|
getinfo()
|
176
|
getinfo()
|
178
|
})
|
177
|
})
|
179
|
- $(function () {
|
|
|
180
|
- $('#beginTime').date();
|
|
|
181
|
- $('#endTime').date({ theme: "datetime" });
|
|
|
182
|
- });
|
178
|
+
|
183
|
// 获取个人信息
|
179
|
// 获取个人信息
|
184
|
function getinfo(){
|
180
|
function getinfo(){
|
185
|
$.ajax({
|
181
|
$.ajax({
|
|
@@ -200,7 +196,7 @@ |
|
@@ -200,7 +196,7 @@ |
200
|
$('#p_name').val(data.name)
|
196
|
$('#p_name').val(data.name)
|
201
|
if (data.sex==1){
|
197
|
if (data.sex==1){
|
202
|
$('#male').attr('checked','true')
|
198
|
$('#male').attr('checked','true')
|
203
|
- }else{
|
199
|
+ }else if(data.sex==2){
|
204
|
$('#female').attr('checked','true')
|
200
|
$('#female').attr('checked','true')
|
205
|
}
|
201
|
}
|
206
|
$('#phonesp').html(`${data.mobile}
|
202
|
$('#phonesp').html(`${data.mobile}
|
|
@@ -241,72 +237,27 @@ |
|
@@ -241,72 +237,27 @@ |
241
|
//图片路径设置为读取的图片
|
237
|
//图片路径设置为读取的图片
|
242
|
img.src = e.target.result;
|
238
|
img.src = e.target.result;
|
243
|
var formData = new FormData(document.getElementById('uploadimage'));
|
239
|
var formData = new FormData(document.getElementById('uploadimage'));
|
244
|
- // var formData = $('#uploadimage').submit();
|
|
|
245
|
- //
|
|
|
246
|
- // formData.append('file',file ); //添加图片信息的参数
|
|
|
247
|
- // formData.append('fileType','image' ); //添加图片信息的参数
|
240
|
+
|
248
|
//图片上传
|
241
|
//图片上传
|
249
|
|
242
|
|
250
|
var imgurl = document.getElementById("input_file").value;
|
243
|
var imgurl = document.getElementById("input_file").value;
|
251
|
|
244
|
|
|
|
245
|
+ var formData = new FormData();
|
|
|
246
|
+ formData.append("file", $("#input_file")[0].files[0]);
|
252
|
$.ajax({
|
247
|
$.ajax({
|
253
|
- type:"POST",
|
|
|
254
|
url: baseUrl+'user/index/upAvatar',
|
248
|
url: baseUrl+'user/index/upAvatar',
|
255
|
- dataType: 'json', //返回值类型 一般设置为json
|
|
|
256
|
- headers:{
|
|
|
257
|
- "XX-Device-Type":"1",
|
|
|
258
|
- "XX-Token":"1",
|
|
|
259
|
- },
|
|
|
260
|
- success: function(data) {
|
|
|
261
|
- alert(data.code + " " + data.msg);
|
|
|
262
|
- if(data.code == 200) {
|
|
|
263
|
- $("#headPic").attr("src", "/market/images/image.png");
|
|
|
264
|
- //将图片换成默认的+图片
|
249
|
+ type: 'post',
|
|
|
250
|
+ data: formData,
|
|
|
251
|
+ processData: false,
|
|
|
252
|
+ contentType: false,
|
|
|
253
|
+ success: function (res) {
|
|
|
254
|
+ avatar = res.data.url;
|
265
|
}
|
255
|
}
|
266
|
- }
|
|
|
267
|
-
|
|
|
268
|
});
|
256
|
});
|
269
|
-
|
|
|
270
|
- //建立一個可存取到該file的url
|
|
|
271
|
- function getObjectURL(file) {
|
|
|
272
|
- var url = null;
|
|
|
273
|
- if(window.createObjectURL != undefined) { // basic
|
|
|
274
|
- url = window.createObjectURL(file);
|
|
|
275
|
- } else if(window.URL != undefined) { // mozilla(firefox)
|
|
|
276
|
- url = window.URL.createObjectURL(file);
|
|
|
277
|
- } else if(window.webkitURL != undefined) { // webkit or chrome
|
|
|
278
|
- url = window.webkitURL.createObjectURL(file);
|
|
|
279
|
- }
|
|
|
280
|
- return url;
|
|
|
281
|
- }
|
|
|
282
|
};
|
257
|
};
|
283
|
reader.readAsDataURL(file);
|
258
|
reader.readAsDataURL(file);
|
284
|
}
|
259
|
}
|
285
|
- // function up_pic(img) {
|
|
|
286
|
- // // var formData = new FormData();
|
|
|
287
|
- // // var file=$('#input_file').files[0];
|
|
|
288
|
- // formData.append('file',file ); //添加图片信息的参数
|
|
|
289
|
- // formData.append('sizeid', 123); //添加其他参数
|
|
|
290
|
- // $.ajax({
|
|
|
291
|
- // url: baseUrl+'user/index/upAvatar',
|
|
|
292
|
- // type: 'POST',
|
|
|
293
|
- // cache: false, //上传文件不需要缓存
|
|
|
294
|
- // data:formData,
|
|
|
295
|
- // headers:{
|
|
|
296
|
- // "XX-Device-Type":"1",
|
|
|
297
|
- // "XX-Token":"1",
|
|
|
298
|
- // },
|
|
|
299
|
- // dataType: 'json',
|
|
|
300
|
- // processData: false, // 告诉jQuery不要去处理发送的数据
|
|
|
301
|
- // contentType: false, // 告诉jQuery不要去设置Content-Type请求头
|
|
|
302
|
- // success: function(data) {
|
|
|
303
|
- // alert('上传成功')
|
|
|
304
|
- // },
|
|
|
305
|
- // error: function(data) {
|
|
|
306
|
- // // alert("上传失败");
|
|
|
307
|
- // }
|
|
|
308
|
- // })
|
|
|
309
|
- // }
|
260
|
+
|
310
|
var level13;
|
261
|
var level13;
|
311
|
var level14;
|
262
|
var level14;
|
312
|
//获取文化程度接口
|
263
|
//获取文化程度接口
|
|
@@ -407,13 +358,66 @@ |
|
@@ -407,13 +358,66 @@ |
407
|
})
|
358
|
})
|
408
|
|
359
|
|
409
|
// 点击保存接口
|
360
|
// 点击保存接口
|
|
|
361
|
+ var avatar,p_name,name,sex,birthday,idcard,weight,marry,culture,job,medical;
|
410
|
$('.perbut').click(function () {
|
362
|
$('.perbut').click(function () {
|
|
|
363
|
+ var mobile = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/;
|
|
|
364
|
+ p_name = $('#p_name').val()
|
|
|
365
|
+ var val=$('input:radio[name="sex"]:checked').val();
|
|
|
366
|
+ if (val=='男'){
|
|
|
367
|
+ sex = '1';
|
|
|
368
|
+ } else if (val=='女'){
|
|
|
369
|
+ sex = '2';
|
|
|
370
|
+ }
|
|
|
371
|
+ if (!mobile.test($('#phonesp').val())) {
|
|
|
372
|
+ let loading = weui.loading('请填写正确手机号码')
|
|
|
373
|
+ setTimeout(function () {
|
|
|
374
|
+ loading.hide();
|
|
|
375
|
+ }, 1500);
|
|
|
376
|
+ }else {
|
|
|
377
|
+ phonesp = $('#phonesp').val()
|
|
|
378
|
+ }
|
|
|
379
|
+ beginTime = $('#beginTime').val()
|
|
|
380
|
+ id_card = $('#id_card').val()
|
|
|
381
|
+ person_height = $('#person_height').val()
|
|
|
382
|
+ weight = $('#weight').val()
|
|
|
383
|
+ culture_name = $('#culture_name').val()
|
|
|
384
|
+ job = $('#job').val()
|
|
|
385
|
+ medical_name = $('#medical_name').val()
|
|
|
386
|
+ if($('#marry').val()=='已婚'){
|
|
|
387
|
+ marry='1'
|
|
|
388
|
+ }else if ($('#marry').val()=='未婚'){
|
|
|
389
|
+ marry='0'
|
|
|
390
|
+ }
|
411
|
setPersonal()
|
391
|
setPersonal()
|
412
|
})
|
392
|
})
|
413
|
// 保存
|
393
|
// 保存
|
414
|
function setPersonal() {
|
394
|
function setPersonal() {
|
415
|
$.ajax({
|
395
|
$.ajax({
|
416
|
-
|
396
|
+ type:"POST",
|
|
|
397
|
+ url: baseUrl+'user/index/setPersonal',
|
|
|
398
|
+ dataType:"json",
|
|
|
399
|
+ headers:{
|
|
|
400
|
+ "XX-Device-Type":"1",
|
|
|
401
|
+ "XX-Token":"1",
|
|
|
402
|
+ },
|
|
|
403
|
+ data:{
|
|
|
404
|
+ rid: 1,
|
|
|
405
|
+ avatar: avatar,
|
|
|
406
|
+ name: p_name,
|
|
|
407
|
+ sex: sex,
|
|
|
408
|
+ mobile: phonesp,
|
|
|
409
|
+ birthday: beginTime,
|
|
|
410
|
+ idcard: id_card,
|
|
|
411
|
+ height: person_height,
|
|
|
412
|
+ weight: weight,
|
|
|
413
|
+ marry: marry,
|
|
|
414
|
+ culture: culture_name,
|
|
|
415
|
+ job: job,
|
|
|
416
|
+ medical: medical_name,
|
|
|
417
|
+ },
|
|
|
418
|
+ success:function (res) {
|
|
|
419
|
+ console.log(res)
|
|
|
420
|
+ }
|
417
|
})
|
421
|
})
|
418
|
}
|
422
|
}
|
419
|
</script>
|
423
|
</script>
|