fp-search-more.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var myScroll, checked= {}, num = 0, type,
  2. docCode, teamCode, self, curDocCode;
  3. mui.plusReady(function(){
  4. self = plus.webview.currentWebview();
  5. docCode = self.docCode;
  6. teamCode = self.teamCode;
  7. type = self.type;
  8. num = self.num;
  9. checked = self.checked;
  10. searchVal = self.val;
  11. curDocCode = getUid();
  12. refreshTotal();
  13. myScroll = $('#lscroller .doc-list').lscroll({style: "top: 50px;bottom: 48px",
  14. pullUpAction: function(g){
  15. getDfpPatiLs(g.options.page);
  16. }
  17. });
  18. getDfpPatiLs(1);
  19. resetBack();
  20. })
  21. var old_back;
  22. function resetBack(){
  23. old_back = mui.back;
  24. mui.back = function(){
  25. mui.fire(self.opener(), "updateCheck", {num: num, checked: checked})
  26. mui.later(function(){
  27. old_back();
  28. }, 200)
  29. }
  30. }
  31. template.helper("isChecked", function(code){
  32. if(checked[code])
  33. return "checked";
  34. })
  35. function getDfpPatiLs(page){
  36. plus.nativeUI.showWaiting();
  37. var p = type == "sx" ?
  38. {doctor: curDocCode, page: page, pageSize: 50, patientName: searchVal} :
  39. {doctor: curDocCode, page: page, pageSize: 50, patientAddr: searchVal};
  40. sendGet("/doctor/family_contract/findNoHealthSignFamilyHealth",
  41. p, null, function(res){
  42. if(res.status == 200){
  43. console.log(JSON.stringify(res))
  44. if(page==1 && (!res.data.list || res.data.list.length==0)){
  45. $('#wushuju').show();
  46. $('.lin-footer').hide();
  47. $('#lscroller').hide();
  48. } else {
  49. $('#allSel').removeClass("checked").next().html("全选");
  50. var allPage = res.data.count;
  51. res.data = res.data.list;
  52. res.type = type;
  53. $('#lscroller .doc-list').append(html_encode(template('pati_tmpl', res)));
  54. myScroll.refresh(page >= allPage);
  55. }
  56. plus.nativeUI.closeWaiting();
  57. } else
  58. mui.toast(res.msg)
  59. })
  60. }