⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ways.tag

📁 一个网上购物商城系统
💻 TAG
字号:
<%--收货方式、支付方式、收货地址等 --%>
<%@ tag pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
<!--
	
	function modifyPayway(obj,obj2,obj3){
		document.getElementById(obj).style.display = "block";
		document.getElementById(obj2).style.display = "none";
		document.getElementById(obj3).style.display = "none";		
	}
	function usePayway(obj){
		for(i=0;i<${fn:length(requestScope.payways)};i++){
			var payway = document.getElementsByName("payway");
			if(payway[i].checked){
				document.getElementById("spanPayType").innerHTML = document.getElementById("pay_"+payway[i].value).innerHTML;
				document.getElementById("spanPaymentFee").innerHTML = document.getElementById("pid_"+payway[i].value).innerHTML;
				document.getElementById("default_pay_id").value = payway[i].value;
				updateFee();
				break;
			}
		}
		document.getElementById(obj).style.display = "none";	
		
	}
	
	function useSendway(obj){
		
		for(i=0;i<${fn:length(requestScope.sendways)};i++){
			var sendway = document.getElementsByName("sendway");
			if(sendway[i].checked){
				document.getElementById("spanShipping").innerHTML = document.getElementById("se_"+sendway[i].value).innerHTML;
				document.getElementById("spanShipPrice").innerHTML = document.getElementById("sid_"+sendway[i].value).innerHTML;
				document.getElementById("default_send_id").value = sendway[i].value;
				updateFee();
				break;
			}
		}
		document.getElementById(obj).style.display = "none";	
		
	}
	
	function updateFee(){
		document.getElementById("spanXiaoJi").innerHTML = document.getElementById("spanTotalPrice").innerHTML*1+document.getElementById("spanShipPrice").innerHTML*1;
		document.getElementById("spanNeedToPay").innerHTML = document.getElementById("spanXiaoJi").innerHTML*1+document.getElementById("spanPaymentFee").innerHTML*1;
	}
	
	function useReceiveAddress(obj){
		for(i=0;i<${fn:length(requestScope.receiveaddress)};i++){
			var address = document.getElementsByName("address");
			if(address[i].checked){
				document.getElementById("default_add_id").value = address[i].value;
				updateAddress();
				break;
			}
		}
		document.getElementById(obj).style.display = "none";
	}
//-->
</script>

