|
@ -27,6 +27,9 @@ $(function(){
|
|
|
|
|
|
function queryInit(){
|
|
|
initScroller();
|
|
|
if(deptId){
|
|
|
$(".inp-search").val(deptName);
|
|
|
}
|
|
|
getDoctorList(true);
|
|
|
bindEvents();
|
|
|
getTemplateHelper();
|
|
@ -47,14 +50,14 @@ function getDoctorList(isInit){
|
|
|
sendPost(url, params, 'JSON', 'GET', queryFailed, function(res){
|
|
|
if(res.status == 200){
|
|
|
d.close();
|
|
|
if(deptId){
|
|
|
$(".inp-search").val(deptName);
|
|
|
}
|
|
|
var list = res.list;
|
|
|
if(list.length>0){
|
|
|
page ++;
|
|
|
var html = template("doc-tmp", {list: list});
|
|
|
if(isInit){
|
|
|
$(".main").show();
|
|
|
$(".div-content").show();
|
|
|
$(".div-no-search-info").hide();
|
|
|
$("#docList").empty().append(html);
|
|
|
}else{
|
|
|
$("#docList").append(html);
|
|
@ -81,16 +84,21 @@ function getDoctorList(isInit){
|
|
|
|
|
|
function bindEvents(){
|
|
|
//搜索框事件
|
|
|
$(".inp-search").on("input",function(){
|
|
|
$(".inp-search").on("input",function(e){
|
|
|
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);
|
|
|
}
|
|
|
});
|