picker.html 3.15 KB
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="format-detection" content="telephone=no" />
	<meta name="msapplication-tap-highlight" content="no" />
	<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
	<!-- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> -->
	<meta content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" name="viewport"/>
	<title>订单流程-选择提货人</title>
	<link rel="stylesheet" href="../css/style/common.css">
	<link rel="stylesheet" href="../css/style/picker.css">

	<!-- base seajs -->
    <script type="text/javascript" src="http://static.nong12.com/static/newStatic/common/js/base/sea.js"></script>
    <!-- base jquery -->
    <script type="text/javascript" src="http://static.nong12.com/static/newStatic/common/js/base/jquery-2.1.3.min.js"></script>

</head>
<body>
	<div class="m-page pickerList">
		<header class="m-header">
			<div class="head">
				<a href="order_confirm.html" class="lt-bar m-icon icon-back white">返回</a>
				<h1>选择提货人</h1>
				<a href="picker_new.html" class="rt-bar text">新增</a>
			</div>
		</header>
		<section class="m-content">
			<ul class="picker">
				<li>
					<div class="info">
						<label>
							<h3>张三 13880080800<em>[默认提货人]</em></h3>
							<p>身份证:510104198504041199</p>
							<p>四川省成都市天府广场右边38号物质大厦</p>
							<input type="radio" class="m-radio" checked name="picker">
						</label>
					</div>
					<div class="action">
						<span class="item remove">删除</span>
						<a href="pick_place_update.html" class="item edit">修改</a>
						<span class="item update">取消默认</span>
					</div>
				</li>
				<li>
					<div class="info">
						<label>
							<h3>张三 13880080800</h3>
							<p>身份证:510104198504041199</p>
							<p>四川省成都市天府广场右边38号物质大厦</p>
							<input type="radio" class="m-radio"  name="picker">
						</label>

					</div>
					<div class="action">
						<span class="item remove">删除</span>
						<a href="pick_place_update.html" class="item edit">修改</a>
						<span class="item update">设为默认</span>
					</div>
				</li>
			</ul>
		</section>
		<footer class="m-footer">
		</footer>
	</div>
	<script>
		$(function(){
			$('.picker').on('click', '.update', function(){
				console.log('eeee');
				var tmp = '<em>[默认提货人]</em>';
				var h3 = $(this).closest('li').find('h3');
				
				if(h3.find('em').length > 0){
					$('.picker').find('.update').text('设为默认').end().find('h3 em').remove();
				}else{
					$('.picker').find('.update').text('设为默认').end().find('h3 em').remove();
					$(this).text('取消默认');
					h3.append($(tmp));
				}
				
			});

			$('.picker').on('click', 'li .remove', function(){
				var remove = confirm('确定删除该提货人吗?');
				if(remove){
					$(this).closest('li').remove();
				}
			});
		});
	</script>
</body>
</html>