<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  <title><?php echo $shoname; ?></title>
  <link rel="shortcut icon" href="" />
        
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

  <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
 
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->  

<link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
<link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
<script type="text/javascript">
	window.sysinfo = {
	<?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
	
	<?php if( !empty($_W['acid'])  ){ ?>'acid': '{$_W['acid']}',<?php } ?>
	
	<?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
	
	<?php if( !empty($_W['uid']) ) {  ?>'uid': '{$_W['uid']}',<?php } ?>
	
	'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php  }else{  ?>0<?php } ?>,
	
	'siteroot': '{$_W['siteroot']}',
			'siteurl': '{$_W['siteurl']}',
			'attachurl': '{$_W['attachurl']}',
			'attachurl_local': '{$_W['attachurl_local']}',
			'attachurl_remote': '{$_W['attachurl_remote']}',
			'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
	'cookie' : {'pre': ''},
	'account' : {:json_encode($_W['account'])},
	};
</script>

<script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
<script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
<script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
<script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
<link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
<link href="/static/css/snailfish.css" rel="stylesheet">
<style>
    tbody tr td{
        position: relative;
    }
    tbody tr  .icow-weibiaoti--{
        visibility: hidden;
        display: inline-block;
        color: #fff;
        height:18px;
        width:18px;
        background: #e0e0e0;
        text-align: center;
        line-height: 18px;
        vertical-align: middle;
    }
    tbody tr:hover .icow-weibiaoti--{
        visibility: visible;
    }
    tbody tr  .icow-weibiaoti--.hidden{
        visibility: hidden !important;
    }
    .full .icow-weibiaoti--{
        margin-left:10px;
    }
    .full>span{
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        vertical-align: middle;
        align-items: center;
    }
    tbody tr .label{
        margin: 5px 0;
    }
    .goods_attribute a{
        cursor: pointer;
    }
    .newgoodsflag{
        width: 22px;height: 16px;
        background-color: #ff0000;
        color: #fff;
        text-align: center;
        position: absolute;
        bottom: 70px;
        left: 57px;
        font-size: 12px;
    }
	.a{cursor: pointer;}
</style>
</head>
<body layadmin-themealias="default">



<table id="demo" lay-filter="test"></table>


