...
|
...
|
@@ -121,6 +121,8 @@ |
|
|
</style>
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
$('.mask_box').hide()
|
|
|
$('.form_popup_box').hide()
|
...
|
...
|
@@ -129,6 +131,36 @@ $(document).ready(function () { |
|
|
//获取短信验证码
|
|
|
var validCode = true;
|
|
|
$(".getCode").click(function () {
|
|
|
/*验证信息*/
|
|
|
var phone_num = $('#phone_num').val();
|
|
|
if (phone_num == '') {
|
|
|
$('.form_popup_box').show()
|
|
|
$('.form_popup_box').text('手机号不能为空')
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
url:'{:url('sendVerifyCode')}',
|
|
|
type:'POST',
|
|
|
data:{
|
|
|
tel:phone_num
|
|
|
},
|
|
|
success:function(res) {
|
|
|
console.log(res)
|
|
|
if (res.code==1){
|
|
|
$('.form_popup_box').show()
|
|
|
$('.form_popup_box').text('验证码发送成功')
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
} else {
|
|
|
$('.form_popup_box').show()
|
|
|
$('.form_popup_box').text(res.msg)
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
var time = 60;
|
|
|
var $code = $(this);
|
|
|
if (validCode) {
|
...
|
...
|
@@ -152,76 +184,117 @@ $(document).ready(function () { |
|
|
</volist>
|
|
|
], {
|
|
|
onChange: function (res) {
|
|
|
console.log(res)
|
|
|
$('#hospital').val('')
|
|
|
$('#department').val('')
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
console.log('11111');
|
|
|
var platform=$('#platform').val(res[0].label)
|
|
|
console.log(platform);
|
|
|
console.log(res);
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
$('.hospital_item').click(function () {
|
|
|
var platform=$('#platform').val(res[0].label)
|
|
|
$('#platform').data('data-id',res[0].value)
|
|
|
var platform=res[0].value;
|
|
|
$.ajax({
|
|
|
url:'{:url('getHospital','','',true)}',
|
|
|
type:'POST',
|
|
|
data:{
|
|
|
'platform':platform,
|
|
|
},
|
|
|
success:function(res){
|
|
|
$('.hospital_item').click(function () {
|
|
|
|
|
|
console.log($('.platform_item').html())
|
|
|
weui.picker([
|
|
|
var hospital=new Array();
|
|
|
for(var i=0;i<res.data.length;i++){
|
|
|
var one=new Object();
|
|
|
one.value=res.data[i].hospital_id;
|
|
|
one.label=res.data[i].hospital_name;
|
|
|
hospital.push(one)
|
|
|
}
|
|
|
weui.picker(
|
|
|
hospital
|
|
|
, {
|
|
|
onChange: function (res) {
|
|
|
$('#department').val('')
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('#hospital').val(res[0].label)
|
|
|
$('#hospital').data('data-id',res[0].value)
|
|
|
console.log(res)
|
|
|
var hospital_id=res[0].value;
|
|
|
$.ajax({
|
|
|
url:'{:url('getOffice','','',true)}',
|
|
|
type:'POST',
|
|
|
data:{
|
|
|
'platform_id':platform,
|
|
|
'hospital_id':hospital_id,
|
|
|
},
|
|
|
success:function(res){
|
|
|
$('.department_item').click(function () {
|
|
|
|
|
|
{label: '医院1', value: 0},
|
|
|
{label: '医院2', value: 1},
|
|
|
{label: '医院3', value: 2},
|
|
|
var office=new Array();
|
|
|
for(var i=0;i<res.data.length;i++){
|
|
|
var one=new Object();
|
|
|
one.value=res.data[i].office_id;
|
|
|
one.label=res.data[i].office_name;
|
|
|
office.push(one)
|
|
|
}
|
|
|
|
|
|
weui.picker(office, {
|
|
|
onChange: function (res) {
|
|
|
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('#department').val(res[0].label)
|
|
|
$('#department').data('data-id',res[0].value)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
|
|
|
], {
|
|
|
onChange: function (res) {
|
|
|
console.log(res)
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('#hospital').val(res[0].label)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
$('.department_item').click(function () {
|
|
|
weui.picker([
|
|
|
{label: '科室1', value: 0},
|
|
|
{label: '科室2', value: 1},
|
|
|
{label: '科室3', value: 2},
|
|
|
], {
|
|
|
onChange: function (res) {
|
|
|
console.log(res)
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('#department').val(res[0].label)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
|
|
|
|
|
|
$('.position_item').click(function () {
|
|
|
weui.picker([
|
|
|
{label: '职务1', value: 0},
|
|
|
{label: '职务2', value: 1},
|
|
|
{label: '职务3', value: 2},
|
|
|
<volist name='jobs' id='vo'>
|
|
|
{label: '{$vo.name}', value: {$vo.id}},
|
|
|
</volist>
|
|
|
], {
|
|
|
onChange: function (res) {
|
|
|
console.log(res)
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('#position').val(res[0].label)
|
|
|
$('#position').data('data-id',res[0].value)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
|
|
|
$('.register_btn').click(function () {
|
|
|
var platform=$('#platform').data('data-id')
|
|
|
var hospital=$('#hospital').data('data-id')
|
|
|
var office=$('#department').data('data-id')
|
|
|
var position=$('#position').data('data-id')
|
|
|
|
|
|
|
|
|
var user_name = $('#user_name').val()
|
|
|
var phone_num = $('#phone_num').val()
|
|
|
var verify_code = $('#verify_code').val()
|
|
|
var platform = $('#platform').val()
|
|
|
var hospital = $('#hospital').val()
|
|
|
var department = $('#department').val()
|
|
|
var position = $('#position').val()
|
|
|
// var platform = $('#platform').val()
|
|
|
// var hospital = $('#hospital').val()
|
|
|
// var department = $('#department').val()
|
|
|
// var position = $('#position').val()
|
|
|
var province = $('#province').val()
|
|
|
var city = $('#city').val()
|
|
|
var town = $('#town').val()
|
...
|
...
|
@@ -235,7 +308,7 @@ $(document).ready(function () { |
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
} else if (verify_code == '') {
|
|
|
$('.form_popup_box').show()
|
|
|
$('.form_popup_box').text('密码不能为空')
|
|
|
$('.form_popup_box').text('验证码码不能为空')
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
} else if (platform == '') {
|
|
|
$('.form_popup_box').show()
|
...
|
...
|
@@ -258,7 +331,7 @@ $(document).ready(function () { |
|
|
$('.form_popup_box').text('省份不能为空')
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
} else if (city == '请选择') {
|
|
|
$('.form_popup_box').show()
|
|
|
|
|
|
$('.form_popup_box').text('城市不能为空')
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
} else if (town == '请选择') {
|
...
|
...
|
@@ -266,11 +339,36 @@ $(document).ready(function () { |
|
|
$('.form_popup_box').text('区县不能为空')
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
} else {
|
|
|
$('.success').show().delay(2000).hide(2)
|
|
|
// $('.first').show().delay(2000).hide(2)
|
|
|
// setTimeout(function () {
|
|
|
// $('.success').show().delay(2000).hide(2)
|
|
|
// },2000);
|
|
|
$.ajax({
|
|
|
url:'{:url('registerPost')}',
|
|
|
type:'POST',
|
|
|
data:{
|
|
|
platform:platform,
|
|
|
hospital:hospital,
|
|
|
office:office,
|
|
|
user_name:user_name,
|
|
|
tel:phone_num,
|
|
|
verify_code:verify_code,
|
|
|
job:position,
|
|
|
province:province,
|
|
|
city:city,
|
|
|
town:town,
|
|
|
},
|
|
|
success:function(res) {
|
|
|
console.log(res)
|
|
|
if (res.code==1){
|
|
|
$('.success').show().delay(2000).hide(2);
|
|
|
window.location.href='{:url('/')}'
|
|
|
}else {
|
|
|
$('.form_popup_box').show()
|
|
|
$('.form_popup_box').text(res.msg)
|
|
|
$('.form_popup_box').delay(1000).hide(0);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
)
|
...
|
...
|
|