creatBaodan.html 3.5 KB
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>绑定手机</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/mui.picker.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/swiper.min.css"/>
		<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_550254_r6pua542e96vquxr.css"/>
		<link rel="stylesheet" type="text/css" media="screen" href="css/base.css" />
		<script src="js/base.js"></script>
	</head>

	<body>
		<div class="container bind_container">
			<ul class="add_input_items "> 
				<li class="add_input_item double">
					<div class="product_num">
						<span class="input_label">产品序列号:</span>
						<input class="item_input_single" name="xulie" type="text" placeholder="输入产品序列号" />
					</div>
					<div class="scan iconfont icon-saoma"></div>
				</li> 
				<li class="add_input_item"> 
					<span class="input_label">手机串号:</span>
					<input class="item_input_single" name="chuan" type="text" placeholder="请输入手机串号" />
				</li>
				<li class="mui-icon add_input_item buy_time">
					<span class="input_label">手机购买时间:</span>
					<input class="item_input_single" type="text" name="time" unselectable="on" onfocus="this.blur()" placeholder="请选择手机购买时间" id="date_picker" readonly="readonly"/>
				</li>
				<li class="add_input_item">
					<span class="input_label">产品购买价格:¥</span>
					<input class="item_input_single" type="text" name="price"  placeholder="请输入产品价格"/>
				</li>
			</ul>
			
		</div>  
		<!--底部-->
		<div class="nav_bottom make_sure" >
			下一步
		</div>
		<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
		<script type="text/javascript" src="js/mui.min.js"></script>
		<script type="text/javascript" src="js/mui.picker.min.js" ></script>
		<script type="text/javascript" src="js/swiper.min.js" ></script>
		<script> 
			mui.init()

			//时间组件
			document.getElementById('date_picker').addEventListener('tap',function(){
				var optionsJson = this.getAttribute('data-options') || '{}';
				var options = JSON.parse(optionsJson);
				var id = this.getAttribute('id');
				var end_date = new Date();
				
				var picker = new mui.DtPicker({
				    type: "date",//设置日历初始视图模式 
//				    beginDate: new Date(),//设置开始日期 
				    endDate: end_date,//设置结束日期 
				    labels: ['年', '月', '日'],//设置默认标签区域提示语 
				}) 
				picker.show(function(rs) {
					document.getElementById('date_picker').value = rs.text;
					picker.dispose();
				});
			})
			//提交操作
			mui('body').on('tap','.make_sure',function(){
				var confirm = true;
				$('.item_input_single').each(function(el,inbdex){
					var val = this.value;
					if(val==''||typeof val == 'undefined'){
						if(this.name=='xulie'||this.name=='chuan'){
							mui.toast(this.placeholder);
							confirm = false;
							return false;
						}
					}
				})
				if(confirm){
					var items = document.querySelectorAll('.item_input_single');
					var params = {
						'xuelie': items[0].value,
						'chuan':items[1].value,
						'time':items[2].value,
						'price':items[3].value
					}
					console.log(params)
					mui.openWindow('erweima.html');
				}
			})
		</script>
	</body>

</html>