|
@@ -26,8 +26,11 @@
|
|
<p class="optional_count" style="position: fixed;width: 100%;top: 0px;"> 可选择市数量:<em class="count"></em> / <span class="total">11</span></p>
|
|
<p class="optional_count" style="position: fixed;width: 100%;top: 0px;"> 可选择市数量:<em class="count"></em> / <span class="total">11</span></p>
|
|
<div class="result" style="top:0.88rem">
|
|
<div class="result" style="top:0.88rem">
|
|
<!-- 首次购买 显示"已选择" ----- 升级订阅显示"已新增" -->
|
|
<!-- 首次购买 显示"已选择" ----- 升级订阅显示"已新增" -->
|
|
-
|
|
|
|
- <p>已选择:<span class="result_name">郑州市、洛阳市、淮南市、洛阳市、淮南市、洛阳市、淮南市、洛阳市、淮南市、洛阳市、淮南市</span></p>
|
|
|
|
|
|
+ <p class="result_text line_two">
|
|
|
|
+ 已选择:<span class="result_name"></span>
|
|
|
|
+ <a href="javascript:;" class="detail">详情</a>
|
|
|
|
+ </p>
|
|
|
|
+ <a href="javascript:;" class="packup" style="display: none;">收起</a>
|
|
</div>
|
|
</div>
|
|
<div class="form">
|
|
<div class="form">
|
|
<div class="select-area-box">
|
|
<div class="select-area-box">
|
|
@@ -471,6 +474,20 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
initClick:function(){
|
|
initClick:function(){
|
|
|
|
+ $('.detail').click(function () {
|
|
|
|
+ $('.result_text').removeClass('line_two')
|
|
|
|
+ $(".result").css("padding-bottom","0.3rem")
|
|
|
|
+ $(this).hide();
|
|
|
|
+ $('.packup').show()
|
|
|
|
+ $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
|
|
|
|
+ })
|
|
|
|
+ $('.packup').click(function () {
|
|
|
|
+ $(".result").css("padding-bottom","0.2rem")
|
|
|
|
+ $('.result_text').addClass('line_two')
|
|
|
|
+ $(this).hide();
|
|
|
|
+ $('.detail').show()
|
|
|
|
+ $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
|
|
|
|
+ })
|
|
// 锚点跳转
|
|
// 锚点跳转
|
|
$("body").on('click', '.slide a', function () {
|
|
$("body").on('click', '.slide a', function () {
|
|
var s = $(this).html()
|
|
var s = $(this).html()
|
|
@@ -597,7 +614,7 @@
|
|
$('.count').text(cityCount)
|
|
$('.count').text(cityCount)
|
|
$('.result_name').append(html);
|
|
$('.result_name').append(html);
|
|
$('.select-area-box').css("margin-top",$(".optional_count").height()+$(".result").height()+20);
|
|
$('.select-area-box').css("margin-top",$(".optional_count").height()+$(".result").height()+20);
|
|
-
|
|
|
|
|
|
+ this.isOpen();
|
|
if(this.noChange(this.selectObj,EditCity.reqData.area)||!this.compareArr(Object.keys(this.selectObj),Object.keys(this.reqData.buyset.citys))){
|
|
if(this.noChange(this.selectObj,EditCity.reqData.area)||!this.compareArr(Object.keys(this.selectObj),Object.keys(this.reqData.buyset.citys))){
|
|
$("#enter").attr("disabled","disabled")
|
|
$("#enter").attr("disabled","disabled")
|
|
}else{
|
|
}else{
|
|
@@ -617,6 +634,31 @@
|
|
},
|
|
},
|
|
compareArr:function(arr1,arr2){
|
|
compareArr:function(arr1,arr2){
|
|
return JSON.stringify(arr1.sort()) === JSON.stringify(arr2.sort());
|
|
return JSON.stringify(arr1.sort()) === JSON.stringify(arr2.sort());
|
|
|
|
+ },
|
|
|
|
+ isOpen:function(){
|
|
|
|
+ let pHeight = $('.result_text').height()
|
|
|
|
+ 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)
|
|
|
|
+ if(rows == 1){
|
|
|
|
+ $('.packup').hide()
|
|
|
|
+ $('.detail').hide()
|
|
|
|
+ }else if(rows == 2){
|
|
|
|
+ console.log($('.result_name').html().trim().length)
|
|
|
|
+ let length = $('.result_name').html().trim().length;
|
|
|
|
+ if(length >= 50){
|
|
|
|
+ $('.detail').show()
|
|
|
|
+ $('.packup').hide()
|
|
|
|
+ }else{
|
|
|
|
+ $('.detail').hide()
|
|
|
|
+ $('.packup').hide()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else{
|
|
|
|
+ $('.packup').show()
|
|
|
|
+ $('.detail').hide()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$(function(){
|
|
$(function(){
|