<div class="oe_widget_center">
  <div class="oe_edit_address">
    <h3 class="oe_f_title">订单发货<span>（填写发货快递信息）</span></h3>
    <table class="oe_table_info">
      <tr>
        <th align="right" width="30%"><font color="red">*</font>快递、物流公司：</th>
        <td width="70%"><input type="text" name="shipname" id="shipname" class="input-250" /></td>
      </tr>
      <tr>
        <th align="right"><font color="red">*</font>快递、物流单号：</th>
        <td><input type="text" name="shipno" id="shipno" class="input-250" /></td>
      </tr>
      <tr>
        <th></th>
        <td>
		  <input type="button" id="btn_post" class="submit_btn1" value="确定发货" />
		  <span id="submit_tips"></span>
		</td>
      </tr>
    </table>
  </div>
</div>
<script type="text/javascript">
$(function(){
	$("#btn_post").bind("click", function(){
		if ($("#shipname").val().length == 0) {
			$("#submit_tips").html("<font color='red'>请填写快递、物流公司</font>");
			return false;
		}
		if ($("#shipno").val().length == 0) {
			$("#submit_tips").html("<font color='red'>请填写快递、物流单号</font>");
			return false;
		}
		$shipname = $("#shipname").val();
		$shipno = $("#shipno").val();
		$.ajax({
			type: "POST",
			url: "<!--{$oefile}-->",
			cache: false,
			data: {c:"order", a:"saveship", shipname:$shipname, shipno:$shipno, id:"<!--{$id}-->", r:get_rndnum(8)},
			dataType: "json",
			success: function($data) {
				$json = eval($data);
				$response = $json.response;
				$result = $json.result;
				if ($response == "1") {
					$("#submit_tips").html("<font color='green'>发货成功</font>");
					setTimeout(window.location.reload(), 1000);
				}
				else {
					if ($result.length > 0) {
						$("#submit_tips").html("<font color='red'>请填写快递、物流单号</font>");
						ToastShow($result);
					}
					else {
						$("#submit_tips").html("<font color='red'>发货失败</font>");
					}
				}
			},
			error: function() {
				$("#submit_tips").html("<font color='red'>发货失败，请检查网络！</font>");
			}
		});
	});
});
</script> 