MUI 之picker,dialog,a标签——刷新页面问题(保留picker选中的数据)

a标签问题

<div class="stepBtnBox1 stepBtnBox ">
  <a class="before-btn" href="order-step1.html">上一步</a>
  <a id='alertBtn' class="on next-btn" >下一步</a>
  //点击a标签使得页面不刷新的两种方法
  //(1直接去掉href;)
  //(2在href属性后面加上javascript:void(0);)
</div>
dialog提示框问题(alert警告框,confirm确认框,prompt输入对话框,toast自动消失框参考exp里面的dialog.html页面)
 document.getElementById("alertBtn").addEventListener('tap', function(){
  var href="order-step3.html";
picker下拉框选取数据问题(切换页面显示input框)
  if($("#picker1").val()=="不动产权证号"){
    if($(".input-true").val()==""){
      //mui自带提示框语句
      //3个参数:提示内容,提示标题,返回函数;
      //如果运用在手机上,一个参数都不能少,如果缺少参数用浏览器操作不会出现任何bug,但是手机不会显示出弹出框
      mui.alert('请查看权证号图例', '请输入不动产权证号', function() {
        $("#numInput1").focus();
      });	
    }else{
      $(this).attr("href",href);	
    }
  }
  if($("#picker1").val()=="老权证号"){
    if($("#numInput2").val()==""){
      mui.alert('请查看权证号图例', '请输入土地证号', function() {
        $("#numInput2").focus();
      });	
    }else if($("#numInput3").val()==""){

      mui.alert('请查看权证号图例', '请输入房地产证号', function() {
        $("#numInput3").focus();
      });	
    }else{
      $(this).attr("href",href);	
    }
   }
  if($("#picker1").val()=="其它"){
    $(this).attr("href",href);	
  }
}); 

  

 
DO What You Want !
原文地址:https://www.cnblogs.com/liumengdie/p/7831450.html