<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>{:C('WEB_SITE_TITLE')}_管理中心</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<include file="Inc/files" />
		<style type="text/css">
			table{border-color: #7F7F7F;font-size: 14px;}
			tr td{padding: 0 10px;line-height: 40px;}
			tr td:nth-child(1){width: 150px;background: #F5F5F5;}
			tr td:nth-child(2){width: 250px;}
			tr td:nth-child(3){width: 150px;background: #F5F5F5;}
			tr td:nth-child(4){width: 250px;}
		</style>
		<script src="__TPLPUBLIC__/js/avalon.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body id="add" class="ms-controller" ms-controller="myController">
		<div id="location">

			<span>{$category['title']}订单详情</span>
		</div>
		<php>
			$userconfig=userconfig_get($info['uid']);
		</php>
		<table style="width: 800px;"cellpadding="0" cellpadding="0" border="1">
			<tr>
				<td>商户订单</td>
				<td colspan="3">{$info.no}</td>
			</tr>
			<tr>
				<td>软件ID</td>
				<php>
				$file_pk=$info['file_pk'];
				$file_pk=json_decode($file_pk,true);
				</php>
				<td colspan="3">{$file_pk['pk4']}</td>
			</tr>
			<tr>
				<td>软件名称</td>
				<td colspan="3">{$info.name}</td>
			</tr>
			<tr>
				<td>下载地址</td>
				<td colspan="3">
					<a href="http://<?php echo $userconfig['domain'].'.'.($userconfig['member_wangpan_type']>1?C('FUFEI_WANGPAN'):C('DOMAIN_WANGPAN'));?>" target="_blank"><?php echo $userconfig['domain'].'.'.($userconfig['member_wangpan_type']>1?C('FUFEI_WANGPAN'):C('DOMAIN_WANGPAN'));?>
			</tr>
			<tr>
				<td>卖家名称</td>
				<td>{$userconfig.member_truename}</td>
				<td>联系方式（卖家）</td>
				<td>{$userconfig.member_mobile}</td>
			</tr>
			<tr>
				<td>买家信息</td>
				<td>{$info.email}<br>{$info.mobile}</td>
				<td>买家IP</td>
				<td>{$info.ip}</td>
			</tr>
			<tr>
				<td>购买时间</td>
				<td>{$info.ctime|date='Y-m-d H:i:s',###}</td>
				<td>支付方式</td>
				<td>{$info.pay_way}</td>
			</tr>
			<tr>
				<td>支付金额</td>
				<td>{$info.amount}</td>
				<td>支付状态</td>
				<td>{$info.status|get_status=###,status,58}</td>
			</tr>
			<tr>
				<td>是否下载</td>
				<td><if condition="$info.downtime gt 0">已下载<else/>未下载</if></td>
				<td>提取码</td>
				<td>{$info.code}</td>
			</tr>
			<tr>
				<td>赠品</td>
				<td colspan="3">{$info.card}</td>
			</tr>
		</table>
		
		<include file="Inc/boot" />
		<script type="text/javascript">
			var vm = avalon.define({
				$id: "myController",
				list_goods_attr: []
			})
			jQuery(document).ready(function($) {
				try {
					$("select[name='goods_type']").on('change', function() {
						var the = $(this);
						$.post(
							'/admin.php?s=/Goodsattr/lists', {
								type_id: the.val()
							},
							function(data) {
								vm.list_goods_attr = data;
							}
						);
					});
					$(document).on('click', '.btn-attr-add', function() {
						var the = $(this);
						the.closest('ul').find('.btn-attr-remove').show();
						$(this).closest('li').after($(this).closest('li').clone());
					});
					$(document).on('click', '.btn-attr-remove1', function() {
						var the = $(this);
						if(the.closest('li').siblings().length > 0) {
							the.closest('li').remove();
						} else {
							the.closest('dl').remove();
						}
						var id = $(this).closest('li').attr('data-id');
						$.post(
							"{:U('attr_price_del')}", {
								id: id
							}
						);
					});
					$(document).on('click', '.btn-attr-remove', function() {
						var the = $(this);
						if(the.closest('li').siblings().length > 0) {
							the.closest('li').remove();
						} else {
							the.closest('dl').remove();
						}
					});
					//修改属性价格
					$(document).on('blur', '.attr_price', function() {
						var the = $(this);
						var id = $(this).closest('li').attr('data-id');
						$.post(
							"{:U('attr_price')}", {
								id: id,
								price: the.val()
							}
						);
					});
				} catch(e) {}
				try {
					$(document).on('change', '.goods_attr_search', function() {
						var the = $(this);
						the.next('select').remove();
						$.post(
							'{:U("Ajax/goods_type_attr")}', {
								type_id: the.val()
							},
							function(data) {
								var html = '<select name="filter_attr[]"><option value="0">请选择...</option>';
								for(var i in data) {
									html += '<option value="' + data[i]['id'] + '">' + data[i]['name'] + '</option>';
								}
								html += '</select>';
								if(data.length > 0) {
									the.after(html);
								}
							}
						)
					});
					$(document).on('click', '.goods_attr_search_add', function() {
						var the = $(this);
						the.closest('div').after(the.closest('div').clone());
					});
					$(document).on('click', '.goods_attr_search_remove', function() {
						var the = $(this);
						if($(".goods_attr_search_remove").length <= 1) {
							return false;
						}
						the.closest('div').remove();
					});
				} catch(e) {}
			});
		</script>
	</body>

</html>