移动新ui
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.
 
 
 
 

172 lines
4.7 KiB

var XCLY_UNIT = '个'
function xcly() {
lyxclyLevelGroup();
//lyxclyTypeGroup();
//xclyregiongroup();
//xclypagelist();
xclyregiongroup();
};
var type_xcly = '';
//乡村旅游星级
function lyxclyLevelGroup() {
$.ajax({
url: _CTX + "/basevillage/getbasevillage",
type: 'get',
async: true,
dataType: 'json',
success: function(result) {
if (result) {
var data;
var qtnum = 0;
var title = new Array();
var value = new Array();
for (var i = 0; i < result.length; i++) {
data = result[i];
$("#xclylevel1").html(data.grade1count+XCLY_UNIT);
$("#xclylevel2").html(data.grade2count+XCLY_UNIT);
$("#xclylevel3").html(data.grade3count+XCLY_UNIT);
$("#xclylevel4").html(data.grade4count+XCLY_UNIT);
$("#xclylevel5").html(data.grade5count+XCLY_UNIT);
$("#xclylevel6").html(data.gradeothercount+XCLY_UNIT);
$("#xcly_sfx").html(data.type1count+XCLY_UNIT);
$("#xcly_sfjd").html(data.type2count+XCLY_UNIT);
$("#xcly_tyfg").html(data.type3count+XCLY_UNIT);
$("#xcly_sbqpp").html(data.type4count+XCLY_UNIT);
$("#xcly_sfc").html(data.type5count+XCLY_UNIT);
$("#xcly_msc").html(data.type6count+XCLY_UNIT);
$("#xcly_tsmz").html(data.type7count+XCLY_UNIT);
$("#xcly_gcl").html(data.type8count+XCLY_UNIT);
$("#xcly_njl").html(data.type9count+XCLY_UNIT);
}
barChart('xclyregiongroup', title, value, 10, 'xcly');
}
},
fail: function() {
alert("获取基础信息失败");
}
});
}
//乡村旅游资源地区分布
function xclyregiongroup() {
$.ajax({
url: _CTX + "/lydlxxxt/xclyRegionGroup",
type: 'post',
async: true,
dataType: 'json',
success: function(result) {
if (result) {
var data = result.sort(sortNum);
var id = "xclyregiongroup";
var title = new Array();
var value = new Array();
for (var i = 0; i < data.length; i++) {
title.push(data[i].name);
value.push(data[i].value);
}
}
barChart(id, title, value, 10, 'xcly',{
label:{
formatter(e){
return e.value + XCLY_UNIT
}
}
});
},
fail: function() {
alert("获取基础信息失败");
}
});
}
//乡村旅游资源列表查询
function xclypagelist() {
var searchword = $("#xclysearchword").val();
var grade = $('#grade_xcly').val() ? $('#grade_xcly').val() : "";
$('#grade_xcly').val('');
$.ajax({
url: _CTX + "/lydlxxxt/xclypagelist?page=" + page + "&searchword=" + searchword + "&grade=" + grade + "&type=" + type_xcly,
type: 'get',
async: true,
dataType: 'json',
success: function(result) {
var num = result.num;
totalpage = result.totalPage;
page = result.curPage;
var data = result.data;
var xcy;
var html;
$("#xclypagelist").html("");
$("#xclypage").html(page + "/" + totalpage);
$("#xclypagelistnum").html("总共有" + num + "条数据");
clearpoints();
qcjqd(); //清除地图上所有的点
for (var i = 0; i < data.length; i++) {
xcy = data[i];
html = "<li> <a href=\"javascript:mkp(" + xcy.id + ",3,'" + xcy.cname + "','" + xcy.addr + "','" + xcy.logo_img +
"','" + xcy.lon + "','" + xcy.lat + "')\"><div class=\"dl_jq_pic\"><img src=\"" +
isDataEmpty(xcy.logo_img) + "\" onerror='beiyongimg()' /></div>" +
"<div class=\"dl_jq_inf\"><h3>" + isDataEmpty(xcy.cname) + "</h3><p>乡村游等级:" + xclylevel(xcy.level) + "</p>" +
"<p>地址:" + isDataEmpty(xcy.addr) + "</p><p>咨询电话:" + (isDataEmpty(xcy.zx_phone)?xcy.zx_phone:"未知") + "</p></div></a> </li>";
$("#xclypagelist").append(html);
initpoint(xcy.id, 3, xcy.cname, xcy.addr, xcy.logo_img, xcy.lon, xcy.lat, i,xcy.level);
}
if(grade || type_xcly){
type_xcly = '';
var points = xclyData.filter(function(e){
return data.map(a => a.id).indexOf(e.id) > -1;
});
markPoints(points,style);
} else {
markPoints(xclyData,style);
}
},
fail: function() {
alert("获取基础信息失败");
}
});
}
function xclylevel(level) {
if (level == 1) {
return "一星级";
} else if (level == 2) {
return "二星级";
} else if (level == 3) {
return "三星级";
} else if (level == 4) {
return "四星级";
} else if (level == 5) {
return "五星级";
} else {
return "未评级";
}
}
//弹出列表页
function xclylistpoppage(title, level, type, dname) {
// layer.open({
// type : 2,
// title : "",
// anim : 2,
// shade: [0.7, '#333'],
// area : ['75%','70%'],
// content : _CTX+'/lyxcly/searchLyXclyList.do?searchtype=1&level='+level+"&type="+type,
// end: function(){//页面关闭后回调
//
// }
// });
layer.open({
type: 2,
shade: [0.7, '#333'],
title: "",
anim: 2,
area: ['75%', '70%'],
content: _CTX + '/lyxcly/searchLyXclyList.do?searchtype=1&level=' + level + "&type=" + type,
});
}