xuzhiheng 5 years ago
parent
commit
a4c5447fe4

+ 2 - 7
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -84,8 +84,6 @@ func (this *RenewUpgrade) GetBuyMsg() {
 //升级续费
 //升级续费
 //创建订单返回支付串
 //创建订单返回支付串
 func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
-	area := qutil.ObjToMap(this.GetString("area"))                   //新增订阅区域
-	industry := strings.Split(this.GetString("industry"), ",")       //新增行业
 	allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea"))       //已购+新增区域
 	allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea"))       //已购+新增区域
 	allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
 	allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
 	date := this.GetString("time")                                   //不延长时为空,正常为 年或月
 	date := this.GetString("time")                                   //不延长时为空,正常为 年或月
@@ -106,9 +104,6 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	r := func() *entity.FuncResult {
 	r := func() *entity.FuncResult {
 		now := time.Now()
 		now := time.Now()
 		//数据校验
 		//数据校验
-		if len(industry) == 1 && industry[0] == "" { //去掉[""]
-			industry = []string{}
-		}
 		if len(allIndustry) == 1 && allIndustry[0] == "" { //去掉[""]
 		if len(allIndustry) == 1 && allIndustry[0] == "" { //去掉[""]
 			allIndustry = []string{}
 			allIndustry = []string{}
 		}
 		}
@@ -158,8 +153,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		filter := entity.VipSimpleMsg{}
 		filter := entity.VipSimpleMsg{}
 		if pay_source == "Renew" {
 		if pay_source == "Renew" {
 			filter = entity.VipSimpleMsg{
 			filter = entity.VipSimpleMsg{
-				area,
-				industry,
+				nil,
+				nil,
 				nil,
 				nil,
 				0,
 				0,
 				&oldBuyset,
 				&oldBuyset,

+ 2 - 2
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -817,8 +817,8 @@
 			}
 			}
 	        $(".save_renew").attr("disabled","disabled");
 	        $(".save_renew").attr("disabled","disabled");
 	    	var param = {
 	    	var param = {
-	    		"area": JSON.stringify(areas),
-	    		"industry": industrys.toString(),
+	    		// "area": JSON.stringify(areas),
+	    		// "industry": industrys.toString(),
 				// "buyset": JSON.stringify(oldBuyset),
 				// "buyset": JSON.stringify(oldBuyset),
 	    		"time": $('.choose_item.select_cycle .info').val(),
 	    		"time": $('.choose_item.select_cycle .info').val(),
 	    		"payWay":"wx_js",
 	    		"payWay":"wx_js",

+ 1 - 190
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -846,77 +846,13 @@
 						}
 						}
 					}
 					}
 				}
 				}
-				if(buyArea !== ""&&buyArea !== undefined){
-					for(let province in buyArea){
-			    		let citys = buyArea[province];
-			    		if(citys.length===0){
-							allBuyArea[province] = [];
-			    		}else{
-			    			allBuyArea[province] = citys;
-			    		}
-			    	}
-					for(let province in vipArea){
-						let citys = vipArea[province];
-						if(allBuyArea[province] === undefined){
-							allBuyArea[province] = citys
-						}else{
-							if(checkObj(citys)){
-								allBuyArea[province] = [];
-							}else{
-								let cityArr = [];
-								for(let i in citys){
-									cityArr.push(citys[i]);
-								}
-								for(let i in allBuyArea[province]){
-									cityArr.push(allBuyArea[province][i]);
-								}
-								//
-								for (var x = 0; x < cityArr.length; x++) {
-									for (var j =x+1; j <cityArr.length; ) {
-										if (cityArr[x] === cityArr[j]){
-											cityArr.splice(j, 1);
-										}
-										else j++;
-									}
-								}
-								//
-								allBuyArea[province] = cityArr;
-							}
-						}
-						if(province === "全国"){
-							allBuyArea = {"全国":[]};
-						}
-					}
-				}
-				// if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
-				// 	areasArr = addAreaObj();
-				// }else{
-				// 	areasArr = null;
-				// }
+				
 				if(buyCheck){
 				if(buyCheck){
 					$(".save_upgrade").removeAttr("disabled");
 					$(".save_upgrade").removeAttr("disabled");
 				}
 				}
 			}else{
 			}else{
 				areas_arr = null
 				areas_arr = null
 				// areasArr = null
 				// areasArr = null
-				if(buyArea !== ""&&buyArea !== undefined){
-					// for(let province in buyArea){
-			  //   		let citys = buyArea[province];
-			  //   		if(citys.length===0){
-					// 		allArea[province] = [];
-			  //   		}else{
-			  //   			allArea[province] = citys;
-			  //   		}
-			  //   	}
-					for(let province in buyArea){
-			    		let citys = buyArea[province];
-			    		if(citys.length===0){
-							allBuyArea[province] = [];
-			    		}else{
-			    			allBuyArea[province] = citys;
-			    		}
-			    	}
-				}
 				if(area !== ""&&area !== undefined){
 				if(area !== ""&&area !== undefined){
 					for(let province in area){
 					for(let province in area){
 						let citys = area[province];
 						let citys = area[province];
@@ -929,33 +865,6 @@
 				}
 				}
 			}
 			}
 			//
 			//
-			// if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
-			// 	var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
-			// 	for(let i in vipIndustry){
-		 //    		let industry = vipIndustry[i];
-		 //    		industrysArr.push(industry);
-		 //        }
-			// 	for(let i in vipIndustry){
-			// 		if(industry === "全部行业"){
-			// 			industrysArr = ["全部行业"];
-			// 		}
-			// 	}
-			// }
-			//
-			// if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
-			// 	var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
-			// 	for(let i in vipIndustry){
-		 //    		let industry = vipIndustry[i];
-		 //    		industrysArr.push(industry);
-		 //        }
-			// 	for(let i in vipIndustry){
-			// 		if(industry === "全部行业"){
-			// 			industrysArr = ["全部行业"];
-			// 		}
-			// 	}
-			// }else{
-			// 	industrysArr = null;
-			// }
 			
 			
 			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
 			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
@@ -984,16 +893,6 @@
 			    }
 			    }
 			}
 			}
 			//
 			//