<div id="UpdatePanel2">

	<table width="100%" style="border-bottom: solid 1px #B4C9E0">
		<tr>
			<td width="50">
			</td>
			<td align="left">
				<span class="OrderTitle">收货人信息</span>&nbsp;&nbsp;
				<a id="lbModifyReceiver" href="javascript:modifyPayway('receiveAddresses','showAllSendways','showAllPayways')">修改</a>
			</td>
			<td width="50">
			</td>
		</tr>

		<tr id="trDetail">
			<td width="50">
			</td>
			<td align="left">
				<table width="100%" cellpadding="2" cellspacing="2">
					<tr>
						<td width="80">收货人:</td>
						<td><span id="spanReceiver"></span></td>
					</tr>
					<tr>
						<td>收货地址:</td>
						<td><span id="spanAddress"></span></td>
					</tr>
					<tr>
						<td>邮政编码:</td>
						<td><span id="spanZip"></span></td>
					</tr>
					<tr>
						<td>联系电话:</td>
						<td><span id="spanPhone"></span></td>
					</tr>
				</table>
			</td>
			<td width="50">
			</td>
		</tr>
		<tr id="receiveAddresses" style="display: none;">
			<td width="50">
			</td>
			<td align="left">
				<input id="default_add_id" value="" type="hidden" name="default_add_id" />
				<c:forEach items="${requestScope.receiveaddress}" var="address" varStatus="s">
					<input id="name_${address.id}" value="${address.receivename}" type="hidden"/>
					<input id="add_${address.id}" value="${address.province}${address.city}${address.area}${address.address}" type="hidden"/>
					<input id="zip_${address.id}" value="${address.zip}" type="hidden"/>
					<input id="mobile_${address.id}" value="${address.mobile}(${address.phone})" type="hidden"/>
					<input type="radio" value="${address.id}" name="address" <c:if test="${s.index==0}">checked="checked"</c:if> />${address.province}${address.city}${address.area}${address.address}&nbsp;(${address.receivename})<br />
					<c:if test="${s.index==0}">
						<script>
							document.getElementById("default_add_id").value = ${address.id};
						</script>
					</c:if>
				</c:forEach>
				<span><a href="javascript:useReceiveAddress('receiveAddresses');">使用选中的地址</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="user/usercpaddress.htm">管理我的收货地址</a></span>
			</td>
			<td width="50">
			</td>
		</tr>
	</table>
	<table width="100%" style="border-bottom: solid 1px #B4C9E0">
		<tr>
			<td width="50">
			</td>
			<td align="left">
				<span class="OrderTitle">送货方式</span>&nbsp;&nbsp;
				<a id="lbModifyShip" href="javascript:modifyPayway('showAllSendways','showAllPayways','receiveAddresses');">修改</a>
			</td>
			<td width="50">
			</td>
		</tr>

		<tr id="trShipTypeDetail">
			<td width="50">
			</td>
			<td align="left">
				<span id="spanShipping"></span>
				<input id="default_send_id" value="" type="hidden" name="default_send_id"/>
				<div id="showAllSendways" style="display: none;">
					<c:forEach items="${requestScope.sendways}" var="sendway" varStatus="s">
						<input type="radio" name="sendway" value="${sendway.id}" <c:if test="${s.index==0}">checked="checked"</c:if> />
						<span id="se_${sendway.id }">
						<font color='blue' > ${sendway.sendname }</font>
						<span style='display:none' id="sid_${sendway.id}">${sendway.basefee}</span>&nbsp; &nbsp;
                        <font color='#666'>${sendway.senddesc},${sendway.arrivaldate}</font>
                        </span>
						<br />
						<c:if test="${s.index==0}">
							<script>
								document.getElementById("spanShipping").innerHTML = "<input type='hidden' value='${sendway.id}' id='sendway_c' name='sendway_c' />"+
								"<font color='blue' > ${sendway.sendname }</font>"+
								"<span style='display:none' id='sid_${sendway.id}'>${sendway.basefee}</span>&nbsp; &nbsp;"+
                        		"<font color='#666'>${sendway.senddesc},${sendway.arrivaldate}</font>";
                        		document.getElementById("default_send_id").value = ${sendway.id};
							</script>
						</c:if>
					</c:forEach>
					<a id="lbModifyPayType" href="javascript:useSendway('showAllSendways');">使用选中的送货方式</a>
				</div>
			</td>
			<td width="50">
			</td>
		</tr>

	</table>
	<table width="100%" style="border-bottom: solid 1px #B4C9E0">
		<tr>
			<td width="50">
			</td>
			<td align="left">
				<span class="OrderTitle">付款方式</span>&nbsp;&nbsp;
				<a id="lbModifyPayType" href="javascript:modifyPayway('showAllPayways','showAllSendways','receiveAddresses');">修改</a>
			</td>
			<td width="50">
			</td>
		</tr>

		<tr id="trPayTypeDetail">
			<td width="50">
			</td>
			<td align="left">
				<span id="spanPayType" style="display: block"></span>
				<input id="default_pay_id" value="" type="hidden" name="default_pay_id"/>
				<div id="showAllPayways" style="display: none;">
					<c:forEach items="${requestScope.payways}" var="payway" varStatus="s">
						<input type="radio" name="payway" value="${payway.id }" <c:if test="${s.index==0}">checked="checked"</c:if> />
						<span id="pay_${payway.id }">
						<font color='blue' > ${payway.payname }</font>
						<span style='display:none' id="pid_${payway.id}">${payway.fees}</span>&nbsp; &nbsp;
                        <font color='#666'>${payway.paydesc}</font>
                        </span>
						<br />
						<c:if test="${s.index==0}">
							<script>
								document.getElementById("spanPayType").innerHTML = "<input type='hidden' value='${payway.id}' id='payway_c' name='payway_c' />"+
								"<font color='blue' > ${payway.payname }</font>"+
								"<span style='display:none' id='pid_${payway.id}'>${payway.fees}</span>&nbsp; &nbsp;"+
                        		"<font color='#666'>${payway.paydesc}</font>"; 
                        		document.getElementById("default_pay_id").value = ${payway.id};
							</script>
						</c:if>
					</c:forEach>
					<a id="lbModifyPayType" href="javascript:usePayway('showAllPayways');">使用选中的送货方式</a>
				</div>

			</td>
			<td width="50">
			</td>
		</tr>

	</table>

</div>
<script>
	function updateAddress(){
		if(document.getElementById("default_add_id").value!=""){
			document.getElementById("spanReceiver").innerHTML = document.getElementById("name_"+document.getElementById("default_add_id").value).value;
			document.getElementById("spanAddress").innerHTML = document.getElementById("add_"+document.getElementById("default_add_id").value).value;
			document.getElementById("spanZip").innerHTML = document.getElementById("zip_"+document.getElementById("default_add_id").value).value;
			document.getElementById("spanPhone").innerHTML = document.getElementById("mobile_"+document.getElementById("default_add_id").value).value;
		}
	}
	updateAddress();
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -