<!DOCTYPE html>
<html>
	<?php echo $this->fetch('head.html'); ?>
	<body>
		<div class="header">
		 
			<div class="header-title">我的订单</div>
		</div>
		<div class="header-row"></div>
		<div class="main-body">
			<div class="tabs-border">
				<div gourl="/module.php?m=olprint_order&a=my" class="tabs-border-item <?php if (get ( 'type' ) == ''): ?>tabs-border-active<?php endif; ?>">全部</div>
				<div gourl="/module.php?m=olprint_order&a=my&type=unpay"  class="tabs-border-item <?php if (get ( 'type' ) == 'unpay'): ?>tabs-border-active<?php endif; ?>">待支付</div>
				<div gourl="/module.php?m=olprint_order&a=my&type=new"  class="tabs-border-item <?php if (get ( 'type' ) == 'new'): ?>tabs-border-active<?php endif; ?>">待接单</div>
				<div gourl="/module.php?m=olprint_order&a=my&type=unreceive"  class="tabs-border-item <?php if (get ( 'type' ) == 'unreceive'): ?>tabs-border-active<?php endif; ?>">待收货</div>
				<div gourl="/module.php?m=olprint_order&a=my&type=finish"  class="tabs-border-item <?php if (get ( 'type' ) == 'finish'): ?>tabs-border-active<?php endif; ?>">已完成</div>
			</div>
			<div>
				<?php $_from = $this->_var['list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
				<div class="row-box mgb-5">
					<div class="flex flex-ai-center mgb-5">
						<div class="cl-status mgr-5"><?php echo $this->_var['c']['status_name']; ?></div>
						
						<div class="flex-1"></div>
						<div class="cl-money">￥<?php echo $this->_var['c']['money']; ?></div>
						
					</div>
					<div>
						<div class="flex mgb-5">
							<div class="cl2 f12 mgr-5">类型：</div>
							<div class="cl-num f12 mgr-10"><?php echo $this->_var['c']['ptype_name']; ?></div>
							<div class="cl2 f12 mgr-5">页数：</div>
							<div class="cl-num f12 mgr-10"><?php echo $this->_var['c']['page_num']; ?></div>
							 
							<div class="cl2 f12 mgr-5">份数：</div>
							<div class="cl-num f12"><?php echo $this->_var['c']['print_num']; ?></div>
						</div>
						<?php if ($this->_var['c']['bookid']): ?>
						<div class="flex mgb-10">
							<div class="cl3"><?php echo $this->_var['c']['book']['title']; ?></div>
							<div class="flex-1"></div>
							<div class="cl-primary" gourl="/module.php?m=olprint_book&a=show&bookid=<?php echo $this->_var['c']['bookid']; ?>">详情</div>
						</div>
						
						<?php endif; ?>
						<?php if ($this->_var['c']['sendtype'] == 1): ?>
						<div class="flex flex-ai-center mgb-5">
							<div class="cl2 f12 mgr-5">收货人</div>
							<div class="cl2 f12 mgr-5"><?php echo $this->_var['c']['nickname']; ?></div>
							<div class="flex-1"></div>
							<div class="f12 cl-primary"><?php echo $this->_var['c']['telephone']; ?></div>
						</div>
						<div class="cl3 f12 mgb-5"><?php echo $this->_var['c']['address']; ?></div>
						<?php endif; ?>
					</div>
					<div class="flex mgb-5">
						<div class="cl1 f12"><?php echo $this->_var['c']['sendtype_name']; ?></div>
						<div class="flex-1"></div>
						<div class="cl3 f12"><?php echo $this->_var['c']['createtime']; ?></div>
					</div>
					<div class="flex">
						<div class="flex-1"></div>
						<?php if ($this->_var['c']['ispay'] == 0 && $this->_var['c']['status'] == 0): ?>
						<div gourl="/module.php?m=olprint_order&a=pay&orderid=<?php echo $this->_var['c']['orderid']; ?>" class="btn-mini mgr-10">去支付</div>
						<?php endif; ?>
						<?php if ($this->_var['c']['status'] == 0): ?>
						<div class="btn-mini btn-warning mgr-10">取消打印</div>
						<?php endif; ?>
						<?php if ($this->_var['c']['status'] < 3): ?>
						<div  v="<?php echo $this->_var['c']['orderid']; ?>" class="btn-mini mgr-10 js-finish">确认收货</div>
						<?php endif; ?>
						<?php if ($this->_var['c']['status'] == 3 && $this->_var['c']['israty'] == 0): ?>
						<div gourl="/module.php?m=olprint_order&a=raty&orderid=<?php echo $this->_var['c']['orderid']; ?>" class="btn-mini">去评价</div>
						<?php endif; ?>
					</div>
				</div>
				<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
				<?php echo $this->_var['pagelist']; ?>
			</div>
		</div>
		<?php $this->assign('ftnav','order'); ?>
		<?php echo $this->fetch('ftnav.html'); ?>
		<?php echo $this->fetch('footer.html'); ?>
		<script>
			$(function(){
				$(document).on("click",".js-finish",function(){
					var that=this;
					var orderid=$(this).attr("v"); 
					skyJs.confirm({
						 
						content:"确认已经收到打印资料吗",
						success:function(){
							$.ajax({
								url:"/module.php?m=olprint_order&a=finish&ajax=1",
								dataType:"json",
								 
								data:{
									orderid:orderid
								},
								success:function(res){
									skyToast(res.message)
									if(res.error){
										return false;
									}
									window.location.reload();
								}
							})
						}
					})
				})
			})
		</script>
	</body>
</html>
