<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" type="text/css" href="../../css/aui.2.0.css" />
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
	</head>
	<style type="text/css">
		body,
		html {
			height: 100%;
			width: 100%;
			background-color: #F5F5F5;
		}

		.aui-content {
			margin-top: 0.25rem;
		}

		.aui-list-item-text .aui-font-size-10 {
			padding-top: 0rem;
		}
		.btn{
      background: #519ADE;
      border-radius: 3px;
      width: 62px;
      height: 24px;
      color: #fff;
      position: absolute;
      font-size: 12px;
      bottom: 10px;
      right: 15px;
      text-align: center;
      line-height: 24px;
			z-index: 100;
    }
		.pral{
			position: relative;
		}
	</style>

	<body>
		<div class="aui-content" ms-controller='order_main'>
			<div class="aui-list aui-media-list aui-list-noborder ">
				<div class="aui-margin-t-10 pral" ms-repeat="lists" tapmode ms-click="openWin_order_detail(el.id,el.type)" data-repeat-rendered="tabmode_bind">
					<div class="aui-list-item ming-bg-white">
						<div class="aui-media-list-item-inner">
							<!--<div class="aui-list-item-media">
								<img ms-attr-src="{{el.banner}}">
							</div>-->
							<div class="aui-list-item-inner">
								<div class="aui-list-item-title aui-ellipsis-1 aui-font-size-14" >
									{{el.title}}
								</div>
								<div ms-if="el.roomname!=0" class="aui-list-item-title aui-ellipsis-1 aui-font-size-14">
									功能室：{{el.roomname}}
								</div>
								<div ms-if="el.hddate" class="aui-list-item-text aui-font-size-12 aui-ellipsis-1"><i class="aui-iconfont aui-icon-date aui-font-size-14"> {{el.hddate*1000|date("yyyy-MM-dd")}}&nbsp;{{el.hdtime}} </i></div>
								<div class="aui-list-item-text aui-font-size-12 aui-ellipsis-1"><i class="aui-iconfont aui-icon-location aui-font-size-14"> {{el.place}}</i></div>
							</div>
						</div>
					</div>
					<div class="btn" ms-click="open_pingjia(el.rid,el.id,el.banner)" ms-if="el.hx_status==10&&el.pingjia==0">去评价</div>

				</div>

			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/zepto.js"></script>
	<script type="text/javascript" src="../../script/avalon.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript">
		apiready = function() {
			api.addEventListener({
				name: 'changeorder'
			}, function(ret, err) {
				order_main.lists = [];
				order_main.page = 1;
				var id_arr = [0, 1];
				var index = ret.value.index;
				order_main.audit = id_arr[index];
				order_main.getlist();
			});
			fnInitPullRefresh(function(ret) {
				order_main.lists = [];
				order_main.page = 1;
				order_main.getlist();
			})
			fnInitScrollToBottom(function(ret) {
				order_main.page++;
				order_main.getlist();
			});
			api.refreshHeaderLoading();
			
		};

		avalon.ready(function() {
			window.order_main = avalon.define({
				$id: 'order_main',
				id: 0,
				audit: 0,
				page: 0,
				lists: [],
				getlist: function() {
					get_data('/api/Reserve/myReserveLists', 'post', {
						token: $api.getStorage('token'),
						type: order_main.audit,
						page: order_main.page,
					}, function(ret) {
						//返回值中type是0表示活动预约，返回值是1表示场馆预约
						console.log(JSON.stringify(ret));
						api.refreshHeaderLoadDone();
						if(ret.status == 1) {
							ret.data.forEach(function(el) {
								order_main.lists.push(el);
							})
						} else {
							order_main.page--;
						}
					});
				},
				tapmode_bind: function() {
					api.parseTapmode();
				},
				open_pingjia: function(id,pid,banner){
					console.log(id);
					api.openWin({
						name: 'pingjia',
						url: './pingjia.html',
						bounces: false,
						slidBackEnabled: true,
						vScrollBarEnabled: false,
						pageParam: {
								"id": id,
								"pid": pid,
								"banner": banner
						},
						animation: {
							type: 'fade',
							duration: 300
						}
					});
				}
			});
			avalon.scan();
		});
	</script>

</html>
