|
@@ -443,7 +443,9 @@
|
|
selectProvince: function (province, canClick) { //设置选中省份 province 省份
|
|
selectProvince: function (province, canClick) { //设置选中省份 province 省份
|
|
$($('.tab .province')).each(function (index, dom) {
|
|
$($('.tab .province')).each(function (index, dom) {
|
|
if (province == $.trim($(dom).text())) {
|
|
if (province == $.trim($(dom).text())) {
|
|
- if (province != "全国") $(".checkbox.other").attr("checked", false); //取消全国选中
|
|
|
|
|
|
+ if (province != "全国") {
|
|
|
|
+ $(".checkbox.other").attr("checked", false); //取消全国选中
|
|
|
|
+ }
|
|
$(dom).children('.checkbox').attr({"checked": true, "disabled": !canClick});//选中此省份
|
|
$(dom).children('.checkbox').attr({"checked": true, "disabled": !canClick});//选中此省份
|
|
$(dom).parents().siblings('.tab_content').find(".city").addClass("active").attr({"disabled": !canClick});
|
|
$(dom).parents().siblings('.tab_content').find(".city").addClass("active").attr({"disabled": !canClick});
|
|
}
|
|
}
|
|
@@ -457,15 +459,16 @@
|
|
$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
|
|
$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
|
|
.addClass('selected').children('.province').children('.checkbox').attr({
|
|
.addClass('selected').children('.province').children('.checkbox').attr({
|
|
"checked": true
|
|
"checked": true
|
|
- })
|
|
|
|
|
|
+ }).addClass('half');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getResult: function (changeCity,isFirst) { /* 选中结果 */
|
|
|
|
|
|
+ getResult: function (changeCity, isFirst) { /* 选中结果 */
|
|
//如果选中所有,则转为全国
|
|
//如果选中所有,则转为全国
|
|
if ($(".city").length == $(".city.active").length) {
|
|
if ($(".city").length == $(".city.active").length) {
|
|
$(".checkbox.other").trigger("click");
|
|
$(".checkbox.other").trigger("click");
|
|
|
|
+ $(".checkbox").removeClass("half");
|
|
return
|
|
return
|
|
}
|
|
}
|
|
var tmpSelect = {};
|
|
var tmpSelect = {};
|
|
@@ -566,7 +569,7 @@
|
|
if (selectCityMax > 2) {
|
|
if (selectCityMax > 2) {
|
|
$('.tips_btn .tips_d_text').text("已选择" + selectCityMax + "个市,建议购买“全省”").slideDown();
|
|
$('.tips_btn .tips_d_text').text("已选择" + selectCityMax + "个市,建议购买“全省”").slideDown();
|
|
} else {
|
|
} else {
|
|
- if (selectProvince > 9&&!isFirst) {
|
|
|
|
|
|
+ if (selectProvince > 9 && !isFirst) {
|
|
$('.tips_btn .tips_d_text').text("已选择" + selectProvince + "个省,建议购买“全国”").slideDown()
|
|
$('.tips_btn .tips_d_text').text("已选择" + selectProvince + "个省,建议购买“全国”").slideDown()
|
|
} else {
|
|
} else {
|
|
$(".tips_d_text").slideUp();
|
|
$(".tips_d_text").slideUp();
|
|
@@ -673,12 +676,19 @@
|
|
$(".province input").prop('checked', false);
|
|
$(".province input").prop('checked', false);
|
|
$(".city").removeClass('active');
|
|
$(".city").removeClass('active');
|
|
$(this).prop('checked', true);
|
|
$(this).prop('checked', true);
|
|
|
|
+ $(".checkbox").removeClass("half");
|
|
} else {
|
|
} else {
|
|
$(".checkbox.other").prop('checked', false);
|
|
$(".checkbox.other").prop('checked', false);
|
|
- if ($(this).is(':checked') == false) {
|
|
|
|
- $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
|
|
|
|
- if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
|
|
|
|
- $(".checkbox.other").prop('checked', true);
|
|
|
|
|
|
+ if (!$(this).is(':checked')) {
|
|
|
|
+ if ($(this).hasClass("half")) {//判断当前是否是半选
|
|
|
|
+ $(this).prop("checked", true).removeClass("half");
|
|
|
|
+ $(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
|
|
|
|
+ } else {
|
|
|
|
+ $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
|
|
|
|
+ if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
|
|
|
|
+ $(".checkbox.other").prop('checked', true);
|
|
|
|
+ $(".checkbox").removeClass("half");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
$(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
|
|
$(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
|
|
@@ -696,6 +706,11 @@
|
|
var input = $(this).parents('li').find('input.checkbox')
|
|
var input = $(this).parents('li').find('input.checkbox')
|
|
window.input = input
|
|
window.input = input
|
|
input.prop('checked', true)
|
|
input.prop('checked', true)
|
|
|
|
+ if (isActive != $(this).parent().find('.city').length) {//是否全选
|
|
|
|
+ $(this).parent('div').siblings('.tab').find('.province .checkbox').addClass('half');
|
|
|
|
+ } else {
|
|
|
|
+ $(this).parent('div').siblings('.tab').find('.province .checkbox').removeClass('half');
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
$(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
|
|
$(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
|
|
'checked', false)
|
|
'checked', false)
|
|
@@ -758,7 +773,7 @@
|
|
AreaChoose.showSelected(true);//回显已选择
|
|
AreaChoose.showSelected(true);//回显已选择
|
|
/* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
|
|
/* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
|
|
|
|
|
|
- AreaChoose.getResult("",true);
|
|
|
|
|
|
+ AreaChoose.getResult("", true);
|
|
AreaChoose.inintClick();
|
|
AreaChoose.inintClick();
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|