• MUI自定义select down 下拉框


    //一级联动数据
    var data1=[ {value:'01',text:'身份证'}, {value:'02',text:'学生证'}, {value:'03',text:'护照'}, {value:'03',text:'驾照'} ];
    //二级联动数据
    var data2=[
    	{
    		value:'01',
    		text:'按样品名称分类',
    		children:[
    			{value:'0101',text:'苹果'},
    			{value:'0102',text:'梨子'},
    			{value:'0103',text:'香蕉'},
    			{value:'0104',text:'菠萝'},
    			{value:'0105',text:'桃子'}
    		]
    	},
    	{
    		value:'02',
    		text:'按样品所在商城分',
    		children:[
    			{value:'0201',text:'天猫'},
    			{value:'0202',text:'淘宝'},
    			{value:'0203',text:'苏宁'},
    			{value:'0204',text:'京东'}
    		]
    	},
    	{
    		value:'03',
    		text:'按样品大小分',
    		children:[
    			{value:'0301',text:'小的'},
    			{value:'0302',text:'中等'},
    			{value:'0303',text:'大的'}
    		]
    	},
    ];
    //三级联动数据
    var data3=[
    	{
    		value: '110000',
    		text: '北京市',
    		children:[
    			{
    				value: "0101",
    				text: "北京市",
    				children:[
    					{value: "110101",text: "东城区"},
    					{value: "110230",text: "其它区"}
    				]
    			}
    		]
    	},
    	{
    		value: '120000',
    		text: '天津市',
    		children:[
    			{
    				value: "120100",
    				text: "天津市",
    				children:[
    					{value: "120101",text: "和平区"},
    					{value: "120226",text: "其它区"}
    				]
    			}
    		]
    	},
    	{
    		value: '130000',
    		text: '河北省',
    			children:[
    				{
    					value: "130100",
    					text: "石家庄市",
    					children: [
    						{value: "130102",text: "长安区"}, 
    						{value: "130103",text: "桥东区"},
    						{value: "130104",text: "桥西区"}, 
    						{value: "130186",text: "其它区"}
    					]
    				},	
    
    			]
    	}
    ];
    
    function dataPicker(data,layerNum,pickerObj){
      var dataPicker=new mui.PopPicker({ layer:layerNum });
      var resultObj=pickerObj.getElementsByTagName("input")[0];
      dataPicker.setData(data);
      dataPicker.show(function(items){
        if(layerNum==1){
          resultObj.setAttribute("value",items[0].text); tabCheck();
        }
        if(layerNum==2){
          resultObj.setAttribute("value",items[0].text+ " " + items[1].text);
        }
        if(layerNum==3){
          resultObj.setAttribute("value",items[0].text+ " " + items[1].text+" "+ items[2].text);
        }
      });
    
    }
    
    function timePicker(pickerObj){
      var optionJson=pickerObj.getAttribute('data-options') || '{}';
      var options=JSON.parse(optionJson);
      var timePicker = new mui.DtPicker(options);
      var resultObj=pickerObj.getElementsByTagName("input")[0];
      timePicker.show(function(rs){
        resultObj.setAttribute("value",rs.text);
        timePicker.dispose();
      });
    }
    
    function tabCheck(){
      if($("#picker1").val()=="不动产权证号"){
        $(".check1").show();
        $(".check2").hide();
        $(".exampleBox").show();
        $(".exampleBox").find("a").attr("href","#img-pop1");
      }else if($("#picker1").val()=="老权证号"){
        $(".check1").hide(); $(".check2").show();
        $(".exampleBox").show();
        $(".exampleBox").find("a").attr("href","#img-pop2");
      }else{
        $(".check1").hide();
        $(".check2").hide();
        $(".exampleBox").hide();
      }
    }
    

      

    DO What You Want !
  • 相关阅读:
    Lua语言基础汇总(9)-- Lua中__index和__newindex实践
    Lua语言基础汇总(8) -- Lua中的元表与元方法
    Lua语言基础汇总(7) -- 协同程序
    Lua语言基础汇总(6)-- 迭代器与泛型for
    Lua语言基础汇总(5) -- 闭包
    【NOIP2005提高组T2】过河-DP+路径压缩
    【NOIP2005提高组T2】过河-DP+路径压缩
    【NOIP2002提高组T2】字串变换-双向BFS或迭代加深搜索
    【NOIP2002提高组T2】字串变换-双向BFS或迭代加深搜索
    【NOIP2001提高组T2】数的划分-DP
  • 原文地址:https://www.cnblogs.com/liumengdie/p/7826817.html
Copyright © 2020-2023  润新知