Explorar el Código

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

wangshan hace 5 años
padre
commit
d285f2682e

+ 24 - 15
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -625,11 +625,6 @@ $(function () {
         //     province: 0,
         //     city: 0
         // }
-		//
-		sessionStorage.removeItem("vipAddCount")
-		sessionStorage.removeItem("vipSubSelectCity")
-		sessionStorage.removeItem("vipSubSelectAreaUpgrade")
-		sessionStorage.removeItem("vipSubSelectAreaAdd")
         // 数组置0,在重新从数据中计算初始状态结果并返回
         for (let i in alreadyBuy) {
             for(let ii in alreadyBuy[i]) {
@@ -679,20 +674,28 @@ $(function () {
 		let selectedCityLength = $(dom).parent().find('.city.active:not([disabled])').length;
 		let disabledCityLength = $(dom).parent().find('.city[disabled]').length;
 		let cityLength = $(dom).parent().find('.city').length;
-		let dataCount = $(dom).parent().parent().attr("data-buy-city-count");
+		let dataCount = Number($(dom).parent().parent().attr("data-buy-city-count"));
 		if(dataCount === undefined){
 			dataCount = 0;
 		}else{
-			if(Number(dataCount) === disabledCityLength){
-				dataCount = 0;
-			}else{
-				dataCount = dataCount - disabledCityLength;
+			if(Number(dataCount) !== disabledCityLength){
+				if(disabledCityLength === 0){
+					dataCount = 0;
+				}else{
+					dataCount = dataCount - disabledCityLength;
+				}
 			}
 		}
-		let showCount = selectedCityLength - dataCount;
+		let countShow = 0;
+		let showCount = selectedCityLength + dataCount;
+		// let showCount = selectedCityLength - dataCount;
 		if(showCount > 2){
-			$(".tips_d_text").text("已新增"+showCount+"个市,建议新增“全省”");
-			$(".tips_d_text").show();
+			if(selectedCityLength === 0){
+				$(".tips_d_text").hide();
+			}else{
+				$(".tips_d_text").text("已选择"+showCount+"个市,建议购买“全省”");
+				$(".tips_d_text").show();
+			}
 		}else{
 			$(".tips_d_text").hide();
 		}
@@ -702,9 +705,15 @@ $(function () {
 	}
 	
 	function showOther(){
-		let showCounts = newlyAdded.province;
+		let areaCount = areaData.data.buyset.areacount;
+		let showCounts = 0;
+		if(areaCount === -1){
+			$(".tips_d_text").hide();
+		}else{
+			showCounts = newlyAdded.province + areaCount;
+		}
 		if(showCounts > 9){
-			$(".tips_d_text").text("已新增"+showCounts+"个省,建议新增“全国”")
+			$(".tips_d_text").text("已选择"+showCounts+"个省,建议购买“全国”")
 			$(".tips_d_text").show();
 		}else{
 			$(".tips_d_text").hide();

+ 14 - 12
src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html

@@ -316,12 +316,24 @@
                 			$(".buyset").text("已购买:"+buyset);
                 		}
                 	}
+					// 显示隐藏优惠tips
+					let disabledCount = $("ul.list li.list_item .item_industry_list").find(".industry_item[disabled]").length;
+					let showCount = buyset - disabledCount;
+					let showCounts = selectedArr.length - showCount;
+					let countShow = showCounts + buyset
+					if (countShow > 3) {
+						$('.tips_btn .tips_d_text').text("已选择"+countShow+"个行业,建议购买“全部行业”");
+					    $('.tips_btn .tips_d_text').slideDown();
+					} else {
+					    $('.tips_btn .tips_d_text').slideUp()
+					}
                 }else{
                 	if(buyset !== "全部行业"){
                 		$(".buyset").text("已购买:"+buyIndustryLen+"/"+buyset+"个行业")
                 	}else{
                 		$(".buyset").text("已购买:"+buyset)
                 	}
+					$('.tips_btn .tips_d_text').slideUp()
                 }
                 for(var i in selectedArr){
                 	if(selectedArr[i] === "全部行业"){
@@ -334,16 +346,6 @@
                 		}
                 	}
                 }
-                // 显示隐藏优惠tips
-                let disabledCount = $("ul.list li.list_item .item_industry_list").find(".industry_item[disabled]").length;
-                let showCount = buyset - disabledCount;
-                let showCounts = selectedArr.length - showCount;
-                if (showCounts > 3) {
-                	$('.tips_btn .tips_d_text').text("已新增"+showCounts+"个行业,建议新增“全部行业”");
-                    $('.tips_btn .tips_d_text').slideDown();
-                } else {
-                    $('.tips_btn .tips_d_text').slideUp()
-                }
           
                 selectedIndustryArr = selectedArr
                 
@@ -423,8 +425,8 @@
 				$('.select-area-box .list button').removeClass('active');
                 showSelect(buyIndustry,false);
                 findSelectedIndustry();
-                sessionStorage.removeItem("vipSubSelectIndustryAdd");
-                sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
+                //sessionStorage.removeItem("vipSubSelectIndustryAdd");
+                //sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
                 $('.tips_btn .btns button').removeAttr('disabled');
             })