viewExpress.html 2.71 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <title>main</title>
    <script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="margin-left: 25px;margin-top: 5px;">

        <label>快递单号:</label>
        <span id="waybillCode"></span>
        <br/>
        <label>姓名:</label>
        <span id="receiveName"></span>
        <br/>
        <label>手机号:</label>
        <span id="receiveMobile"></span>
        <br/>
        <label>地址:</label>
        <span id="receiveAddress"></span>
</div>

<div id="viewExpressDiv" region="center">
    <table id="expressTable" border="1px" cellpadding="1" cellspacing="0" align="center"
           style="margin-top: 15px; line-height: 30px;width:95%;border-color: #999999">
    </table>

</div>
<script>
    $(function () {
        //获取物流信息
        getExpressInfoAndAddressInfo();
    });

    function getExpressInfoAndAddressInfo(){
    	var form = new FormData();
	    form.append("orderCode", document.getElementById("buyerOrderCode").value);
	    form.append("expressTypeStr", "2,3,4");
        //发送请求
		$.ajax({
		     type: "POST",
             url: contextPath + '/buyerOrder/queryExpressListAndAddressInfo',
             data: form,
             async: false,
             cache: false,
             contentType: false,
             processData: false,
             dataType: 'json',
             success: function (result) {
                 if(result.code == 200) {
                     //地址信息
                     var addr =  result.data.buyerOrderResp;
                     if(addr){
                         //$("#expressCompanyName").html(addr.expressCompanyName);
                         if(addr.platformWaybillCode){
                             $("#waybillCode").html(addr.platformWaybillCode+"("+addr.expressCompanyName+")");
                         }
                         $("#receiveName").html(addr.receiveName);
                         $("#receiveMobile").html(addr.receiveMobile);
                         $("#receiveAddress").html(addr.receiveAddress);
                     }
                     //物流信息
                	 var arr = result.data.expressInfoRespList;
                	 var str = "<tr><th>运单信息</th><th>时间</th></tr>"
                	 for(i=0; i<arr.length; i++){
                		 str = str + "<tr><td>" + arr[i].acceptRemark + "</td><td>" + arr[i].createTimeStr + "</td></tr>";
                	 }
                	 $("#expressTable").html(str);
                 }
                 else {
                     $.messager.alert("失败", result.message, "error");
                 }
             }
         });           
    }
    
</script>
</body>
</html>