<!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">
	html,
	body {
		height: 100%;
		width: 100%;
		background-color: #F0F0F0;
	}

	.ming-list {
		position: relative;
		overflow: hidden;
	}

	.ming-list-xf {
		position: absolute;
		width: 100%;
		z-index: 10;
		padding: 0.5rem;
		bottom: 97px;
		display: block;
	}

	.ming-bg-b30 {
		background-color: rgba(0, 0, 0, 0.5);
	}

	.ming-list-xf .ming-bg-app,
	.ming-bg-b30 {
		padding: 0.25rem;
		font-size: 0.5rem;
	}

	.mr2 {
		margin-right: 2px
	}

	.flefont {
		padding: 0.25rem;
		background-color: rgba(0, 0, 0, 0.3);
	}

	.aui-card-list-content {
		position: relative;
	}

	#zhezhao {
		position: absolute;
		background-color: rgba(0, 0, 0, 0.3);
		height: 100%;
		width: 100%;
		top: 0;
		left: 0;
	}
</style>

<body>
	<div class="aui-content " ms-controller="homevm">
		<ul class="aui-card-list" id="partylist" ms-each="lists">
			<li ms-if="el.iswho=='party'" class="ming-list" tapmode ms-click="openWin_activity(el.id)" data-repeat-rendered="tapmode_bind">
				<span class="ming-bg-app biaoqian ming-text-white" ms-visible="el.is_open == 1">订</span>
				<div class="ming-list-xf">
					<div class="ming-text-white aui-pull-left aui-font-size-10" style="padding-top: 10px;">
						<span class="ming-bg-b30" ms-visible="el.is_open == 1 && el.ticket_count >0 ">余票<span style="color: #5fa5e2">{{el.ticket_count}}</span>张</span>
						<span class="ming-bg-b30" ms-visible="el.ticket_count == 0 ">无票</span>
						<span class="ming-bg-b30 mr2" ms-repeat-elem="el.tags">{{elem}}</span>
					</div>
					<div class="ming-text-white aui-pull-right">
						<i class="aui-iconfont aui-icon-laud flefont"></i>
						<i class="aui-iconfont aui-icon-star flefont"></i>
						<i class="aui-iconfont" style="top: 7px;">
								<img style="width: 24px;" class="flefont" src="../../image/share.png">
							</i>
					</div>
				</div>
				<div class="aui-card-list-content">
					<img ms-attr-lazy="el.banner" style="height:62vw;width: 100%;" src="../../image/default.png" />
					<!--<div id="zhezhao"></div>-->
				</div>
				<div class="aui-padded-t-5 aui-padded-r-10 aui-padded-l-10 aui-padded-t-10">
					<div class="aui-ellipsis-1">{{el.title}}</div>
				</div>
				<div class="aui-padded-t-5 aui-padded-r-10 aui-padded-l-10 aui-font-size-14">
					<i class="aui-iconfont aui-icon-date aui-padded-r-5 ming-text-app"></i>{{el.hddate*1000|date("yyyy-MM-dd")}} {{el.hdtime}} <span ms-if="el.show_end == '1'">至 {{el.end_time*1000|date("yyyy-MM-dd HH:mm")}}</span>
				</div>
				<div class="aui-padded-t-5 aui-padded-b-10 aui-padded-r-10 aui-padded-l-10 aui-font-size-14 aui-ellipsis-1">
					<i class="aui-iconfont aui-icon-location aui-padded-r-5 ming-text-app"></i>{{el.place}}
				</div>
			</li>
		</ul>
    <p id="nodata" style="text-align:center;margin-top:80px;display:none;">无活动数据！</p>
	</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" src="../../script/constants.js"></script>
<script type="text/javascript">
	apiready = function() {
		fnInitPullRefresh(function(ret) {
			homevm.lists = [];
			homevm.getlist();
		})
		fnInitScrollToBottom(function(ret){
						homevm.getlist();
		});
		api.refreshHeaderLoading();
	};
	avalon.ready(function() {
		window.homevm = avalon.define({
			$id: 'homevm',
			lists: [],
			t: 0,
      // 9>获得当前场馆正在进行的活动列表
      // 接口：api/party/getingparty
      // 参数：{venue_id}场馆的id
			getlist: function() {
				get_data('/api/party/getingparty', 'post', {
          venue_id:$api.getStorage('venue_detail_id'),
				}, function(ret) {
          // console.log('venue_id' + $api.getStorage('venue_detail_id'))
					// console.log('活动1' + JSON.stringify(ret))
          api.refreshHeaderLoadDone();
					if (ret.status == 1) {
						api.refreshHeaderLoadDone();
						homevm.lists = [];
						ret.data.forEach(function(el) {
								el.iswho = 'party';

								homevm.lists.push(el);
							})
					}else{
            $("#nodata").show();
						// homevm.page --;

					}
				});
			},
			getlist_article: function() {
				get_data('/api/document/getNewArticle', 'post', {}, function(ret) {
					api.refreshHeaderLoadDone();
					//console.log(JSON.stringify(ret))
					if (ret.status == 1) {
						//为avalon变量追加数据 实现分页
						//homevm.lists.pushArray(ret.data||[]);
						ret.data.forEach(function(el) {
							el.iswho = 'article';
							homevm.lists_article.push(el);
							//homevm.alllists.push(el);
						})
						homevm.t++;
						//homevm.hblist();
					}
				});
			},
			sortbytime: function(x, y) {
				return (x.sorttime < y.sorttime) && (x.is_top <= y.is_top) ? 1 : -1;
			},
			hblist: function() {
				console.log("t=" + homevm.t);
				if (homevm.t % 2 == 0) {
					homevm.alllists = [];
					homevm.lists_article.forEach(function(el) {
						homevm.alllists.push(el);
					})
					homevm.lists.forEach(function(el) {
						homevm.alllists.push(el);
					})
					homevm.alllists.sort(homevm.sortbytime);
				}

			},
			getalllist: function() {
				get_data('/api/party/appindexlist', 'post', {}, function(ret) {
					api.refreshHeaderLoadDone();
					// console.log(JSON.stringify(ret))
					if (ret.status == 1) {
						//为avalon变量追加数据 实现分页
						//homevm.lists.pushArray(ret.data||[]);
						ret.data.forEach(function(el) {

							homevm.alllists.push(el);
							//homevm.alllists.push(el);
						})

					}
				});
			},
			nolist: function() {
				homevm.lists = []
				api.refreshHeaderLoadDone();
			},
			tapmode_bind: function() {
				api.parseTapmode();
			}
		});
		avalon.scan();
	});
</script>

</html>
