123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- var self,
- idCard,
- state;
- mui.plusReady(function(){
- self = plus.webview.currentWebview();
- state = self.state;
- idCard = self.idCard;
- //返回事件
- mui.back = function(){
- backAction();
- }
- plus.nativeUI.showWaiting();
- sendGet("doctor/patient/getPatientSignFamily",{idcard:idCard}, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败");
- }, function(res){
- if(res.status == 200){
- var patientMsg = res.data;
- if(res.data.SignFamily.status>0){
- sendGet("doctor/admin-teams/team/members/"+res.data.SignFamily.patient,{}, null, function(res) {
- plus.nativeUI.closeWaiting();
- if(res.status == 200){
- var html = template('list_tmp',{data:[patientMsg,res.data],state:state})
- $(".c-main").html(html)
- bindEvent()
- }else{
- mui.toast('获取数据失败')
- }
- })
- }else{
- plus.nativeUI.closeWaiting();
- var html = template('list_tmp',{data:[patientMsg,{}],state:state})
- $(".c-main").html(html)
- bindEvent()
- }
-
- // Promise.all([peosonalMsg(res.data.code),teamMsg(res.data.code)]).then(function(datas){
- // plus.nativeUI.closeWaiting();
- // console.log(datas)
- // })
- }
- })
- //请求数据
- // function peosonalMsg(code){
- // return new Promise(function(resolve, reject){
- // sendGet("doctor/patient_group/patient", {code: code}, null, function(res) {
- // if(res.status == 200){
- // resolve(res.data)
- // }else{
- // plus.nativeUI.closeWaiting();
- // mui.toast('获取数据失败')
- // return
- // }
- // })
- // })
- // }
- // function teamMsg(code){
- // return new Promise(function(resolve, reject){
- // sendGet("doctor/admin-teams/team/members/"+code,{}, null, function(res) {
- // if(res.status == 200){
- // resolve(res.data)
- // }else{
- // plus.nativeUI.closeWaiting();
- // mui.toast('获取数据失败')
- // return
- // }
- // })
- // })
- // }
- function bindEvent(){
- $(".jm-btn").on('tap',function(){
- mui.openWindow({
- id: "jumindangan",
- url: "jumindangan.html",
- extras: {
- idCard:idCard,
- state:1
- }
- })
- })
- $(".jm-btn2").on('tap',function(){
- mui.openWindow({
- id: "zizhujiandang",
- url: "zizhujiandang.html",
- extras: {
- state:-1,
- name:self.name,
- idCard:self.idCard
- }
- })
- })
- }
- //关闭页面
- function backAction(){
- var jmda = plus.webview.getWebviewById('jumindangan');
- var dljd = plus.webview.getWebviewById('dailijiandang');
- if(dljd){dljd.close('none')}
- if(jmda){jmda.close('none')}
- mui.later(function(){
- self.close()
- }, 300);
- }
- })
- template.helper("setPhoto", function(p) {
- return getImgUrl(p);
- })
- template.helper("setSex", function(p) {
- if(p==1){return '男'}
- if(p==2){return '女'}
- })
- template.helper("setExpenses", function(p) {
- if(p=='01'){return '无补贴'}
- if(p=='02'){return '全补贴'}
- if(p=='03'){return '补个人承担部分(20)'}
- if(p=='04'){return '补统筹基金(70)'}
- })
- template.helper("setServer", function(o) {
- if(o.length>0){
- var arr = []
- $.map(o,function(item){
- arr.push(item.server_type_name)
- })
- return arr.join(',')
- }else{
- return ''
- }
- })
|