张家口产业监测
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.
 
 
 
 

236 lines
9.3 KiB

var type_fd = '';
function fd() {
hotellevelgroup();
hoteltypegroup();
hotelRegiongroupTop5();
//hotelpagelist();
};
//旅游饭店资源等级分布
function hotellevelgroup() {
$.ajax({
url: _CTX + "/basic/hotel/getlevelbyregion",
type: 'get',
async: true,
dataType: 'json',
success: function(result) {
if (result) {
if(result[0].grade1count!=null && result[0].grade1count!==''){
$(".fd_str_1").html("<h4>一星级</h4><p"+ " onclick=\"javascript:hotellistpoppage('一星级','1','','')\"" +">" + result[0].grade1count + "个</p><span>" + countBl(result,"1") +"</span> </div>");
}
if(result[0].grade2count!=null && result[0].grade2count!=''){
$(".fd_str_2").html("<h4>二星级</h4><p"+ " onclick=\"javascript:hotellistpoppage('二星级','2','','')\"" +">" + result[0].grade2count + "个</p><span>" + countBl(result,"2") +"</span> </div>");
}
if(result[0].grade3count!=null && result[0].grade3count!=''){
$(".fd_str_3").html("<h4>三星级</h4><p"+ " onclick=\"javascript:hotellistpoppage('三星级','3','','')\"" +">" + result[0].grade3count + "个</p><span>" + countBl(result,"3") +"</span> </div>");
}
if(result[0].grade4count!=null && result[0].grade4count!=''){
$(".fd_str_4").html("<h4>四星级</h4><p"+ " onclick=\"javascript:hotellistpoppage('四星级','4','','')\"" +">" + result[0].grade4count + "个</p><span>" + countBl(result,"4") +"</span> </div>");
}
if(result[0].grade5count!=null && result[0].grade5count!=''){
$(".fd_str_5").html("<h4>五星级</h4><p"+ " onclick=\"javascript:hotellistpoppage('五星级','5','','')\"" +">" + result[0].grade5count + "个</p><span>" + countBl(result,"5") +"</span> </div>");
}
if(result[0].gradeothercount!=null && result[0].gradeothercount!=''){
$(".fd_str_6").html("<h4>民宿</h4><p"+ " onclick=\"javascript:hotellistpoppage('民宿','0','','')\"" +">" + result[0].gradeothercount + "个</p><span>" + countBl(result,"0") +"</span> </div>");
}
}
},
fail: function() {
alert("获取基础信息失败");
}
});
}
//旅游饭店资源类型分布
function hoteltypegroup() {
$.ajax({
url: _CTX + '/basic/hotel/gettypebyregion',
type: 'get',
async: true,
dataType: 'json',
success: function(data) {
if (data.length>0) {
$(".fdlx_1").html("<h4 onclick=\"hotelpagelist(type_fd=1801)\" onmouseover=\"this.style.cursor='hand'\" > 星级酒店" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('星级饭店"+
"','','1801','')\">" + data[0].type1count + "个</p>");
$(".fdlx_2").html("<h4 onclick=\"hotelpagelist(type_fd=1804)\" onmouseover=\"this.style.cursor='hand'\">商务酒店" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('商务酒店" +
"','','1804','')\">" + data[0].type4count + "个</p>");
$(".fdlx_3").html("<h4 onclick=\"hotelpagelist(type_fd=1805)\" onmouseover=\"this.style.cursor='hand'\">度假酒店" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('度假酒店" +
"','','1805','')\">" + data[0].type5count + "个</p>");
data[0].type7count?$(".fdlx_8").html("<h4 onclick=\"hotelpagelist(type_fd=1808)\" onmouseover=\"this.style.cursor='hand'\"> 快捷酒店" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('快捷酒店" +
"','','1808','')\">" + data[0].type7count + "个</p>"):$(".fdlx_8").html("<h4 onclick=\"hotelpagelist(type_fd=1808)\" onmouseover=\"this.style.cursor='hand'\"> 快捷酒店" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('快捷酒店" +
"','','1808','')\">" + data[0].type7count + "个</p>");
$(".fdlx_4").html("<h4 onclick=\"hotelpagelist(type_fd=1802)\" onmouseover=\"this.style.cursor='hand'\">酒店公寓" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('酒店公寓" +
"','','1802','')\">" + data[0].type2count + "个</p>");
$(".fdlx_5").html("<h4 onclick=\"hotelpagelist(type_fd=1803)\" onmouseover=\"this.style.cursor='hand'\">青年旅社" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('青年旅社" +
"','','1803','')\">" + data[0].type3count + "个</p>");
$(".fdlx_6").html("<h4 onclick=\"hotelpagelist(type_fd=1806)\" onmouseover=\"this.style.cursor='hand'\">民宿" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('招待所" +
"','','1806','')\">" + data[0].type6count + "个</p>");
$(".fdlx_7").html("<h4 onclick=\"hotelpagelist(type_fd=1807)\" onmouseover=\"this.style.cursor='hand'\"> 其他" +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('其他" +
"','','1807','')\">" + data[0].typeothercount + "个</p>");
}
}
});
}
//旅游饭店资源地区分布Top5
function hotelRegiongroupTop5() {
$.ajax({
url: _CTX + '/basic/hotel/getregion',
type: 'get',
success: function(data) {
if (data.length>1) {
var classnum = 1;
for(var a = 0;a<data.length;a++){
// $(".fddy_"+a+"").html("<h4>" + data[a].citycode +
// "</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('" + data[0].name +
// "','','','" + data[a].countycode + "')\">" + data[a].grade+a+count + "</p>");
$(".fddy_"+classnum+"").html("<h4>" + data[a].citycode +
"</h4><p onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript:hotellistpoppage('" + data[0].citycode +
"','','','" + data[a].countycode + "')\">" + data[a].grade5count + "个</p>");
classnum++;
}
while (a < 5){
$(".fddy_"+classnum+"").empty();
a++;
classnum++;
}
}
}
});
}
//饭店资源列表查询
function hotelpagelist(hotelzy) {
var searchword = $("#hotellistsearchword").val() ? $("#hotellistsearchword").val() : "";
var grade = $('#grade').val() ? $('#grade').val() : "";
$('#grade').val('');
qcjqd(); //清除地图上所有的点
$.ajax({
url: _CTX + "/lydlxxxt/hotelpagelist?page=" + page + "&searchword=" + searchword + "&grade=" + grade + "&type=" + type_fd+"&hotelzy="+hotelzy,
type: 'get',
async: true,
dataType: 'json',
success: function(result) {
var num = result.num;
totalpage = result.totalPage;
page = result.curPage;
var data = result.data;
var hotel;
var html;
$("#hotelpagelist").html("");
$("#hotelspage").html(page + "/" + totalpage);
$("#hotelsnum").html("总共有" + num + "条数据");
for (var i = 0; i < data.length; i++) {
hotel = data[i];
html = "<li> <a href=\"javascript:mkp(" + hotel.id + ",1,'" + hotel.cname + "','" + hotel.addr + "','" + hotel.logo +
"','" + hotel.lon + "','" + hotel.lat + "')\"><div class=\"dl_jq_pic\"><img src=\"" + hotel.logo + "\" onerror='beiyongimg()' /></div>" +
"<div class=\"dl_jq_inf\"><h3>" + isDataEmpty(hotel.cname) + "</h3><p>饭店星级:" + hotellevel(hotel.level) +
"</p>" +
"<p>饭店地址:" + isDataEmpty(hotel.addr) + "</p><p>饭店电话:" + (isDataEmpty(hotel.phone) ? hotel.phone : "未知") +
"</p></div></a> </li>";
$("#hotelpagelist").append(html);
//initpoint(hotel.id, 1, hotel.cname, hotel.addr, hotel.logo, hotel.lon, hotel.lat, i);
}
clearpoints();
for (var i = data.length-1; i > -1; i--) {
hotel = data[i];
initpoint(hotel.id, 1, hotel.cname, hotel.addr, hotel.logo, hotel.lon, hotel.lat, i,hotel.level);
}
if(grade || type_fd){
type_fd = '';
var points = hotelData.filter(function(e){
return data.map(a => a.id).indexOf(e.id) > -1;
});
markPoints(points,style);
} else {
markPoints(hotelData,style);
}
},
fail: function() {
alert("获取基础信息失败");
}
});
}
function hotellevel(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 hotellistpoppage(title, level, type, dname) {
layer.open({
type: 2,
shade: [0.7, '#333'],
title: "",
anim: 2,
area: ['75%', '70%'],
content: _CTX + '/lyresrestaurants/searchLyResRestaurantsList.do?searchtype=1&level=' + level + "&types=" + type +
"&region=" + dname,
});
var e=window.event || arguments.callee.caller.arguments[0];
e.stopPropagation();
}
//计算比例
function countBl(result,hotellevel){
var yxj = result[0].grade1count;
var exj = result[0].grade2count;
var sxj = result[0].grade3count;
var sixj = result[0].grade4count;
var wxj = result[0].grade5count;
var qtxj = result[0].gradeothercount;
var qbxj = yxj+exj+sxj+sixj+wxj+qtxj;
if(hotellevel == "0"){
qtxj = Math.round(qtxj/qbxj*10000)/100+ "%";
return qtxj;
}else if(hotellevel == "1"){
yxj = Math.round(yxj/qbxj*10000)/100+ "%";
return yxj;
}else if(hotellevel == "2"){
exj =Math.round(exj/qbxj*10000)/100+ "%";
return exj;
}else if(hotellevel == "3"){
sxj = Math.round(sxj/qbxj*10000)/100+ "%";
return sxj;
}else if(hotellevel == "4"){
sixj = Math.round(sixj/qbxj*10000)/100+ "%";
return sixj;
}else if(hotellevel == "5"){
wxj = Math.round(wxj/qbxj*10000)/100+ "%";
return wxj;
}
}