var self, dataBase, state; mui.plusReady(function(){ self = plus.webview.currentWebview(); state = self.state; // 获取字典 plus.nativeUI.showWaiting() sendGet('doctor/patient/getArchiveComboList', {},function(){ plus.nativeUI.closeWaiting(); mui.toast('请求失败') }, function(res) { plus.nativeUI.closeWaiting(); if (res.status==200) { dataBase = res.data; var html = template('list_tmp',{data:dataBase}) $('.c-main').html(html) bindEvent() }else{ mui.toast('获取数据失败') } }) function bindEvent(){ $('.xc-li-more .one').on('click',function(e){ e.stopPropagation(); var $this = $(this) $this.addClass('active').siblings().removeClass('active') var $parent = $this.closest('.xc-li-more'); if($this.attr('data-id')==1){ $parent.find('.xc-li-radio').show() }else{ $parent.find('.xc-li-radio').hide() $parent.find('.child').removeClass('active') $parent.find('input').val('') $parent.find('input.j-hide').hide() $parent.find('select.sickSel').attr('data-code','') $parent.find('select.sickSel').attr('data-name','') if($parent.hasClass('j-family')){ addContent5(dataBase.familyHistory)//初始化 } } }) $(".j-checkbox").on('tap',function(){ var $this = $(this).parent() if($this.hasClass('active')){ $this.removeClass('active') }else{ $this.addClass('active') } }) $(".j-showbox").on('click',function(){ var $this = $(this).parent() if($this.hasClass('active')){ $this.removeClass('active') $this.find('input').hide() $this.find('input').val('') }else{ $this.addClass('active') $this.find('input').css('display','block') } }) //提交 $(".jm-btn").on('tap',function(){ var $gen = $('.j-gen').find('.one.active').attr('data-id'), $past = $('.j-past').find('.one.active').attr('data-id'), $drug = $('.j-drug').find('.one.active').attr('data-id'), $family = $('.j-family').find('.one.active').attr('data-id'); function getCode($id){ var that = $id.find('.j-noOther.active') var codeArr=[]; for(var i=0;i' + arr[i].value + '' } $('#schoolSel').html(html) $('#schoolSel').mobiscroll().select({ theme: "ios", lang: "zh", placeholder:'请选择文化程度', display: "bottom", onSelect: function(valueText, inst) { $('#school').attr('data-code',inst._tempValue) $('#school').attr('data-name',valueText) } }) } function addContent2(arr) { var len = arr.length; var html = ""; for(var i = 0; i < len; i++) { html += '' } $('#jobSel').html(html) $('#jobSel').mobiscroll().select({ theme: "ios", lang: "zh", placeholder:'请选择职业', display: "bottom", onSelect: function(valueText, inst) { $('#job').attr('data-code',inst._tempValue) $('#job').attr('data-name',valueText) } }) } function addContent3(arr) { var len = arr.length; var html = ""; for(var i = 0; i < len; i++) { html += '' } $('#paySel').html(html) $('#paySel').mobiscroll().select({ theme: "ios", lang: "zh", placeholder:'请选择支付方式', display: "bottom", onSelect: function(valueText, inst) { $('#pay').attr('data-code',inst._tempValue) $('#pay').attr('data-name',valueText) } }) } function addContent4(arr) { var len = arr.length; var html = ""; for(var i = 0; i < len; i++) { html += '' } $('#disabilitySel').html(html) $('#disabilitySel').mobiscroll().select({ theme: "ios", lang: "zh", placeholder:'请选择残疾情况', display: "bottom", onSelect: function(valueText, inst) { $('#disability').attr('data-code',inst._tempValue) $('#disability').attr('data-name',valueText) } }) } function addContent5(arr) { for(var i=0;i<$('.j-sel').length;i++){ var $this = $('.j-sel').eq(i).find('.sickSel'); var len = arr.length; var html = ""; for(var j = 0; j < len; j++) { html += '' } $this.html(html) $this.mobiscroll().select({ theme: "ios", lang: "zh", placeholder:'请选择疾病类型', display: "bottom", onSelect: function(valueText, inst) { $(this).attr('data-code',inst._tempValue) $(this).attr('data-name',valueText) } }) } } })