index.phtml 3.23 KB
<script>
__custom = {'yopid':'index'};

</script>

<script type="text/javascript">
	//读取cookie中的性别
	$(document).ready(function(){
	var gender = $.cookie('_Gender');
	if(typeof gender == 'undefined' || gender == '' || gender == null){
		$.get('/index/guide', function(data){
			var newMask = document.createElement("div");
			newMask.id = 'cover';
			newMask.innerHTML=data;	
			document.body.appendChild(newMask);
			var p_h = $('#cover').height();
			var h = (p_h-400)/2;
			$('#cover .guide-box').css('top',h+'px');
			$('#cover').bind('click', function(event){
				$.setcookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
				closeCover();	
			});
			$('#cover .guide-box .close').bind('click', function(event){
				getSource('弹窗','CLOSE','homepage_man');
				$.setcookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
				analy('guide_close');
				
				closeCover();	
			});
			$('.boys img').bind('click', function(event){
				getSource('弹窗','BOYS','homepage_man');
				$.setcookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
				analy( 'guide_boys');
				closeCover();	
			});
			$('.girls img').bind('click', function(event){
				getSource('弹窗','GIRLS','homepage_woman');
				$.setcookie('_Gender','2,3',{path : '/',domain : '.yohobuy.com',expires : 90});
				analy( 'guide_girls');
			});
			$('#cover .guide-box .go').bind('click', function(event){
				if($(this).hasClass('goboys')){
					getSource('弹窗','BOYS','homepage_man');
					$.setcookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
					analy('guide_boys');
				}else{
					getSource('弹窗','GIRLS','homepage_woman');
					$.setcookie('_Gender','2,3',{path : '/',domain : '.yohobuy.com',expires : 90});
					analy('guide_girls');
				}
				closeCover();
			});
			//防止冒泡事件
			$('#cover .guide-box').bind('click', function(event){
				event.stopPropagation();
			});
			
		});	
 	}
	function closeCover(){
		var cover = $('#cover');
		cover.remove();
	}
	
	});
	function analy(click_name){
		var _analysis = new QAnalysis;
		_analysis.dataCollect({
		    'click_homeguide_name': click_name
		});
	}
	

</script>
<div class="wrapper screen wrapper-index2">
	<?php 
	$info = QINOperations_Models_Plugin_Content_Client::getContentList(1, 1);
	$num = 0;
	foreach ($info as $v){
		$floor = $v;
		$floor['plugin_content'] = json_decode($v['plugin_content'], true);
		$floor['gender'] = '1,3';
		$floor['floor'] = $num;
		print QLib_Sidebar::show($floor['plugin_file_name'], $floor);
		$num++;
	}
	?>
</div> 
<?php print QLib_Sidebar::show('indexFoot', array('resutl' => 1));?>
<script type="text/javascript">
$.imageHover();
</script>
<div id="tjnode">

</div>
<script type="text/javascript">
$(document).ready(function(){
	var tj_uid = $.uid('_UID');
	if(tj_uid == 0){
		tj_uid ="";
	}
	var str = '<script type="text/javascript" src="http://static.criteo.net/js/ld/ld.js" async="true"><\/script>';
	str += '<script type="text/javascript">';
	str +='window.criteo_q = window.criteo_q || [];window.criteo_q.push({ event: "setAccount", account: 16184 },{ event: "setCustomerId", id: "'+tj_uid+'"},{ event: "setSiteType", type: "d" },{ event: "viewHome" });';
	str +='<\/script>';
	$('#tjnode').html(str);
});
</script>