<!DOCTYPE html>
<html lang="en">

	<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" />
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../../css/aui.2.0.css" />
		<link rel="stylesheet" type="text/css" href="../../css/imgbrowser.css" />
		<style type="text/css">
			.history {
				margin: 10px;
				background-color: #ffffff;
				display: block;
				color: #666666;
			}

			.text {
				padding: 10px;
				font-size: 0.7rem;
				line-height: 1rem;
			}

			.img {
				padding: 0px 7px;
				display: -webkit-flex;
				-webkit-flex-wrap: wrap;
				display: flex;
				flex-wrap: wrap;
			}

			.pic {
				overflow: hidden;
				width: 33%;
			}

			.pic img {
				padding: 0 3px;
				width: 100%;
				height: auto;
			}

			.write {
				padding: 0 10px;
				padding-bottom: 0.5rem;
			}

			span {
				color: #000;
				font-weight: bold;
			}

			.ms-controller,
			[ms-controller] {
				display: none
			}
			.arrow{ position:absolute; width:20px; height:20px; top:-20px; left:20px; }
      .arrow *{ display:block; border-width:10px; position:absolute; border-style:solid dashed dashed dashed; font-size:0; line-height:0; }
      .arrow span{border-color:transparent transparent #F3F3F5; top:0;}
			.leftlike{display:block;position:absolute;left:0;height:100%;width:75px;}
			.rightreplay{display:block;position:absolute;left:75px;height:100%;width:75px;}
			.likereplay{display:none;height:40px;width:150px;position:relative;right:100px;
				background:url(../../image/likeplay.png) center; background-size:100% 100%;
				bottom:10px;
			}
			.clicklike{margin-right:5px;color:#576B95;font-size:12px;}
		</style>
	</head>

	<body style="background:#fff;">
		<div ms-controller="work_history_main">
			<div class="history" ms-repeat="historylist">
				<div class="text" ms-text="el.content">
				</div>
				<div class="img">
					<div class="pic" ms-repeat-pic=el.pic>
						<img ms-attr-lazy="pic.logo" src="../../image/default.png" ms-attr-data-preview-src="pic.path" ms-attr-data-preview-group="1">
					</div>
					<div class="pic" ms-if="el.video != '' " tapmode ms-click="fnPlay(el.video)">
						<img src="../../image/video_bg.png">
					</div>
				</div>
				<div class="write">

					<div>
						<p class="aui-font-size-12" ms-text="el.map_addr"></p>
						<p class="aui-font-size-12">{{el.create_time*1000|date("yyyy-MM-dd HH:mm:ss")}}</p>
					</div>
				</div>
				<!-- aui-border-t  -->
				<div ms-if="el.givelike.length>0 || el.report_review.length>0" class="aui-padded-t-10" style="background:#F3F3F5;position:relative;margin-top:10px;">
					<div class="arrow">
						<span></span>
					 </div>
					 <div ms-if="el.givelike && el.givelike.length>0" style="width:100%">
	 						<div ms-repeat-like="el.givelike" class="qq">
	 							 <span style="margin-left:10px;margin-right:5px"><img style="height:15px;width:15px;" src="../../image/xinlike.png"/></span><span class="aui-font-size-12  clicklike">{{like.nickname}}</span>
	 						</div>
	 				</div>
					<div ms-if="el.report_review && el.report_review.length>0">
					<div ms-repeat-dianping="el.report_review" class="aui-padded-l-10 aui-padded-r-10">

						<p ms-click="replay(dianping.uid,dianping.id)" class="aui-font-size-12">
							<span class="aui-font-size-12" style="color:#576B95;font-size:12px;line-height:30px;">{{dianping.nickname}}</span>: {{dianping.content}}
							<!-- <span class="aui-pull-right aui-font-size-12">{{dianping.create_time*1000|date("yyyy-MM-dd HH:mm")}}</span> -->
						</p>
						<div ms-if="dianping.replay!=''">
                   <div ms-repeat-replay="dianping.replay" class="aui-padded-r-10">
										 <!-- <p class="aui-font-size-12" ms-click="replay(dianping.uid,dianping.id)">{{replay.content}}</p> -->
										 <div class="aui-font-size-12" style="display:block;line-height:20px;width:100%;min-height:30px;">
											 <span style="color:#576B95;font-size:12px">{{replay.fname}}</span>回复<span style="color:#576B95;font-size:12px">{{replay.tname}}</span>:{{replay.content}}

										   <!-- <span class="aui-pull-right aui-font-size-12">{{replay.create_time*1000|date("yyyy-MM-dd HH:mm")}}</span> -->
									   </div>
										 <!-- <div>
										   <span class="aui-pull-right aui-font-size-12">{{replay.create_time*1000|date("yyyy-MM-dd HH:mm")}}</span>
										 </div> -->
									 </div>
						</div>
					</div>
				</div>
				</div>
			</div>
			<div ms-if="!hasdata">
					暂无汇报记录
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/avalon.js"></script>
	<script type="text/javascript" src="../../script/ming-zoom.js"></script>
	<script type="text/javascript" src="../../script/ming-imgBrowser.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript">
		apiready = function() {
			//			init();
			fnInitPullRefresh(function(ret) {
				work_history_main.historylist = [];
				work_history_main.page = 1;
				work_history_main.fnhislist();
				//init();
			})
			fnInitScrollToBottom(function(ret) {
				work_history_main.page++;
				work_history_main.fnhislist();
			});
			api.refreshHeaderLoading();
		};

		function init() {
			work_history_main.fnhislist();
		}
		function fnPlay(urls) {
			api.openVideo({
				url: urls
			});
		}
		avalon.ready(function() {
			window.work_history_main = avalon.define({
				$id: 'work_history_main',
				token: '',
				page: 1,
				historylist: [],
				hasdata:true,
				fnhislist: function() {
					work_history_main.token = $api.getStorage('token');
					console.log(api.pageParam.sdate);
					var showrtype = $api.getStorage('showrtype');
					if(showrtype=='review'){
						console.log('review');
						get_data('/api/Report/myreviewreplayList', 'post', {
							token: work_history_main.token,
							page: work_history_main.page,
							sdate:$api.getStorage('sdate'),
						}, function(ret) {
							// console.log(JSON.stringify(ret))
							if(ret.status == 1) {
								ret.data.forEach(function(el) {
									work_history_main.historylist.push(el);
								})
								if(work_history_main.historylist.length==0){
									work_history_main.hasdata = false;
								}
								api.refreshHeaderLoadDone();
								ming.previewImage();
							} else {
								work_history_main.page--;
							}

						});
					}else{
						console.log('report');
						get_data('/api/Report/myList', 'post', {
							token: work_history_main.token,
							page: work_history_main.page,
							sdate:$api.getStorage('sdate'),
						}, function(ret) {
							// console.log(JSON.stringify(ret))
							if(ret.status == 1) {
								ret.data.forEach(function(el) {
									work_history_main.historylist.push(el);
								})
								if(work_history_main.historylist.length==0){
									work_history_main.hasdata = false;
								}
								api.refreshHeaderLoadDone();
								ming.previewImage();
							} else {
								work_history_main.page--;
							}

						});
					}

				}
			})
			avalon.scan();
		})
	</script>

</html>
