xuzhiheng 5 年之前
父节点
当前提交
4cde88b78d

+ 43 - 0
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_upgrade.html

@@ -795,6 +795,44 @@
 						}
 					}
 				}
+				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{
+							let cityArr = [];
+							for(let i in citys){
+								cityArr.push(citys[i]);
+							}
+							for(let i in allArea[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{
@@ -1138,6 +1176,10 @@
 	            }
             }
             //
+            if(allBuyArea["全国"]){
+                allBuyArea={};
+            }
+            //
             let payTypes = $(".weixin_pay").text();
             let payType = "wx_app";
             if(payTypes === "支付宝支付"){
@@ -1152,6 +1194,7 @@
 	    		"industryarr": industryarr.join(","),
 	    		"allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
+	    		"allBuyArea": JSON.stringify(allBuyArea),
 	    		"payWay": "wx_js",
 	    		"pay_source" : "Upgrade",
 	    		"time": times,

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

@@ -122,7 +122,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		vipBuyCount = &map[string]interface{}{}
 	}
 	industryCount, _ := this.GetInteger("addIndustryCount")
-	log.Println("666", industryCount)
+	allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea"))
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 	r := func() *entity.FuncResult {
@@ -180,7 +180,6 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		}
 		filter := entity.VipSimpleMsg{}
 		if pay_source == "Renew" {
-			log.Println("industrys", industrys)
 			filter = entity.VipSimpleMsg{
 				area,
 				industry,
@@ -188,6 +187,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				nil,
 				nil,
 				0,
+				nil,
 				date_count,
 				date_unit,
 				orderType,
@@ -200,6 +200,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				industry,
 				vipBuyCount,
 				industryCount,
+				allBuyArea,
 				date_count,
 				date_unit,
 				orderType,

+ 43 - 0
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -736,6 +736,7 @@
         var areas_arr = {};
 	    var industrysArr = [];
 	    var allArea = {};
+	    var allBuyArea = {};
 	    var allIndustry = [];
 	    var nowRenew = "";
         function FinallyPrice(){
@@ -815,6 +816,44 @@
 						}
 					}
 				}
+				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{
+							let cityArr = [];
+							for(let i in citys){
+								cityArr.push(citys[i]);
+							}
+							for(let i in allArea[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{
@@ -1127,6 +1166,9 @@
         	}else{
         		areas_arr = "no";
         	}
+        	if(allBuyArea["全国"]){
+                allBuyArea={};
+            }
             //
             let areaarr = buyArea;
         	let industryarr = buyIndustry;
@@ -1166,6 +1208,7 @@
 	    		"industryarr": industryarr.join(","),
 	    		"allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
+	    		"allBuyArea": JSON.stringify(allBuyArea),
 	    		"payWay": "wx_js",
 	    		"pay_source" : "Upgrade",
 	    		"time": times,