xuzhiheng 5 rokov pred
rodič
commit
4f95e0ef93

+ 30 - 2
src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html

@@ -420,6 +420,9 @@
             }
             //
             this.buyObj = buystr;
+            if(checkObj(buystr)){
+            	this.buyObj = {"全国":[]}
+            }
             console.log(this.buyObj)
             //是否试用界面
             if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
@@ -455,7 +458,7 @@
             	ran = this.buyObj;
             }    
             for(var province in ran) {
-	            let citys=ran[province]
+      			let citys=ran[province]
 	            if(citys.length>0){//地市
 	                this.selectCity(citys,canClick)
 	            }else{//省份
@@ -466,7 +469,7 @@
         selectProvince:function(province,canClick){ //设置选中省份 province 省份
           $($('.tab .province')).each(function (index, dom) {
             if (province == $.trim($(dom).text())) {
-              if(province!="全国") $(".checkbox.other").attr("checked", false); //取消全国选中
+              $(".checkbox.other").attr("checked", false); //取消全国选中
               $(dom).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
               $(this).parent(".tab:not(.municipality)").next().slideDown(500);
               if(canClick){
@@ -475,6 +478,15 @@
               	$(dom).parents().siblings('.tab_content').find(".city").attr({"disabled":!canClick});
               }
             }
+            if(province === "全国"){
+            	$('.tab .province').each(function(){
+            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
+            	});
+            	$('.tab_content .city').each(function(){
+            		$(this).attr("disabled",!canClick);
+            	});
+            	$(".tips_d_money").hide();
+            }
           })
         },
         selectCity:function(citys,canClick){ //设置选中城市
@@ -626,6 +638,7 @@
           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){
               if(length >= 50){
@@ -660,12 +673,14 @@
                 $(".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()
@@ -789,6 +804,19 @@
             AreaChoose.getResult();
             AreaChoose.inintClick();
         })
+      //
+        //
+	    function checkObj(obj) {
+		    //检验数组
+		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
+		        return true;
+		    }
+		    //检验对象
+		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
+		        return true;
+		    }
+		    return false;
+		}
     </script>
 </body>
 

+ 24 - 1
src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html

@@ -305,6 +305,7 @@
                     // 除全部行业外所有按钮都被选中了
                     $('#all button').trigger('click');
                 }
+                $(".select-area-box .list").css("margin-top",$(".result").height()+20);
             }
                       
             function showSelect(arr,canclick){
@@ -320,8 +321,14 @@
 	                    }
                 	}else{
                 		if (v == $(dom).text()) {
-	                       $(dom).attr({"disabled":!canclick})
+	                       $(dom).attr({"disabled":!canclick});
 	                    }
+                		if(v == "全部行业"){
+                			$(".industry_item").each(function(){
+                				$(this).attr({"disabled":!canclick});
+                			});
+                			$(".tips_d_money").hide();
+                		}
                 	}
                 })
               })
@@ -393,6 +400,9 @@
 		            	buyIndustry = data.buyerclass;
                 	}
                 },false);
+                if(checkObj(buyIndustry)){
+                	buyIndustry = ["全部行业"]
+                }
                 //是否试用界面
                 if(sessionStorage.getItem("vipSubisTrial")) vipSubisTrial=true;
               }catch(e){
@@ -404,6 +414,19 @@
               findSelectedIndustry();
               flushPrice();
             })
+            
+            //
+		    function checkObj(obj) {
+			    //检验数组
+			    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
+			        return true;
+			    }
+			    //检验对象
+			    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
+			        return true;
+			    }
+			    return false;
+			}
         </script>
     </body>
 </html>

+ 22 - 0
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -475,6 +475,8 @@
 			    ends = data.endtime;
 			    monthPrice = data.monthprice;
 			    yearPrice = data.yearprice;
+			    console.log(area)
+			    console.log(buyerclass)
 			    //
 			    var areaArr = [];
 			    var areaHtml = "";
@@ -500,6 +502,10 @@
 			    		}
 			    	}
 			    	areaHtml = areaArr.toString().replace(/,/g, "、");
+			    	
+					if(checkObj(area)){
+						areaHtml = "全国";
+					}
 			    	$(".item_area .label_for").text(areaHtml);
 			    }
 			    if(buyerclass !== "" && buyerclass !== undefined){
@@ -508,6 +514,9 @@
 			    		buyerclassArr.push(industry);
 			    		buyerclassHtml = buyerclassArr.toString().replace(/,/g, "、");
 			    	}
