(function ($) { function Page(option) { this.init(); } Page.prototype = { //初始化 init: function () { this.initServiceInfo(); }, initServiceInfo: function(){ var itemCode = this.GetQueryString('itemCode'); var loading = dialog({contentType:'load', skin:'bk-popup'}); loading.show(); sendPost("/patient/sign/service/getItemByItemCode", {itemCode: itemCode}, "json", "get", function(){ }, function(res){ loading.close(); if(res.status == 200){ var data = res.data; $('.view').html(''); var aHtml = ''; if(itemCode == '1'){ aHtml = '立即检查'; } if(itemCode == '2'){ aHtml = '立即拨打' } var html = '
' +' '; $('.view').append(html); }else{ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败!'+res.msg}).show(); } }); }, GetQueryString: function(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } }; $(document).ready(function () { var page = new Page(); }); })(jQuery);