|
@@ -363,7 +363,8 @@
|
|
|
<div class="tips_btn">
|
|
|
<div class="tips_discount">
|
|
|
<div class="tips_d_money" style="display: block">¥38</div>
|
|
|
- <div class="tips_d_text">已选择4个市,建议购买“全省”更划算哦~</div>
|
|
|
+ <div class="tips_d_text citys">已选择4个市,建议购买“全省”更划算哦~</div>
|
|
|
+ <div class="tips_d_text all">已选择10个省,建议购买“全国”更划算哦~</div>
|
|
|
</div>
|
|
|
<div class="btns">
|
|
|
<button class="reset-btn">重置</button>
|
|
@@ -390,7 +391,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
|
|
|
- <script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
|
|
|
<script src="/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
|
|
|
<script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
|
|
|
<script>
|
|
@@ -401,7 +402,7 @@
|
|
|
buystr = data.area;
|
|
|
}
|
|
|
}, false);
|
|
|
- console.log(buystr)
|
|
|
+// console.log(buystr)
|
|
|
var AreaChoose={
|
|
|
selectObj:{},//已选择,未购买城市;
|
|
|
buyObj:{},//已购买
|
|
@@ -426,7 +427,7 @@
|
|
|
if(checkObj(buystr)){
|
|
|
this.buyObj = {"全国":[]}
|
|
|
}
|
|
|
- console.log(this.buyObj)
|
|
|
+// console.log(this.buyObj)
|
|
|
//是否试用界面
|
|
|
if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
|
|
|
}catch(e){
|
|
@@ -522,6 +523,7 @@
|
|
|
$('.result_name').empty()
|
|
|
var data = []; //定义一个总数组
|
|
|
var cityArr =[]; //定义一个选中城市数组
|
|
|
+ var provincesArr = [];
|
|
|
var val = $('.other').parents('.province').text().trim();
|
|
|
if ($('.other').is(':checked')) {
|
|
|
// data.push(val)
|
|
@@ -533,13 +535,14 @@
|
|
|
let arr =[];
|
|
|
// 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
|
|
|
if (length == activeLeng) {
|
|
|
- $('.tips_btn .tips_d_text').hide()
|
|
|
+ $('.tips_btn .tips_d_text.citys').hide()
|
|
|
// data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
|
|
|
let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
|
|
|
data.push({
|
|
|
name:province,
|
|
|
children:[]
|
|
|
- })
|
|
|
+ });
|
|
|
+ provincesArr.push(province);
|
|
|
} else {
|
|
|
let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
|
|
|
let city = $(this).html()
|
|
@@ -561,7 +564,8 @@
|
|
|
data = data.reduce((cur,next) =>{
|
|
|
obj[next.name] ? "" : obj[next.name] = true && cur.push(next);
|
|
|
return cur
|
|
|
- },[])
|
|
|
+ },[]);
|
|
|
+
|
|
|
// 数组筛选
|
|
|
let result = data.map(v =>{
|
|
|
let filterArr = v.children.filter(s =>{
|
|
@@ -579,7 +583,8 @@
|
|
|
// 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
|
|
|
let childrenArr=[];
|
|
|
if (children.length >= 4 && !this.vipSubisTrial) {
|
|
|
- $('.tips_btn .tips_d_text').show()
|
|
|
+ $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”更划算哦~");
|
|
|
+ $('.tips_btn .tips_d_text.citys').show();
|
|
|
}
|
|
|
html += `${result[i].name}(`
|
|
|
for(var j = 0;j < children.length;j++){
|
|
@@ -605,6 +610,21 @@
|
|
|
this.selectObj[result[i].name]=[];//
|
|
|
}
|
|
|
}
|
|
|
+ for (var x = 0; x < provincesArr.length; x++) {
|
|
|
+ for (var j =x+1; j <provincesArr.length; ) {
|
|
|
+ if (provincesArr[x] === provincesArr[j]){
|
|
|
+ provincesArr.splice(j, 1);
|
|
|
+ }
|
|
|
+ else j++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(provincesArr.length > 9){
|
|
|
+ $('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”更划算哦~");
|
|
|
+ $('.tips_d_text.all').show();
|
|
|
+ $('.tips_d_text.citys').hide();
|
|
|
+ }else{
|
|
|
+ $('.tips_d_text.all').hide();
|
|
|
+ }
|
|
|
// console.log("this.selectObj:",this.selectObj)
|
|
|
$('.result_name').append(html)
|
|
|
AreaChoose.isOpen()
|
|
@@ -642,7 +662,7 @@
|
|
|
let minHeight = $('.result_text').css('min-height')
|
|
|
let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
|
|
|
$(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
|
|
|
- console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
|
|
|
+// console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
|
|
|
if(rows == 1){
|
|
|
if(length >= 50){
|
|
|
$('.detail').show()
|
|
@@ -652,7 +672,7 @@
|
|
|
$('.packup').hide()
|
|
|
}
|
|
|
}else if(rows == 2){
|
|
|
- console.log($('.result_name').html().trim().length)
|
|
|
+// console.log($('.result_name').html().trim().length)
|
|
|
let length = $('.result_name').html().trim().length;
|
|
|
if(length >= 50){
|
|
|
$('.detail').show()
|
|
@@ -819,6 +839,8 @@
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+ //
|
|
|
+
|
|
|
</script>
|
|
|
</body>
|
|
|
|