-			// if(industrysArr !== null){
-			// 	for (var x = 0; x < industrysArr.length; x++) {
-		 //            for (var j =x+1; j <industrysArr.length; ) {
-		 //                if (industrysArr[x] === industrysArr[j]){
-		 //                    industrysArr.splice(j, 1);
-		 //                }
-		 //                else j++;
-		 //            }
-		 //       	}
-			// }
 			for (var x = 0; x < allIndustry.length; x++) {
 			for (var x = 0; x < allIndustry.length; x++) {
 	            for (var j =x+1; j <allIndustry.length; ) {
 	            for (var j =x+1; j <allIndustry.length; ) {
 	                if (allIndustry[x] === allIndustry[j]){
 	                if (allIndustry[x] === allIndustry[j]){
@@ -1077,33 +976,6 @@
 			
 			
 			//
 			//
 			if(nowUpgradeYear >= 1){
 			if(nowUpgradeYear >= 1){
-				// ------- 升级价格交叉计算 ---------
-				// let addAreaPriceY = 0;
-				// let addAreaPriceM = 0;
-				// let oldAreaPriceY = 0;
-				// let oldAreaPriceM = 0;
-				// let addIndustryPriceY = 0;
-				// let addIndustryPriceM = 0;
-				// if(areasArr !== null&&industrysArr !== null){
-				// 	addAreaPriceY = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgradeYear,1]);
-				// 	addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
-				// }
-				// if(areasArr !== null){
-				// 	oldAreaPriceY = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgradeYear,1]);
-				// 	oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
-				// }
-				// if(industrysArr !== null){
-				// 	addIndustryPriceY = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgradeYear,1]);
-				// 	addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
-				// }
-				// price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
-				// ------- 升级价格交叉计算 ---------
-				// ------- 升级价格差价计算 ---------
-				// let buyset = getBuySet(buyArea,buyIndustry)
-				// let newPriceY = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
-				// let newPriceM = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
-				// let yearprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
-				// let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
 				let newPriceY = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
 				let newPriceY = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
 				let newPriceM = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				let newPriceM = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				let yearprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
 				let yearprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
@@ -1122,22 +994,6 @@
 				console.log("monthprice",monthprice);
 				console.log("monthprice",monthprice);
 				console.log(">=1",price);
 				console.log(">=1",price);
 			}else{
 			}else{
-				// ------- 升级价格交叉计算 ---------
-				// let addAreaPriceM = 0;
-				// let oldAreaPriceM = 0;
-				// let addIndustryPriceM = 0;
-				// if(areasArr !== null&&industrysArr !== null){
-				// 	addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
-				// }
-				// if(areasArr !== null){
-				// 	oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
-				// }
-				// if(industrysArr !== null){
-				// 	addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
-				// }
-				// price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
-				// // ------- 升级价格交叉计算 ---------
-				// let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
 				let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				
 				
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级价格差价计算 ---------
@@ -1218,45 +1074,7 @@
 			    return
 			    return
 			}
 			}
         	$(".save_upgrade").attr("disabled","disabled");
         	$(".save_upgrade").attr("disabled","disabled");
-        	//
-        	// let areas = areasArr;
-        	// let industrys = null;
-        	// if(sessionStorage.vipSubSelectIndustryUpgrade !== undefined){
-        	// 	industrys = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
-        	// }
-        	// let industryArr = "";
-        	// let areaArr = "";
-        	// if(areas !== null){
-        	// 	if(areas["全国"]){
-	        //         areas={};
-	        //     }
-        	// 	areaArr = JSON.stringify(areas);
-        	// }else{
-        	// 	areaArr = "no";
-        	// }
-        	// if(industrys !== null){
-        	// 	if(industrys.length==1&&industrys[0]=="全部行业"){
-	        //         industrys=[];
-	        //     }
-        	// 	industryArr = industrys.join(",");
-        	// }else{
-        	// 	industryArr = "no";
-        	// }
-        	//
-        	// if(areas_arr !== null){
-        	// 	if(areas_arr["全国"]){
-	        //         areas_arr={};
-	        //     }
-        	// 	areas_arr = JSON.stringify(areas_arr);
-        	// }else{
-        	// 	areas_arr = "no";
-        	// }
-        	if(allBuyArea["全国"]){
-                allBuyArea={};
-            }
             //
             //
-            let areaarr = buyArea;
-        	let industryarr = buyIndustry;
         	let allIndustryArr = allIndustry;
         	let allIndustryArr = allIndustry;
         	if(allArea["全国"]){
         	if(allArea["全国"]){
                 allArea={};
                 allArea={};
@@ -1286,12 +1104,6 @@
             }
             }
             //
             //
 	    	var param = {
 	    	var param = {
-	    		// "area": areas_arr,
-	    		// "industry": industryArr,
-	    		// "areas": JSON.stringify(areaarr),
-	    		// "areas_arr": areaArr,
-	    		// "industryarr": industryarr.join(","),
-	    		// "allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
 	    		"allIndustry": allIndustryArr.join(","),
 	    		"allBuyArea": JSON.stringify(allArea),
 	    		"allBuyArea": JSON.stringify(allArea),
 	    		"payWay": "wx_js",
 	    		"payWay": "wx_js",
@@ -1300,7 +1112,6 @@
 	    		"addCount":vipCount,
 	    		"addCount":vipCount,
 	    		"addIndustryCount": vipIndustry,
 	    		"addIndustryCount": vipIndustry,
 				"buyset":JSON.stringify(areaObj()),
 				"buyset":JSON.stringify(areaObj()),
-				"oldbuyset":JSON.stringify(oldBuyset),
 	    	}
 	    	}
 	    	console.log(param)
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){