| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 | 
							- var xtCode,
 
- 	dealState,// 处理结果
 
-     xtType; //记录是哪种协同服务
 
- var $text = $('#show_content');
 
- mui.plusReady(function(){
 
-     var self = plus.webview.currentWebview();
 
-     xtCode = self.code;
 
-     xtType = self.type;
 
-     queryData()
 
- })
 
- function queryData(){
 
- 	plus.nativeUI.showWaiting();
 
- 	sendGet("doctor/pcCustomer/getCallServiceInfo",{code:xtCode}, function(){
 
- 		plus.nativeUI.closeWaiting();
 
- 		mui.toast("请求失败");
 
- 	}, function(res){
 
- 		plus.nativeUI.closeWaiting();
 
- 		if(res.status == 200){
 
- 			var html = template('text_tmp',{data:res.data})
 
- 			dealState = res.data.callService.dealState
 
- 			$text.html(html)
 
- 			bindEvents();
 
- 		}else{
 
- 			mui.toast("获取数据失败");
 
- 		}
 
- 	})
 
- }
 
- function bindEvents(){
 
-     $('.call-btn').on('click',function(){
 
-     	var moblie = $(this).attr("data-tel");
 
- 	    //观察者模式下,不可以拨打被观察者患者的电话
 
- 	    var userAgent = plus.navigator.getUserAgent(),
 
- 	        index = userAgent.indexOf("}"),
 
- 	        s = userAgent.substr(0, index+1),
 
- 	        item = JSON.parse(s);
 
- 	    if(item.observer){
 
- 	        mui.toast("观察者模式无法拨打患者电话");
 
- 	    }else{
 
- 			if(moblie){
 
- 			 	dialog({
 
- 				    content: moblie,
 
- 				    okValue:'立即拨号',
 
- 				    ok: function (){				            		
 
- 				      	window.location.href = "tel:"+moblie;
 
- 				    },
 
- 				    cancelValue: '不了,谢谢',
 
- 				    cancel: function () {
 
- 						return;
 
- 				    }
 
- 				 }).showModal();
 
- 			}
 
- 		}
 
- 	})
 
-     $('#handle').on('click',function(){
 
-     	var $this = $(this)
 
-     	if($this.attr('data-type')==1){
 
-     		mui.openWindow({
 
- 				id: "appointment-register",
 
- 				url: "../../wdyy/html/appointment-register.html",
 
- 				extras: {
 
- 					patient:$this.attr('data-patient'),
 
- 					xtCode:xtCode
 
- 				}
 
- 			})
 
-     	}else{
 
-     		mui.openWindow({
 
- 				id: "xietongfuwu-deal",
 
- 				url: "xietongfuwu-deal.html",
 
- 				extras: {
 
- 					type:$this.attr('data-type'),
 
- 					code:xtCode
 
- 				}
 
- 			})
 
-     	}
 
-     })
 
- }
 
- template.helper('setDealState',function(item){
 
- 	if(item == 1){return '完成'}
 
- 	if(item == 2){return '无法联系'}
 
- })
 
- template.helper('setDealType',function(item){
 
- 	if(item == 1){return '电话回复'}
 
- 	if(item == 2){return '客服回复'}
 
- })
 
- template.helper('setDealState2',function(item){
 
- 	return '无法预约'
 
- })
 
- template.helper('setDealReason',function(item){
 
- 	if(item == 1){return '没有号源'}
 
- 	if(item == 2){return '病人取消'}
 
- })
 
 
  |