<extend name="./Apps/Home/View/default/users/layout.html" />
<block name="content">
<script>

</script>
    <div class="wst-body"> 
       <div class='wst-page-header'>买家中心 > 待发货订单</div>
       <div class='wst-page-content'>
       	<div style="padding:6px;">
       		订单编号:<input id="orderNo" value="{$params['orderNo']}" style="width:150px;" autocomplete="off"/>
       		店铺名称:<input id="shopName" value="{$params['shopName']}" style="width:150px;" autocomplete="off"/>
       		<button class="wst-btn-query" onclick="javascript:getOrdersList(2)">查询</button>
       	</div>
       
       <table class="wst-order-list">
	       <thead>
		      <tr class="head">
		         <th>订单详情</th>
		         <th>支付方式/配送</th>
		         <th>金额</th>
		         <th>操作</th>
		      </tr>
		   </thead>
		   <volist name="receiveOrders['root']" id="order" key='key1'>
		 	<tbody class="j-order-row">          
			 	<tr class="empty-row">             
				 	<td colspan="4">&nbsp;</td>          
				 </tr>          
				 <tr class="order-head">             
				 	<td colspan="4" align="right">               
				 	<div class="time">{$order["createTime"]}</div>               
				 	<div class="orderno">订单号：{$order["orderNo"]}
				 		<if condition='$order["orderFrom"] eq 2'>
				 		<img src="__ROOT__/Apps/Home/View/{$WST_STYLE}/images/tuan.png" height="30" />
				 		<elseif condition='$order["orderFrom"] eq 3'/>
				 		<img src="__ROOT__/Apps/Home/View/{$WST_STYLE}/images/qian.png" height="30" />
				 		</if>
				 	</div>               
				 	<div class="shop"><a href="{:U('Home/Shops/toShopHome/',array('shopId'=>$order['shopId']))}" target="_blank">{$order["shopName"]}</a></div>               
				 	<div class="link">
				 		<if condition="$order['qqNo'] neq ''">
							<a href="tencent://message/?uin={$order['qqNo']}&Site=QQ交谈&Menu=yes">
								<img border="0" src="http://wpa.qq.com/pa?p=1:{$order['qqNo']}:7" alt="QQ交谈" width="71" height="24" />
							</a>
						</if>
				 	</div>               
				 	<div>
						<if condition='$order["orderStatus"] eq -3'>拒收
	               		<elseif condition='$order["orderStatus"] eq -2'/>未付款
	               		<elseif condition='$order["orderStatus"] eq -1'/>已取消
	               		<elseif condition='$order["orderStatus"] eq 0'/>未受理
	               		<elseif condition='$order["orderStatus"] eq 1'/>已受理
	               		<elseif condition='$order["orderStatus"] eq 2'/>打包中
	               		<elseif condition='$order["orderStatus"] eq 3'/>配送中
	               		<elseif condition='$order["orderStatus"] eq 4'/>已收货
	               		</if>
					</div>             
				 	</td>          
				 </tr>
				 <volist name="order['goodslist']" id="goods" key='key2'>                
				 <tr class="goods-box">             
				 	<td>                
				 		<div class="goods-img">
					 		
					 		<?php if($order['orderFrom']==2){ ?>
                         		<a href="{:U('Home/Groups/getGoodsDetails/',array('id'=>$order['orderFromId']))}" target="_blank">
                         	<?php }else if($order['orderFrom']==3){ ?>
                         		<a href="{:U('Home/Panics/getGoodsDetails/',array('id'=>$order['orderFromId']))}" target="_blank">
                       		<?php }else{ ?>
                           		<a href="{:U('Home/Goods/getGoodsDetails/',array('goodsId'=>$goods['goodsId']))}">
                         	<?php } ?>
								<img data-original="__ROOT__/{$goods['goodsThums']}" class='lazyImg' title="{$goods['goodsName']}"/>
							</a>
				 		</div>
				 		<div class="goods-name">
					 		<div>{$goods['goodsName']}</div>
					 		<div>{$goods['goodsAttrName']}</div>
				 		</div>                
				 		<div class="goods-extra">{$goods['goodsPrice']} x {$goods['goodsNums']}</div>             
				 	</td>
				 	<if condition="$key2==1">
				 	<td rowspan="<?php echo count($order['goodslist']) ?>">                 
					 	<div>{$order["payType"]==0?"货到付款":($order["payType"]==2?"钱包支付":"在线支付")}</div>                 
					 	<div>{$order["isSelf"]==1?"自提":"送货上门"}</div>
				 	</td>             
				 	<td rowspan="<?php echo count($order['goodslist']) ?>">                 
					 	<div>商品金额：¥{$order["totalMoney"]}</div>                 
					 	<div class="line">运费：¥{$order["deliverMoney"]}</div>                 
					 	<div>实付金额：¥{$order["realTotalMoney"]}</div>             
				 	</td>        
				 	<td rowspan="<?php echo count($order['goodslist']) ?>">                 
					 	<div><a href="javascript:;" onclick="showOrder({$order['orderId']})">【订单详情】</a></div>
						<if condition='$order["payType"]==0'>
						<div><a href="javascript:;" onclick="orderCancel({$order['orderId']},{$order['orderStatus']})">【取消订单】</a></div>
						<else/>
						<div><a href="javascript:;" onclick="refund({$order['orderId']})">【退款】</a></div>
						</if>
						<div><a href='{:U("Home/OrderComplains/complain",array("orderId"=>$order["orderId"]))}'>【投诉】</a></div>   
				 	</td>
				 	</if>                    
			 	</tr>
			 	</volist>                
		 	</tbody>                
		 	</volist>
	       <tbody><tr class="empty-row">
	            <td colspan="4" id="pager" align="center" style="padding:5px 0px 5px 0px">
	            	<div class="wst-page" style="float:right;padding-bottom:10px;">
						<div id="wst-page-items"></div>
					</div>
	            </td>
	       </tr>
	    </tbody>
    </table>
       
    </div>
    <script>
    <if condition="$receiveOrders['totalPage'] gt 1">
    $(document).ready(function(){
		laypage({
		    cont: 'wst-page-items',
		    pages: {$receiveOrders['totalPage']}, //总页数
		    skip: true, //是否开启跳页
		    skin: '#e23e3d',
		    groups: 3, //连续显示分页数
		    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
		        var page = location.search.match(/pcurr=(\d+)/);
		        return page ? page[1] : 1;
		    }(), 
		    jump: function(e, first){ //触发分页后的回调
		        if(!first){ //一定要加此判断，否则初始时会无限刷新
		        	var nuewurl = WST.splitURL("pcurr");
		        	var ulist = nuewurl.split("?");
		        	if(ulist.length>1){
		        		location.href = nuewurl+'&pcurr='+e.curr;
		        	}else{
		        		location.href = '?pcurr='+e.curr;
		        	}
		            
		        }
		    }
		});
    });
	</if>
	</script>
</block> 