xuzhiheng 5 năm trước cách đây
mục cha
commit
1ea617a270

+ 5 - 5
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -238,11 +238,11 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				if upgradeBuyset.AreaCount == -1 {
 					return &entity.FuncResult{false, errors.New("非法请求"), nil}
 				}
-				for province, cityCount := range *cityArr {
-					if qutil.IntAll((*newCityArr)[province]) < qutil.IntAll(cityCount) {
-						return &entity.FuncResult{false, errors.New("非法请求"), nil}
-					}
-				}
+				//				for province, cityCount := range *cityArr {
+				//					if qutil.IntAll((*newCityArr)[province]) < qutil.IntAll(cityCount) {
+				//						return &entity.FuncResult{false, errors.New("非法请求"), nil}
+				//					}
+				//				}
 				//				citysMap := upgradeBuyset.Citys
 				//				for provinces, cityCounts := range *newCityArr {
 				//					if citysMap[provinces] != nil {

+ 26 - 3
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -986,12 +986,12 @@
 				// console.log("monthprice",monthprice);
 				// console.log(">=1",price);
 			}else{
-				let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
+				let monthprice = getsubVipOrderPriceBybuyset(buySetObj(newBuysetObj(areaObj())),[nowUpgrade,2]);
 				
 				// ------- 升级价格差价计算 ---------
 				
 				// let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
-				let newPrice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
+				let newPrice = getsubVipOrderPriceBybuyset(buySetObj(newBuysetObj(areaObj())),[nowUpgrade,2]);
 				price = newPrice - oldPrice;
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级延长周期价格计算 ---------
@@ -1103,7 +1103,7 @@
 	    		"time": times,
 	    		"addCount":vipCount,
 	    		"addIndustryCount": vipIndustry,
-				"buyset":JSON.stringify(areaObj()),
+				"buyset":JSON.stringify(buySetObj(areaObj())),
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
@@ -1221,6 +1221,29 @@
 			}
 			return newset
 		}
+		
+		function buySetObj(buyset){
+			let nowset = JSON.parse(JSON.stringify(buyset));
+			if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
+				let vip_area = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
+				for(let province in nowset.citys){
+					if(nowset.citys[province] > 0){
+						if(checkObj(vip_area[province])){
+							let cityarr = nowset.citys
+							delete cityarr[province]
+						}
+					}
+				}
+				// for(let n in nowset.citys){
+				// 	if(nowset.citys[n] > 2){
+				// 		let cityarr = nowset.citys
+				// 		delete cityarr[n]
+				// 		nowset.areacount += 1
+				// 	}
+				// }
+			}
+			return nowset
+		}
 	    
     </script>
 </body>