|
@@ -743,7 +743,7 @@
|
|
|
var areasArr = {};
|
|
|
var areas_arr = {};
|
|
|
var industrysArr = [];
|
|
|
- // var allArea = {};
|
|
|
+ var allArea = {};
|
|
|
var allBuyArea = {};
|
|
|
var allIndustry = [];
|
|
|
var nowRenew = "";
|
|
@@ -786,44 +786,48 @@
|
|
|
areas_arr = {"全国":[]};
|
|
|
}
|
|
|
}
|
|
|
- // if(area !== ""&&area !== undefined){
|
|
|
- // for(let province in area){
|
|
|
- // let citys = area[province];
|
|
|
- // if(citys.length===0){
|
|
|
- // allArea[province] = [];
|
|
|
- // }else{
|
|
|
- // allArea[province] = citys;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // for(let province in vipArea){
|
|
|
- // let citys = vipArea[province];
|
|
|
- // if(allArea[province] === undefined){
|
|
|
- // allArea[province] = citys
|
|
|
- // }else{
|
|
|
- // let cityArr = [];
|
|
|
- // for(let i in citys){
|
|
|
- // cityArr.push(citys[i]);
|
|
|
- // }
|
|
|
- // for(let i in allArea[province]){
|
|
|
- // cityArr.push(allArea[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++;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //
|
|
|
- // allArea[province] = cityArr;
|
|
|
- // }
|
|
|
- // if(province === "全国"){
|
|
|
- // allArea = {"全国":[]};
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+ if(area !== ""&&area !== undefined){
|
|
|
+ for(let province in area){
|
|
|
+ let citys = area[province];
|
|
|
+ if(citys.length===0){
|
|
|
+ allArea[province] = [];
|
|
|
+ }else{
|
|
|
+ allArea[province] = citys;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let province in vipArea){
|
|
|
+ let citys = vipArea[province];
|
|
|
+ if(allArea[province] === undefined){
|
|
|
+ allArea[province] = citys
|
|
|
+ }else{
|
|
|
+ if(checkObj(citys)){
|
|
|
+ allArea[province] = [];
|
|
|
+ }else{
|
|
|
+ let cityArr = [];
|
|
|
+ for(let i in citys){
|
|
|
+ cityArr.push(citys[i]);
|
|
|
+ }
|
|
|
+ for(let i in allArea[province]){
|
|
|
+ cityArr.push(allArea[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++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ allArea[province] = cityArr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(province === "全国"){
|
|
|
+ allArea = {"全国":[]};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(buyArea !== ""&&buyArea !== undefined){
|
|
|
for(let province in buyArea){
|
|
|
let citys = buyArea[province];
|
|
@@ -838,24 +842,28 @@
|
|
|
if(allBuyArea[province] === undefined){
|
|
|
allBuyArea[province] = citys
|
|
|
}else{
|
|
|
- let cityArr = [];
|
|
|
- for(let i in citys){
|
|
|
- cityArr.push(citys[i]);
|
|
|
- }
|
|
|
- for(let i in allBuyArea[province]){
|
|
|
- cityArr.push(allBuyArea[province][i]);
|
|
|
+ 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;
|
|
|
}
|
|
|
- //
|
|
|
- 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 = {"全国":[]};
|
|
@@ -1031,6 +1039,7 @@
|
|
|
oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
|
|
|
}
|
|
|
} else {
|
|
|
+ console.log(buyArea)
|
|
|
oldPrice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
|
|
|
oldMonthPrice = (oldPrice / nowUpgrade)
|
|
|
oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
|
|
@@ -1062,10 +1071,15 @@
|
|
|
// price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
|
|
|
// ------- 升级价格交叉计算 ---------
|
|
|
// ------- 升级价格差价计算 ---------
|
|
|
- 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 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(areaObj(),[nowUpgradeYear,1]);
|
|
|
+ let newPriceM = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
|
|
|
+ let yearprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgradeYear,1]);
|
|
|
+ let monthprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
|
|
|
price = newPriceY + newPriceM - oldPrice;
|
|
|
// ------- 升级延长周期价格计算 ---------
|
|
|
if(monthprice === 0){
|
|
@@ -1095,10 +1109,13 @@
|
|
|
// }
|
|
|
// price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
// // ------- 升级价格交叉计算 ---------
|
|
|
- let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
+ // let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
+ let monthprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
|
|
|
|
|
|
// ------- 升级价格差价计算 ---------
|
|
|
- let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
+
|
|
|
+ // let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
+ let newPrice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
|
|
|
price = newPrice - oldPrice;
|
|
|
// ------- 升级价格差价计算 ---------
|
|
|
// ------- 升级延长周期价格计算 ---------
|
|
@@ -1202,11 +1219,10 @@
|
|
|
//
|
|
|
let areaarr = buyArea;
|
|
|
let industryarr = buyIndustry;
|
|
|
- // let allAreaArr = allArea;
|
|
|
let allIndustryArr = allIndustry;
|
|
|
- // if(allAreaArr["全国"]){
|
|
|
- // allAreaArr={};
|
|
|
- // }
|
|
|
+ if(allArea["全国"]){
|
|
|
+ allArea={};
|
|
|
+ }
|
|
|
if(allIndustryArr.length==1&&allIndustryArr[0]=="全部行业"){
|
|
|
allIndustryArr=[];
|
|
|
}
|
|
@@ -1239,12 +1255,13 @@
|
|
|
"industryarr": industryarr.join(","),
|
|
|
// "allArea": JSON.stringify(allAreaArr),
|
|
|
"allIndustry": allIndustryArr.join(","),
|
|
|
- "allBuyArea": JSON.stringify(allBuyArea),
|
|
|
+ "allBuyArea": JSON.stringify(allArea),
|
|
|
"payWay": "wx_js",
|
|
|
"pay_source" : "Upgrade",
|
|
|
"time": times,
|
|
|
"addCount":vipCount,
|
|
|
"addIndustryCount": vipIndustry,
|
|
|
+ "buyset":JSON.stringify(areaObj()),
|
|
|
}
|
|
|
console.log(param)
|
|
|
$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
|
|
@@ -1326,6 +1343,40 @@
|
|
|
// }
|
|
|
// return areasObj
|
|
|
// }
|
|
|
+ function areaObj(){
|
|
|
+ let buyset = getBuySet(buyArea,buyIndustry)
|
|
|
+ if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
|
|
|
+ let addbuyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
|
|
|
+ if(addbuyset.country !== -1){
|
|
|
+ if(addbuyset.province !== 0){
|
|
|
+ buyset.areacount = buyset.areacount + addbuyset.province;
|
|
|
+ }
|
|
|
+ if(!checkObj(addbuyset.city)){
|
|
|
+ let cityArr = addbuyset.city
|
|
|
+ for(var i in cityArr){
|
|
|
+ let citysArr = buyset.citys
|
|
|
+ if(citysArr[i] !== undefined){
|
|
|
+ citysArr[i] = citysArr[i] + cityArr[i]
|
|
|
+ }else{
|
|
|
+ citysArr[i] = cityArr[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ buyset.areacount = -1;
|
|
|
+ buyset.citys = {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sessionStorage.vipSubSelectIndustryAdd!==undefined){
|
|
|
+ var addindustrys = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
|
|
|
+ if(addindustrys.length === 1 && addindustrys[0] === "全部行业"){
|
|
|
+ buyset.buyerclasscount = -1;
|
|
|
+ }else{
|
|
|
+ buyset.buyerclasscount = buyset.buyerclasscount + addindustrys.length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return buyset
|
|
|
+ }
|
|
|
|
|
|
</script>
|
|
|
</body>
|