You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
307 lines
12 KiB
307 lines
12 KiB
{layout name="layout" /}
|
|
<style>
|
|
#propage{padding: 15px 20px;text-align: left;color: #ccc;text-align:center;}
|
|
#propage a{display: inline-block;color:#666;display: inline-block;line-height:1.4em;padding:6px 12px;border: 1px solid #ddd; margin: 0 2px;border-radius: 4px;vertical-align: middle;}
|
|
#propage a:hover{text-decoration: none;border: 1px solid #d43f3a;}
|
|
#propage span.current{display: inline-block;line-height:1.4em;padding:6px 12px;margin: 0 2px;color: #fff;background-color:#d43f3a; border: 1px solid #d43f3a;border-radius: 4px;vertical-align: middle;}
|
|
#propage span.disabled{ display: inline-block;line-height:1.4em;padding:6px 12px;margin: 0 2px; color: #bfbfbf;background: #f2f2f2;border: 1px solid #bfbfbf;border-radius: 4px;vertical-align: middle;}
|
|
</style>
|
|
<div class="projectWraper" >
|
|
<div class="retrieve-wrapper">
|
|
<div class="content">
|
|
{if condition="count($profilters)"}
|
|
{foreach name="profilters" item="vo"}
|
|
<input type="hidden" id="{$vo.key}" value="" />
|
|
<div id="{$vo.key}" class="ret-item ret-select">
|
|
<div class="left">{$vo.title}:</div>
|
|
<div class="right">
|
|
<a href="javascript:void(0);" data-id="" class="subitem active">不限</a>
|
|
{if condition="count($vo['filters'])"}
|
|
{foreach name="vo['filters']" item="jo"}
|
|
<a href="javascript:void(0);" data-id="{$jo.id}" class="subitem">{$jo.name}</a>
|
|
{/foreach}
|
|
{/if}
|
|
<div class="more" style="display: block;"><i class="icon-arrows-down"></i></div>
|
|
</div>
|
|
</div>
|
|
{/foreach}
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
<div class="paixu-wrapper">
|
|
<div class="content">
|
|
<div class="paixu clearfix">
|
|
<div class="paixu-item paixu-select px-update active up" data-val="">
|
|
<div class="word">更新</div>
|
|
<div class="arrow"><i class="icon-arrows-down"></i></div>
|
|
</div>
|
|
<div class="paixu-item paixu-select px-jifen" data-val="reputation">
|
|
<div class="word">按照信用积分排序</div>
|
|
<div class="arrow"><i class="icon-arrows-down"></i></div>
|
|
</div>
|
|
<input type="hidden" id="prosort" value="" />
|
|
<div class="paixu-item px-search">
|
|
<div class="search-wrapper">
|
|
<form id="seaForm" class="search-form" onsubmit="return false;">
|
|
<i class="icon-search"></i>
|
|
{:token('__cult__')}
|
|
<input class="search-input" type="text" placeholder="搜索">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="project-wrapper">
|
|
<div class="content">
|
|
<div class="project clearfix">
|
|
|
|
</div>
|
|
<div class="col-xs-12 text-center list-page" align="center">
|
|
<ul id="propage" class="pagination">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" src="{$yf_theme_path}public/js/jquery.page.js"></script>
|
|
<script>
|
|
//项目分类
|
|
$(function(){
|
|
// 检索收缩箭头
|
|
$(".ret-select .more").click(function(event) {
|
|
event.preventDefault();
|
|
var has=$(this).hasClass('open');
|
|
var parent=$(this).parents('.ret-item');
|
|
console.log(has);
|
|
if(has===true){
|
|
$(this).removeClass('open');
|
|
parent.animate({'max-height':'26px'},500);
|
|
}else{
|
|
$(this).addClass('open');
|
|
parent.animate({'max-height':'200px'},500);
|
|
}
|
|
})
|
|
|
|
$(".ret-item").each(function () {
|
|
let $this = $(this)
|
|
let $right = $this.find('.right')
|
|
let $more = $this.find('.more')
|
|
let height = $right.height()
|
|
console.log(height);
|
|
if (height > 26) {
|
|
$more.show();
|
|
$more.trigger('click');
|
|
}
|
|
})
|
|
$("body").on('click','.subitem',function(){
|
|
var parent=$(this).parents('.ret-select');
|
|
var id=parent.attr('id');
|
|
var val=$(this).data('id');
|
|
var last=$("#"+id).val();
|
|
$("#"+id).val(val);
|
|
if(last!=val){
|
|
parent.find('.active').removeClass('active');
|
|
$(this).addClass('active');
|
|
fillProject(1,1);
|
|
}
|
|
});
|
|
var prolist=[];
|
|
var userscore="{$userscore}";
|
|
var profile={$profile};
|
|
//检查积分
|
|
$("body").on('click','.project-item',function(){
|
|
event.preventDefault();
|
|
var index=$(this).index();
|
|
if(userscore==''){
|
|
layer.msg('请先登录');
|
|
setTimeout(function(){
|
|
window.location.href="{:url('culture/common/login')}";
|
|
},2000);
|
|
return false;
|
|
}
|
|
if(profile==false){
|
|
layer.msg('您的资料未完善,无法查看项目信息,请先完善资料');
|
|
return false;
|
|
}
|
|
layer.load(1, {shade: [0.1,'#fff']});
|
|
userscore=parseInt(userscore);
|
|
if(typeof prolist[index]!='undefined'){
|
|
var current=prolist[index];
|
|
console.log(current);
|
|
var id=current.id;
|
|
var score=current.reputation;
|
|
var url="{:url('checkScore')}";
|
|
var jump="__URL__/detail/id/"+id+".html";
|
|
if(score>userscore){
|
|
layer.closeAll();
|
|
layer.msg('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看');
|
|
return false;
|
|
}else{
|
|
window.location.href=jump;
|
|
}
|
|
}
|
|
});
|
|
|
|
layer.load(1, {shade: [0.1,'#fff']});
|
|
function projects(list){
|
|
var html='';
|
|
console.log(list);
|
|
prolist=list;
|
|
list.forEach(function(item){
|
|
html+='<div class="project-item clearfix">';
|
|
html+='<div class="project-media">';
|
|
var jump="javascript:void(0);";
|
|
html+='<div class="top-padding"></div>';
|
|
html+='<div class="img-box">';
|
|
html+='<img src="'+item['logo']+'" onerror="this.src=\'{$yf_theme_path}assets/img/default.png\'">';
|
|
html+='</div></div>';
|
|
html+='<div class="project-content"><h2 class="project-title">'+item['name']+'</h2>';
|
|
|
|
html+='<div class="cats">'+item['subname']+'</div>';
|
|
html+='<div class="project-info">'+item['major_product_introduction']+'</div>';
|
|
html+='<div class="jifen"> 信誉积分:<span>'+item['reputation']+'</span></div>';
|
|
html+='<div class="project-foot"><div class="project-time">'+item['date']+'</div></div></div></div>';
|
|
|
|
});
|
|
return html;
|
|
}
|
|
function propage(meta){
|
|
var per_page=meta['per_page'];
|
|
var total=parseInt(meta['total']);
|
|
var current_page=parseInt(meta['current_page']);
|
|
var pages=Math.ceil(total/per_page);
|
|
console.log(pages);
|
|
|
|
var total=parseInt(meta['total']);
|
|
var html='<div id="retpage" class="ret-item"><div class="left">已选条件:</div><div class="right">';
|
|
html+='<div class="num-wrapper">共<span class="num">'+total+'</span>个机构满足条件</div></div></div>';
|
|
$("#retpage").remove();
|
|
$(".retrieve-wrapper .content").append(html);
|
|
var lastpage=parseInt(meta['last_page']);
|
|
$("#propage").remove();
|
|
$(".list-page").append('<ul id="propage" class="pagination"></ul>');
|
|
$("#propage").createPage({
|
|
pageCount:lastpage,
|
|
current:current_page,
|
|
backFn:function(p){
|
|
console.log("page:"+p);
|
|
fillProject(p,0);
|
|
}
|
|
});
|
|
return html;
|
|
}
|
|
|
|
var prourl="{:url('ajaxprojects')}";
|
|
function fillProject(curpage,showpage){
|
|
layer.load(1, {shade: [0.1,'#fff']});
|
|
var keyword=$(".search-input").val();
|
|
var sort=$("#prosort").val();
|
|
var region=$("#region").val();
|
|
var investment=$("#investment").val();
|
|
var industry=$("#industry").val();
|
|
|
|
var query="page="+curpage;
|
|
if(keyword){
|
|
query+="&keyword="+keyword;
|
|
}
|
|
if(sort){
|
|
query+="&sort="+sort;
|
|
}
|
|
if(industry){
|
|
query+="&industry_id="+industry;
|
|
}
|
|
if(investment){
|
|
query+="&investment_id="+investment;
|
|
}
|
|
if(region){
|
|
query+="®ion_id="+region;
|
|
}
|
|
|
|
var url=prourl+"?"+query;
|
|
$(this).attr('disabled',true);
|
|
console.log(url);
|
|
$.get(url,function(res){
|
|
$(this).attr('disabled',false);
|
|
res=JSON.parse(res);
|
|
layer.closeAll();
|
|
|
|
$("input[name='__cult__']").val(res.token);
|
|
console.log("token",res.token);
|
|
if(typeof res =='object'){
|
|
var data=res.projects;
|
|
data=JSON.parse(data);
|
|
if(typeof data =='object'&&typeof data['data']!='undefined'){
|
|
var meta=data['meta'];
|
|
var list=data['data'];
|
|
if(showpage){
|
|
$("#propage").html("");
|
|
propage(meta);
|
|
}
|
|
var html=projects(list);
|
|
$(".project").html(html);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
var curpage=1;
|
|
function searchProject(){
|
|
var keyword=$(".search-input").val();
|
|
if(typeof keyword=='undefined'||keyword==null||keyword==''){
|
|
layer.msg('请输入搜索关键字');
|
|
return false;
|
|
}
|
|
fillProject(1,1);
|
|
}
|
|
$(".icon-search").click(function(event){
|
|
event.preventDefault();
|
|
searchProject();
|
|
})
|
|
$("#seaForm .search-input").keyup(function(event){
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
if(event.keyCode ==13){
|
|
searchProject();
|
|
}
|
|
return false;
|
|
})
|
|
|
|
$(".paixu-select").each(function(){
|
|
$(this).click(function(){
|
|
var has=$(this).hasClass('active');
|
|
if(!has){
|
|
$(".paixu-item").removeClass('active').removeClass('up');
|
|
$(this).addClass('active').addClass('up');
|
|
var key=$(this).data('val');
|
|
$("#prosort").val(key);
|
|
fillProject(1,0);
|
|
}
|
|
});
|
|
});
|
|
//项目列表
|
|
$.get(prourl,function(res){
|
|
res=JSON.parse(res);
|
|
layer.closeAll();
|
|
|
|
$("input[name='__cult__']").val(res.token);
|
|
console.log("token",res.token);
|
|
if(typeof res =='object'){
|
|
var data=res.projects;
|
|
data=JSON.parse(data);
|
|
console.log(data);
|
|
if(typeof data =='object'&&typeof data['data']!='undefined'){
|
|
|
|
var meta=data['meta'];
|
|
var list=data['data'];
|
|
var html=projects(list);
|
|
$(".project").html(html);
|
|
|
|
var html=propage(meta);
|
|
//$("#propage").html(html);
|
|
$(".projectWraper").show();
|
|
}
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|