|
@ -83,33 +83,37 @@ function getDoctorList(isInit){
|
|
|
|
|
|
function bindEvents(){
|
|
|
//搜索框事件
|
|
|
$(".inp-search").on("input",function(e){
|
|
|
if($(this).prop('comstart')) {
|
|
|
//console.log("true");
|
|
|
return;
|
|
|
}
|
|
|
var text = $(this).val().trim();
|
|
|
$searchtResult.hide();
|
|
|
showSearchSuggest(text);
|
|
|
//如果有部门信息
|
|
|
if(text != deptName){
|
|
|
deptId = '';
|
|
|
}
|
|
|
if(text){
|
|
|
$searchCancelBtn.show();
|
|
|
$searchCancelBtn.css("opacity","1");
|
|
|
}else{
|
|
|
$searchCancelBtn.hide();
|
|
|
$searchCancelBtn.css("opacity","0");
|
|
|
mui(".mui-scroll-wrapper").pullRefresh().refresh(true);
|
|
|
getDoctorList(true);
|
|
|
}
|
|
|
}).on('compositionstart', function(){
|
|
|
$(".inp-search").on('compositionstart', function(){
|
|
|
$(this).prop('comstart', true);
|
|
|
//console.log('中文输入:开始');
|
|
|
}).on('compositionend', function(){
|
|
|
$(this).prop('comstart', false);
|
|
|
// console.log('中文输入:结束');
|
|
|
}).on("input",function(e){
|
|
|
var $this = $(this);
|
|
|
setTimeout(function(){
|
|
|
if($this.prop('comstart')) {
|
|
|
//console.log("true");
|
|
|
return;
|
|
|
}
|
|
|
var text = $this.val().trim();
|
|
|
$searchtResult.hide();
|
|
|
showSearchSuggest(text);
|
|
|
//如果有部门信息
|
|
|
if(text != deptName){
|
|
|
deptId = '';
|
|
|
}
|
|
|
if(text){
|
|
|
$searchCancelBtn.show();
|
|
|
$searchCancelBtn.css("opacity","1");
|
|
|
}else{
|
|
|
$searchCancelBtn.hide();
|
|
|
$searchCancelBtn.css("opacity","0");
|
|
|
mui(".mui-scroll-wrapper").pullRefresh().refresh(true);
|
|
|
getDoctorList(true);
|
|
|
}
|
|
|
}, 0)
|
|
|
|
|
|
})
|
|
|
|
|
|
//取消事件
|