|
@@ -25,8 +25,10 @@
|
|
|
<div id="choose_area">
|
|
|
<!--<p class="optional_count"> 可选择市数量:<em class="count"></em> / <span class="total">11</span></p>-->
|
|
|
<div class="result">
|
|
|
- <!-- 首次购买 显示"已选择" ----- 升级订阅显示"已新增" -->
|
|
|
- <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 class="form">
|
|
|
<div class="select-area-box">
|
|
@@ -450,6 +452,20 @@
|
|
|
this.getResult();
|
|
|
},
|
|
|
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 () {
|
|
|
var s = $(this).html()
|
|
@@ -532,7 +548,7 @@
|
|
|
console.log("final select ",EditArea.reqData.area)
|
|
|
$DoPost("/subscribepay/editSub/submit",{"type":"area","value":JSON.stringify(EditArea.reqData.area)},function(r){
|
|
|
if(r.success){
|
|
|
- window.history.go(-1);
|
|
|
+ window.location.replace('/front/vipsubscribe/submitEditSubFinish');
|
|
|
}
|
|
|
},false)
|
|
|
$("#enter").removeAttr("disabled");
|
|
@@ -647,6 +663,7 @@
|
|
|
}
|
|
|
$('.result_name').append(html);
|
|
|
$(".select-area-box .area-list").css("margin-top",$('.result').height()+20);
|
|
|
+ this.isOpen();
|
|
|
if(this.noChange(this.lastSelectObj,this.reqData.area)){
|
|
|
$("#enter").attr("disabled","disabled");
|
|
|
}else{
|
|
@@ -658,8 +675,33 @@
|
|
|
var tmp1 = getAreaClassArr(obj1);
|
|
|
var tmp2 = getAreaClassArr(oj2);
|
|
|
return (JSON.stringify(tmp1[0].sort()) === JSON.stringify(tmp2[0].sort()))&&(JSON.stringify(tmp1[1].sort()) === JSON.stringify(tmp2[1].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(){
|
|
|
EditArea.init();
|
|
|
})
|