<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-header layui-elem-quote">
			当前位置：<span class="line-text">拼团详情</span>
		</div>
		
		<div class="layui-card-body" style="padding:0px;">
		
				
			<form action="" class="layui-form" lay-filter="example" method="post" >
				
				<!--团信息begin .layui-card-->
				<div class="layui-card" style="margin-bottom:0px;">
					<div class="layui-col-md12" >
						<div class="layui-card">
						  <div class="layui-card-header">团信息</div>
						  <div class="layui-card-body layui-row layui-col-space10" >
							<div class="layui-col-md12">
								<div style="padding-left:5px;padding-top:10px;padding-bottom:10px;">
								拼团详情二维码：
									<img src="{$qrcode}" width="200" />
							  </div>
							  <table class="table table-hover">
									<thead class="navbar-inner">
										<tr>
											<th>团购订单号</th>
											<th>团购人数</th>
											<th>创建时间</th>
											<th>过期时间</th>
											<th>团购状态</th>
										</tr>
									</thead>
									 <tbody>
										 <tr>
											<td>{$pin_info['pin_id']}</td>
											<td> {$pin_buy_count}/ {$pin_info['need_count']}</td>
											<td>
												<?php echo date('Y-m-d H:i:s', $pin_info['begin_time']); ?>
											</td>
											<td>
												<?php echo date('Y-m-d H:i:s', $pin_info['end_time']); ?>
											</td>
											<td>
											<?php if($pin_info['state'] == 0){ ?>
											<span class="blue">拼团中</span>
											<?php }else if($pin_info['state'] == 1){ ?>
											<span class="red">已完成</span>
											<?php }else if($pin_info['state'] == 2){ ?>
											<span class="grey">已过期</span>
											<?php } ?>
											</td>                                                                                                                                                                                   </td>
										</tr>   
										
									</tbody>
							</table>
							</div>
						  </div>
						</div>
					</div>
					<div style="clear:both;"></div>
				</div>
				<!--团信息end-->
				<div style="height:20px;background-color:#f2f2f2;"></div>
				
				<!--用户信息begin-->
				<div class="layui-card" style="margin-bottom:0px;">
					<div class="layui-col-md12" >
						<div class="layui-card">
						  <div class="layui-card-header">用户信息</div>
						  <div class="layui-card-body layui-row layui-col-space10" >
							<div class="layui-col-md12">
								<table class="table table-hover">
									<thead class="navbar-inner">
										<tr>
											<th style="width:80px;">订单号</th>
											<th style="width:70px;">姓名</th>
											<th style="width:100px;">电话</th>
											<th style="">支付方式</th>
											<th style="width:80px;">订单状态</th>
											<th >拼团单价</th>
											<th >购买数量</th>
											<th style="">运费</th>
											<th style="width:60px;">总价</th>
											<th style="">下单时间</th>
											<th style="">收货地址</th>
											<?php if($pin_info['is_pintuan_rebate'] == 1){ ?>
												<th style="">拼团返利</th>
											<?php } ?>
											<th style="width:100px;">操作</th>
										</tr>
									</thead>
									<tbody>
										
										<?php foreach($list as $v){ ?>
										<tr>
											<td>{$v['order_num_alias']}</td>
											<td>
											{$v['name']}
											</td>
											<td>{$v['telephone']}</td>
											<td>
												<?php if( $v['payment_code'] == 'yuer' ){ ?>余额支付<?php } ?>
												<?php if( $v['payment_code'] == 'admin' ){ ?>后台付款<?php } ?>
												<?php if( $v['payment_code'] == 'weixin'){ ?>微信支付<?php } ?>
											</td>
											<td>
												<span class="label label-default">																																																																																										
													<?php if($v['order_status_id'] == 1) {
																echo '已成团待发货';
															}else{
																echo $order_status_arr[$v['order_status_id']];
															}  
													?>
												</span>
											</td>
											<td> <?php echo round($v['price'],2); ?> 元</td>
											<td>
											{$v['quantity']}
											</td>
											<td> <?php echo round($v['shipping_fare'],2); ?> 元</td>
											<td> <?php echo round($v['total'],2); ?> 元</td>
											<td><?php echo date('Y-m-d H:i:s',$v['date_added']); ?></td>
											<td>{$v['province_name']}-{$v['city_name']}-{$v['area_name']}-{$v['shipping_address']}</td>
											<?php if($pin_info['is_pintuan_rebate'] == 1){ ?>
												<td> {$v['reward_content']}</td>
											<?php } ?>
											<td>
											  <a href="{:U('order/detail', array('id' => $v['order_id']))}" class="btn btn-success btn-sm">查看订单</a>
											</td>
										 </tr>
										 <?php } ?>
										 <?php foreach($jiapinorder as $val){ ?>
											<tr>
												<td>--</td>
												<td>
													{$val['uname']}
												</td>
												<td></td>
												<td>
													(机器人)																																																																   					
												</td>
												<td>
													--
												</td>
												<td>--</td>
												<td>
													--
												</td>
												<td>--</td>
												<td> --</td>
												<td>--</td>
												<td>--</td>
												<td>
												  --
												</td>
											 </tr>
										 <?php } ?>
									</tbody>
								</table>
							</div>
						  </div>
						</div>
					</div>
					<div style="clear:both;"></div>
				</div>
				<!--用户信息end-->
				<div style="height:20px;background-color:#f2f2f2;"></div>
				
				<!--商品信息begin-->
				<div class="layui-card" style="margin-bottom:0px;">
					<div class="layui-col-md12" >
						<div class="layui-card">
						  <div class="layui-card-header">商品信息</div>
						  <div class="layui-card-body layui-row layui-col-space10" >
							<div class="layui-col-md12">
								<table class="table table-hover">
								<thead class="navbar-inner">
								<tr>
									<th style="width:5%;">ID</th>
									<th style="width:15%;">商品标题</th>
									<th style="width:15%;">商品图片</th>
								</tr>
								</thead>
								<tbody>				
								<tr>
									<td>{$order['goods_id']}</td>
									<td><a href="{:U('group/editgoods', array('id' => $order['goods_id'],'ok'=>1,'page'=>$page))}" target="_blank">{$order['goods_name']}</a></td>
									<td>
									<div style=" width:40px;height:40px;">
										<a href="{:U('group/editgoods', array('id' => $order['goods_id'],'ok'=>1,'page'=>$page))}" target="_blank"><img src="{$goods_images}" style=" width:40px;height:40px;" alt="" title=""></a>
									</div>  
									</td>
									
								</tr>
								</tbody>
								</table>
							</div>
						  </div>
						</div>
					</div>
					<div style="clear:both;"></div>
				</div>
				<!--商品信息end-->
				
			</form>
		</div>
	</div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>

<script>
	layui.config({
		base: '/layuiadmin/' //静态资源所在路径
	}).extend({
		index: 'lib/index' //主入口模块
	}).use('index');
</script>

<script>
//由于模块都一次性加载，因此不用执行 layui.use() 来加载对应模块，直接使用即可：
var layer = layui.layer;
var $;

