{include file="public/seller_top" /} 

<div class="seller_main w1200">
    {include file="public/seller_left" /}
    <div class="seller_right">
        

        <span class="fr mr5"> <a href="{:url('/home/Sellerdeliver/waybill_print',['order_id'=>$order_info.order_id])}" class="dssc-btn-mini" target="_blank" title="打印运单"/><i class="icon-print"></i>打印运单</a></span>
        <div class="wrap">
            <div class="step-title"><em>{$Think.lang.store_deliver_first_step}</em>{$Think.lang.store_deliver_confirm_trade}</div>
            <form name="deliver_form" method="POST" id="deliver_form" action="{:url('/home/sellerdeliver/send',['order_id'=>$order_info.order_id])}" >
                <input type="hidden" value="ok" name="form_submit">
                <input type="hidden" id="shipping_express_id" value="<?php echo $order_info['extend_order_common']['shipping_express_id'];?>" name="shipping_express_id">
                <input type="hidden" value="<?php echo $order_info['extend_order_common']['reciver_name'];?>" name="reciver_name" id="reciver_name">
                <input type="hidden" value="<?php echo $order_info['extend_order_common']['reciver_info']['area'];?>" name="reciver_area" id="reciver_area">
                <input type="hidden" value="<?php echo $order_info['extend_order_common']['reciver_info']['street'];?>" name="reciver_street" id="reciver_street">
                <input type="hidden" value="<?php echo $order_info['extend_order_common']['reciver_info']['mob_phone'];?>" name="reciver_mob_phone" id="reciver_mob_phone">
                <input type="hidden" value="<?php echo $order_info['extend_order_common']['reciver_info']['tel_phone'];?>" name="reciver_tel_phone" id="reciver_tel_phone">
                <table class="dssc-default-table order deliver">
                    <tbody>
                        <?php if (is_array($order_info) and !empty($order_info)) { ?>
                        <tr>
                            <td colspan="20" class="sep-row"></td>
                        </tr>
                        <tr>
                            <th colspan="20"><a href="{:url('/home/sellerorderprint/index',['order_id'=>$order_info.order_id])}" target="_blank" class="fr" title="{$Think.lang.store_show_order_printorder}"/><i class="print-order"></i></a><span class="fr mr30"></span><span class="ml10">{$Think.lang.store_order_order_sn}{$Think.lang.ds_colon}<?php echo $order_info['order_sn']; ?></span><span class="ml20">{$Think.lang.store_order_add_time}{$Think.lang.ds_colon}<em class="goods-time"><?php echo date("Y-m-d H:i:s",$order_info['add_time']); ?></em></span>
                        </tr>
                        <?php foreach($order_info['extend_order_goods'] as $k => $goods_info) { ?>
                        <tr>
                            <td class="bdl w10"></td>
                            <td class="w50"><div class="pic-thumb"><a href="{:url('/home/goods/index',['goods_id'=>$goods_info.goods_id])}" target="_blank"><img src="<?php echo thumb($goods_info, 60); ?>" /></a></div></td>
                            <td class="tl"><dl class="goods-name">
                                    <dt><a target="_blank" href="{:url('/home/goods/index',['goods_id'=>$goods_info.goods_id])}"><?php echo $goods_info['goods_name']; ?></a></dt>
                                    <dd><strong>￥<?php echo $goods_info['goods_price']; ?></strong>&nbsp;x&nbsp;<em><?php echo $goods_info['goods_num'];?></em>件</dd>
                                </dl></td>
                            <?php if ((count($order_info['extend_order_goods']) > 1 && $k ==0) || (count($order_info['extend_order_goods']) == 1)){?>
                            <td class="bdl bdr order-info w500" rowspan="<?php echo count($order_info['extend_order_goods']);?>"><dl>
                                    <dt>{$Think.lang.store_deliver_shipping_amount}{$Think.lang.ds_colon}</dt>
                                    <dd>
                                        <?php if (!empty($order_info['shipping_fee']) && $order_info['shipping_fee'] != '0.00'){?>
                                        <?php echo $order_info['shipping_fee'];?>
                                        <?php }else{?>
                                        {$Think.lang.ds_common_shipping_free}
                                        <?php }?>
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>{$Think.lang.store_deliver_forget}{$Think.lang.ds_colon}</dt>
                                    <dd>
                                        <textarea name="deliver_explain" cols="100" rows="2" class="w400 tip-t" title="{$Think.lang.store_deliver_forget_tips}"><?php echo $order_info['extend_order_common']['deliver_explain'];?></textarea>
                                    </dd>
                                </dl></td>
                            <?php }?>
                        </tr>
                        <?php }?>
                        <tr>
                            <td colspan="20" class="tl bdl bdr" style="padding:8px" id="address"><strong class="fl">{$Think.lang.store_deliver_buyer_adress}{$Think.lang.ds_colon}</strong><span id="buyer_address_span"><?php echo $order_info['extend_order_common']['reciver_name'];?>&nbsp;<?php echo $order_info['extend_order_common']['reciver_info']['phone'];?>&nbsp;<?php echo $order_info['extend_order_common']['reciver_info']['address'];?></span>
                                <a href="javascript:void(0)" nc_type="dialog" dialog_title="{$Think.lang.store_deliver_buyer_adress}" dialog_id="edit_buyer_address" uri="{:url('/home/sellerdeliver/buyer_address_edit',['order_id'=>$order_info.order_id])}" dialog_width="550" class="dssc-btn-mini fr"><i class="icon-edit"></i>{$Think.lang.ds_edit}</a></td>
                        </tr>
                        <?php } else { ?>
                        <tr>
                            <td colspan="20" class="norecord"><i>&nbsp;</i><span>{$Think.lang.no_record}</span></td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
                <div class="step-title mt30"><em>{$Think.lang.store_deliver_second_step}</em>{$Think.lang.store_deliver_confirm_daddress}</div>
                <div class="deliver-sell-info"><strong class="fl">{$Think.lang.store_deliver_my_daddress}{$Think.lang.ds_colon}</strong>
                    <a href="javascript:void(0);" onclick="ajax_form('modfiy_daddress', '{$Think.lang.store_deliver_select_daddress}', '{:url('/home/sellerdeliver/send_address_select',['order_id'=>$order_info.order_id])}', 640,0);" class="dssc-btn-mini fr"><i class="icon-edit"></i>{$Think.lang.ds_edit}</a>
                    <span id="seller_address_span">
                        <?php if (empty($daddress_info)) {?>
                        {$Think.lang.store_deliver_none_set}
                        <?php } else { ?>
                        <?php echo $daddress_info['seller_name'];?>&nbsp;<?php echo $daddress_info['telphone'];?>&nbsp;<?php echo $daddress_info['area_info'];?>&nbsp;<?php echo $daddress_info['address'];?>
                        <?php } ?>
                    </span>
                </div>
                <?php if (!empty($daddress_info)) {?>
                <input type="hidden" name="daddress_id" id="daddress_id" value="<?php echo $daddress_info['address_id'];?>">
                <?php } ?>
                <div class="step-title mt30"><em></em>{$Think.lang.store_deliver_third_step}{$Think.lang.store_deliver_express_select}</div>
                <div class="alert alert-success">您可以通过"发货设置-><a href="{:url('/home/sellerdeliverset/express')}" target="_parent" >默认物流公司</a>"添加或修改常用货运物流。免运或自提商品可切换下方<span class="red">[无需物流运输服务]</span>选项卡并操作。</div>
                <div class="dssc-goods-spec">
                <div class="spec-tabmenu">
                    <ul class="tab pngFix">
                        <li id="eli1" class="selected"><a href="javascript:void(0);" onclick="etab(1)">{$Think.lang.store_deliver_express_zx}</a></li>
                        <?php if (!isset($order_info['extend_order_common']['reciver_info']['dlyp'])) {?>
                        <li id="eli2" class="normal"><a href="javascript:void(0);" onclick="etab(2)">{$Think.lang.store_deliver_express_wx}</a></li>
                        <?php } ?>
                    </ul>
                </div>
                </div>
                <table class="dssc-default-table order" id="texpress1">
                    <tbody>
                        <tr>
                            <td class="bdl w150">{$Think.lang.store_deliver_company_name}</td>
                            <td class="w250">{$Think.lang.store_deliver_shipping_code}</td>
                            <td class="tc">{$Think.lang.store_deliver_bforget}</td>
                            <td class="bdr w90 tc">{$Think.lang.ds_common_button_operate}</td>
                        </tr>
                        <?php if (is_array($my_express_list) && !empty($my_express_list)){?>
                        <?php foreach ($my_express_list as $k=>$v){?>
                        <?php if (!isset($express_list[$v])) continue;?>
                        <tr>
                            <td class="bdl"><?php echo $express_list[$v]['e_name'];?></td>
                            <td class="bdl"><input name="shipping_code" type="text" class="text w200 tip-r" title="{$Think.lang.store_deliver_shipping_code_tips}" maxlength="20" nc_type='eb' nc_value="<?php echo $v;?>" /></td>
                            <td class="bdl gray" nc_value="<?php echo $v;?>"></td>
                            <td class="bdl bdr tc"><a nc_type='eb' nc_value="<?php echo $v;?>" href="javascript:void(0);" class="dssc-btn">{$Think.lang.ds_common_button_confirm}</a></td>
                        </tr>
                        <?php }?>
                        <?php }?>
                    </tbody>
                </table>
                <table class="dssc-default-table order" id="texpress2" style="display:none">
                    <tbody>
                        <tr>
                            <td colspan="2"></td>
                        </tr>
                        <tr>
                            <td class="bdl tr">{$Think.lang.store_deliver_no_deliver_tips}</td>
                            <td class="bdr tl w400">&emsp;<a nc_type='eb' nc_value="e1000" href="javascript:void(0);" class="dssc-btn">{$Think.lang.ds_common_button_confirm}</a></td>
                        </tr>
                        <tr>
                            <td colspan="2"></td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </div>
        
        
        
    </div>
</div>

{include file="public/mall_footer" /}


<script type="text/javascript" src="{$Think.config.url_domain_root}static/plugins/jquery.poshytip.min.js"></script>
<script type="text/javascript">
function etab(t){
	if (t==1){
		$('#eli1').removeClass('normal').addClass('selected');
		$('#eli2').removeClass('selected').addClass('normal');
		$('#texpress1').css('display','');
		$('#texpress2').css('display','none');
	}else{
		$('#eli1').removeClass('selected').addClass('normal');
		$('#eli2').removeClass('normal').addClass('selected');
		$('#texpress1').css('display','none');
		$('#texpress2').css('display','');
	}
}

$(function(){
        $('a[nc_type="eb"]').on('click',function(){
		if ($('input[nc_value="'+$(this).attr('nc_value')+'"]').val() == ''){
			showDialog('{$Think.lang.store_deliver_shipping_code_pl}', 'error','','','','','','','','',2);return false;
		}
		$('input[nc_type="eb"]').attr('disabled',true);
		$('input[nc_value="'+$(this).attr('nc_value')+'"]').attr('disabled',false);
		$('#shipping_express_id').val($(this).attr('nc_value'));
            ajaxpost('deliver_form', '', '', 'onerror')
		$('#deliver_form').submit();
	});
        
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
    $('.checkall_s').click(function(){
        var if_check = $(this).attr('checked');
        $('.checkitem').each(function(){
            if(!this.disabled)
            {
                $(this).attr('checked', if_check);
            }
        });
        $('.checkall_s').attr('checked', if_check);
    });
    <?php if ($order_info['shipping_code'] != ''){?>
    	$('input[nc_value="<?php echo $order_info['extend_order_common']['shipping_express_id'];?>"]').val('<?php echo $order_info['shipping_code'];?>');
    	$('td[nc_value="<?php echo $order_info['extend_order_common']['shipping_express_id'];?>"]').html('<?php echo $order_info['extend_order_common']['deliver_explain'];?>');
    <?php } ?>

    $('#my_address_add').click(function(){
		ajax_form('my_address_add', '{$Think.lang.store_deliver_add_daddress}' , "{:url('/home/sellerdeliver/send_address_edit',['order_id'=>$order_info.order_id])}", 550,0);
    });
});
</script>