?? ways.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 = "";
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>
<a id="lbModifyReceiver" href="javascript:modifyPayway('receiveAddresses','showAllSendways','showAllPayways')">修改</a>
</td>
<td width="50">
</td>
</tr>
<tr id="trDetail" style="">
<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="50px" style="">
</td>
<td align="left" style="">
<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} (${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> <a href="user/usercpaddress.htm">管理我的收貨地址</a></span>
</td>
<td width="50px">
</td>
</tr>
</table>
<table width="100%" style="border-bottom: solid 1px #B4C9E0">
<tr>
<td width="50">
</td>
<td align="left">
<span class="OrderTitle">送貨方式</span>
<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>
<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> "+
"<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>
<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>
<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> "+
"<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 + -