layui.use(['jquery', 'layer','form'], function(){ 
  $ = layui.$;
  var form = layui.form;
  
  
	$('.deldom').click(function(){
		var s_url = $(this).attr('data-href');
		layer.confirm($(this).attr('data-confirm'), function(index){
					 $.ajax({
						url:s_url,
						type:'post',
						dataType:'json',
						success:function(info){
						
							if(info.status == 0)
							{
								layer.msg(info.result.message,{icon: 1,time: 2000});
							}else if(info.status == 1){
								var go_url = location.href;
								if( info.result.hasOwnProperty("url") )
								{
									go_url = info.result.url;
								}
								
								layer.msg('操作成功',{time: 1000,
									end:function(){
										location.href = info.result.url;
									}
								}); 
							}
						}
					})
				}); 
	})
	
	$('.btn-operation').click(function(){
		var ids_arr = [];
		var obj = $(this);
		var s_toggle = $(this).attr('data-toggle');
		var s_url = $(this).attr('data-href');
		
		
		$("input[name=item_checkbox]").each(function() {
			
			if( $(this).prop('checked') )
			{
				ids_arr.push( $(this).val() );
			}
		})
		if(ids_arr.length < 1)
		{
			layer.msg('请选择要操作的内容');
		}else{
			var can_sub = true;
			if( s_toggle == 'batch-remove' )
			{
				can_sub = false;
				
				layer.confirm($(obj).attr('data-confirm'), function(index){
					 $.ajax({
						url:s_url,
						type:'post',
						dataType:'json',
						data:{ids:ids_arr},
						success:function(info){
						
							if(info.status == 0)
							{
								layer.msg(info.result.message,{icon: 1,time: 2000});
							}else if(info.status == 1){
								var go_url = location.href;
								if( info.result.hasOwnProperty("url") )
								{
									go_url = info.result.url;
								}
								
								layer.msg('操作成功',{time: 1000,
									end:function(){
										location.href = info.result.url;
									}
								}); 
							}
						}
					})
				}); 
			}else{
				$.ajax({
					url:s_url,
					type:'post',
					dataType:'json',
					data:{ids:ids_arr},
					success:function(info){
					
						if(info.status == 0)
						{
							layer.msg(info.result.message,{icon: 1,time: 2000});
						}else if(info.status == 1){
							var go_url = location.href;
							if( info.result.hasOwnProperty("url") )
							{
								go_url = info.result.url;
							}
							
							layer.msg('操作成功',{time: 1000,
								end:function(){
									location.href = info.result.url;
								}
							}); 
						}
					}
				})
			}
		}
	})
  
	form.on('switch(statewsitch)', function(data){
	  
	  var s_url = $(this).attr('data-href')
	  
	  var s_value = 1;
	  if(data.elem.checked)
	  {
		s_value = 1;
	  }else{
		s_value = 0;
	  }
	  
	  $.ajax({
			url:s_url,
			type:'post',
			dataType:'json',
			data:{value:s_value},
			success:function(info){
			
				if(info.status == 0)
				{
					layer.msg(info.result.message,{icon: 1,time: 2000});
				}else if(info.status == 1){
					var go_url = location.href;
					if( info.result.hasOwnProperty("url") )
					{
						go_url = info.result.url;
					}
					
					layer.msg('操作成功',{time: 1000,
						end:function(){
							location.href = info.result.url;
						}
					}); 
				}
			}
		})
	});  
	form.on('checkbox(checkboxall)', function(data){
	  
	  if(data.elem.checked)
	  {
		$("input[name=item_checkbox]").each(function() {
			$(this).prop("checked", true);
		});
		$("input[name=checkall]").each(function() {
			$(this).prop("checked", true);
		});
		
	  }else{
		$("input[name=item_checkbox]").each(function() {
			$(this).prop("checked", false);
		});
		$("input[name=checkall]").each(function() {
			$(this).prop("checked", false);
		});
	  }
	  
	  form.render('checkbox');
	});
  
  //监听提交
  form.on('submit(formDemo)', function(data){
	
	 $.ajax({
		url: data.form.action,
		type: data.form.method,
		data: data.field,
		dataType:'json',
		success: function (info) {
		  
			if(info.status == 0)
			{
				layer.msg(info.result.message,{icon: 1,time: 2000});
			}else if(info.status == 1){
				var go_url = location.href;
				if( info.result.hasOwnProperty("url") )
				{
					go_url = info.result.url;
				}
				
				layer.msg('操作成功',{time: 1000,
					end:function(){
						location.href = info.result.url;
					}
				}); 
			}
		}
	});
	
    return false;
  });
})

</script>  
</body>


