<!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;
	}
	.aui-list-item-media img {
		width: 100%;
		height: 3.75rem !important;
		border-radius: 0.5rem;

	}
	.aui-list .aui-list-item-media {
		height: 4.5rem;
		padding-right: 0.5rem;
		overflow: hidden !important;
		width: 6rem!important;
		margin-bottom: 10px!important;
	}
	.aui-list-item-title{
		text-align: justify;
	}
</style>

<body>

	<div class="aui-content aui-margin-b-15" ms-controller="homevm">
		<ul class="aui-list aui-media-list" ms-repeat="lists">
			<li class="aui-list-item" ms-click="openWin_activity(el.id)">
					 <div class="aui-media-list-item-inner">
							 <div class="aui-list-item-media">
									 <img ms-attr-lazy="el.banner" src="../../image/default.png">
							 </div>
							 <div class="aui-list-item-inner">
									 <div class="aui-list-item-text ">
											 <div class="aui-list-item-title aui-font-size-12 " ms-text="el.title"></div>

									 </div>
									 <div class="aui-padded-r-10 aui-padded-l-5 aui-font-size-12 st ">
										<i class="aui-iconfont aui-icon-date aui-padded-r-5 ming-text-app aui-font-size-12"></i>{{el.hddate|date("yyyy-MM-dd")}} {{el.hdtime}}
									</div>
									<div class="aui-padded-b-10 aui-padded-r-10 aui-padded-l-5 aui-font-size-12">
										<i class="aui-iconfont aui-icon-location aui-padded-r-5 ming-text-app aui-font-size-12"></i>{{el.place}}
									</div>
							 </div>
					 </div>

			 </li>
			</ul>
	</div>
	<!--<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>
				<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|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>

			<li ms-if="el.iswho=='article'" class="ming-list" tapmode ms-click="openWin_article_detail(el.id)"  data-repeat-rendered="tapmode_bind">
					<div ms-if="el.tags" 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 mr2" ms-repeat-elem="el.tags">{{elem}}</span>
						</div>
					</div>
					<div class="aui-card-list-content">
						<img ms-attr-lazy="el.cover" style="height:62vw;width: 100%;" src="../image/default.png" />
					</div>
					<div class="aui-padded-t-5 aui-padded-r-10 aui-padded-l-10 aui-padded-t-10">
						<div class="aui-ellipsis-1" ms-text="el.title"></div>
					</div>
					<div class="aui-padded-t-5 aui-padded-b-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><span ms-text="el.create_time"></span>
						<i class="aui-iconfont aui-icon-display aui-padded-r-5 ming-text-app"></i><span ms-text="el.view"></span>
						<i class="aui-iconfont aui-icon-laud aui-padded-r-5 ming-text-app"></i><span ms-text="el.extend"></span>
					</div>
				</li>
		</ul>
	</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.page = 1;
			//homevm.lists_article = [];
			homevm.getlist();
			// homevm.getlist_article();
			// homevm.hblist();
			// homevm.alllists=[];
			// homevm.getalllist();
		})
		fnInitScrollToBottom(function(ret){
						homevm.page++;
						homevm.getlist();
					});
		api.refreshHeaderLoading();
	};
	avalon.ready(function() {
		window.homevm = avalon.define({
			$id: 'homevm',
			lists: [],
			//lists_article: [],
			//alllists: [],
			t: 0,
			getlist: function() {
				get_data('/api/party/flpartylist', 'post', {
					page_size:5,
					page:homevm.page,
				}, function(ret) {
					console.log('活动' + JSON.stringify(ret))
					if (ret.status == 1) {
						api.refreshHeaderLoadDone();
						//为avalon变量追加数据 实现分页
						//homevm.lists.pushArray(ret.data||[]);
						ret.data.forEach(function(el) {
								el.iswho = 'party';
								homevm.lists.push(el);
								//homevm.lists.sort(homevm.sortbytime);
								//homevm.alllists.push(el);
							})
							//homevm.t++;
							//homevm.hblist();
					}else{
						api.refreshHeaderLoadDone();
						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>