+			    	if(checkObj(buyerclass)){
+			    		buyerclassHtml = "全行业";
+			    	}
 			    	$(".item_industry .label_for").text(buyerclassHtml);
 			    }
 			    if(cycleunit !== "" && cycleunit !== undefined){
@@ -644,6 +653,19 @@
 	    	sessionStorage.removeItem("renew_finally_price");
 	    }
 	    
+	    //
+	    function checkObj(obj) {
+		    //检验数组
+		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
+		        return true;
+		    }
+		    //检验对象
+		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
+		        return true;
+		    }
+		    return false;
+		}
+	    
     </script>
 </body>
 

+ 45 - 8
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -419,7 +419,7 @@
             }
             sessionStorage.effectiveDate = effective;
             $('#effect_date_name').html(checkValue);
-            window.location.reload();
+            FinallyPrice();
         });
         
         
@@ -593,8 +593,11 @@
                 $('.choose_item.lengthen .info').text(val)
             })
             var proPrice = $(".computed_price").html().replace("¥","")
+            if(val === "不延长"){
+            	proPrice = 0;
+            }
             sessionStorage.proPrice = proPrice;
-            window.location.reload();
+            FinallyPrice();
         })
         //新增区域
 	    if(sessionStorage.vipSubSelectArea!==""&&sessionStorage.vipSubSelectArea!==undefined){
@@ -773,6 +776,9 @@
 			    	}
 			    	areaHtml = areaArr.toString().replace(/,/g, " ");
 		//	    	$(".item_area .label_for").text(areaHtml);
+					if(checkObj(area)){
+						areaHtml = "全国";
+					}
 			    	$('#area').val(areaHtml);
 			    }
 			    if(buyerclass !== "" && buyerclass !== undefined){
@@ -782,6 +788,9 @@
 			    		buyerclassHtml = buyerclassArr.toString().replace(/,/g, " ");
 			    	}
 		//	    	$(".item_industry .label_for").text(buyerclassHtml);
+					if(checkObj(buyerclass)){
+						buyerclassHtml = "全行业";
+					}
 					$('#buyerclass').val(buyerclassHtml);
 			    }
 			    //
@@ -952,6 +961,8 @@
 					oldMonthPrice = r.oldmonthprice;
 				}
 			},false);
+			console.log("oldYearPrice",oldYearPrice)
+			console.log("oldMonthPrice",oldMonthPrice)
 			if(nowUpgradeYear >= 1){
 				let yearprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgradeYear,1]);
 				let monthprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
@@ -972,10 +983,18 @@
 				completeYear = ((price / nowUpgrade)*10-oldYearPrice).toFixed(1);
 				console.log("<1",price)
 			}
+			
+			console.log("oldPrice", oldPrice);
+			if(sessionStorage.vipSubSelectArea===undefined&&sessionStorage.vipSubSelectIndustry===undefined){
+				completeMonth = oldMonthPrice
+				completeYear = oldYearPrice
+			}
 			console.log("completeMonth",completeMonth)
 			console.log("completeYear",completeYear)
-			console.log("oldPrice", oldPrice);
-			var cPrice = (price - oldPrice).toFixed(1);
+			var cPrice = 0;
+  			if(price>0){
+  				var cPrice = (price - oldPrice).toFixed(1);
+  			}
 			console.log(cPrice);
 			if(sessionStorage.proPrice!==""&&sessionStorage.proPrice!==undefined){
 				let proPrice = sessionStorage.proPrice;
@@ -1040,11 +1059,29 @@
 	    
 	    //
 	    function clearSessionStorage(){
-	    	sessionStorage.removeItem("renew_cyclecount");
-	    	sessionStorage.removeItem("renew_cycleunit");
-	    	sessionStorage.removeItem("renew_price");
-	    	sessionStorage.removeItem("renew_finally_price");
+	    	sessionStorage.removeItem("upgrade_cyclecount");
+	    	sessionStorage.removeItem("upgrade_cycleunit");
+	    	sessionStorage.removeItem("upgrade_price");
+	    	sessionStorage.removeItem("proPrice");
+	    	sessionStorage.removeItem("vipSubSelectArea");
+	    	sessionStorage.removeItem("vipSubSelectIndustry");
+	    	sessionStorage.removeItem("effectiveDate");
 	    }
+	    
+	    //
+	    //
+	    function checkObj(obj) {
+		    //检验数组
+		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
+		        return true;
+		    }
+		    //检验对象
+		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
+		        return true;
+		    }
+		    return false;
+		}
+	    
     </script>
 </body>