1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- (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 = '<a href="./medical-examination.html">立即检查</a>';
- }
- if(itemCode == '2'){
- aHtml = '<a href="tel:'+data.mobile.replace('-','')+'">立即拨打</a>'
- }
- var html = '<div class="page-content btn-toolbar">'
- +'<div class="service-detail-header">'
- +'<a href="#">'
- +'<img src="'+ getImgUrl(data.image)+'" alt="">'
- +'</a>'
- +'</div>'
- +'<div class="service-detail-content">'
- +'<div class="title">'
- + data.name
- +'</div>'
- +'<div class="content">'
- +'<div class="subtitle">'
- + data.subName
- +'</div>'
- + data.introduce
- +'</div>'
- +'</div>'
- +'</div>'
- +'<div class="btn-bar">'
- + aHtml
- +'</div>';
- $('.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);
|