exclusive-service.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var loading = dialog({contentType:'load', skin:'bk-popup'});
  2. (function ($) {
  3. function Page(option) {
  4. this.init();
  5. }
  6. Page.prototype = {
  7. //初始化
  8. init: function () {
  9. var $this = this
  10. this.initMenu($this);
  11. },
  12. //事件相关处理
  13. initEvent: function () {
  14. $('#service_list').on('click','.es-li',function(){
  15. var $id = $(this).attr('data-id');
  16. if($id == 1){
  17. dialog({
  18. content:'0592-6708090' ,
  19. okValue:'立即拨号',
  20. ok: function (){
  21. window.location.href="tel:05926708090";
  22. },
  23. cancelValue: '不了,谢谢',
  24. cancel: function () {
  25. return;
  26. }
  27. }).showModal();
  28. }
  29. if($id == 2){
  30. window.location.href='medical-examination.html';
  31. }
  32. if($id == 3){
  33. window.location.href='../../jmxj/html/jiankangxuanjiao.html';
  34. }
  35. })
  36. },
  37. initMenu: function($this){
  38. sendPost("/patient/sign/service/getPatientService", '', "json", "get",function(){
  39. loading.close();
  40. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  41. }, function(res){
  42. loading.close();
  43. if(res.status == 200){
  44. var dataList = res.data.serviceItem;
  45. if(dataList && dataList.length>0){
  46. var html = template('list_tmp',{data:dataList})
  47. $('#service_list').html(html)
  48. $this.initEvent();
  49. $('.view').show()
  50. }else{
  51. window.location.href='./expectancy-page.html';
  52. }
  53. }else{
  54. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  55. }
  56. })
  57. }
  58. }
  59. $(document).ready(function () {
  60. loading.show();
  61. var page = new Page();
  62. });
  63. })(jQuery);