|
@@ -22,9 +22,6 @@
|
|
|
background: url(/jyapp/dataExport/images/xuanzhong.png) no-repeat center center;
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
- .result{
|
|
|
- display: none;
|
|
|
- }
|
|
|
body{
|
|
|
background: rgba(245,244,249,1);
|
|
|
}
|
|
@@ -463,6 +460,43 @@
|
|
|
}).join('');
|
|
|
return tempHtml
|
|
|
}
|
|
|
+ //
|
|
|
+ /* 选中结果 */
|
|
|
+ function getResult() {
|
|
|
+ $('.result_name').empty()
|
|
|
+ var data = []
|
|
|
+ var val = $('.other').parents('.province').text().trim();
|
|
|
+ if ($('.other').is(':checked')) {
|
|
|
+ data.push(val)
|
|
|
+ }
|
|
|
+ $(".tab_content").find(".city.active:not('[disabled]')").each(function () {
|
|
|
+ var length = $(this).parent('.tab_content').find('.city').length; //省份下城市的length
|
|
|
+ var activeLeng = $(this).parent('.tab_content').find('.city.active').length; //省份下选中城市的length
|
|
|
+ // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
|
|
|
+ if (length == activeLeng) {
|
|
|
+ data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)')
|
|
|
+ .children('.province').text().trim())
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)')
|
|
|
+ .children('.province').text().trim())
|
|
|
+ data.push($(this).html())
|
|
|
+ }
|
|
|
+ // data.push($(this).html())
|
|
|
+ })
|
|
|
+ data = Array.from(new Set(data)); //数组去重
|
|
|
+ console.log(data)
|
|
|
+ var html = '';
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (i != data.length - 1) {
|
|
|
+ html += '<span>' + data[i] + '、' + '</span>'
|
|
|
+ } else {
|
|
|
+ html += '<span>' + data[i] + '</span>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('.result_name').append(html)
|
|
|
+ }
|
|
|
+ //
|
|
|
$(function(){
|
|
|
$("body").on('click','.slide a',function(){
|
|
|
var s = $(this).html();
|
|
@@ -483,9 +517,11 @@
|
|
|
if(isCheckded){
|
|
|
$(this).parents('.tab').siblings('.tab_content').find('.city').addClass('active')
|
|
|
isAllSelected()
|
|
|
+ getResult()
|
|
|
}else{
|
|
|
$(this).parents('.tab').siblings('.tab_content').find('.city').removeClass('active')
|
|
|
isAllSelected()
|
|
|
+ getResult()
|
|
|
}
|
|
|
});
|
|
|
$('.tab_content').on('click','.city',function(){
|
|
@@ -497,9 +533,11 @@
|
|
|
window.input = input;
|
|
|
input.prop('checked', true)
|
|
|
isAllSelected()
|
|
|
+ getResult()
|
|
|
}else{
|
|
|
$(this).parent('div').siblings('.tab').children().children('.checkbox').prop('checked', false)
|
|
|
isAllSelected()
|
|
|
+ getResult()
|
|
|
}
|
|
|
});
|
|
|
$('.other').on('change',function(){
|
|
@@ -510,6 +548,7 @@
|
|
|
$('.tab:not(.whole)').removeClass('selected').children('.province').find('input').prop('checked', false);
|
|
|
$('.tab_content').find('.city').removeClass('active')
|
|
|
}
|
|
|
+ getResult()
|
|
|
});
|
|
|
|
|
|
$('.save-btn').click(function(){
|
|
@@ -565,6 +604,7 @@
|
|
|
$(".whole").addClass("selected");
|
|
|
$(".other").prop("checked",true);
|
|
|
$(".reset-btn").hide();
|
|
|
+ getResult()
|
|
|
});
|
|
|
//
|
|
|
if(localStorage.area !== "" && localStorage.area!==undefined){
|
|
@@ -588,6 +628,7 @@
|
|
|
}else{
|
|
|
$(".other").prop("checked", true);
|
|
|
$(".reset-btn").hide();
|
|
|
+ getResult()
|
|
|
}
|
|
|
//
|
|
|
$(".tab_content").find(".city.active").each(function(){
|