|
@@ -980,9 +980,9 @@
|
|
|
$(".save_upgrade").attr('disabled','disabled');
|
|
|
var nowUpgrade = "";
|
|
|
//
|
|
|
- var nowMonth = new Date(startTime).getMonth()+1;
|
|
|
- var nowYear = new Date(startTime).getFullYear();
|
|
|
- var nowDay = new Date(startTime).getDate();
|
|
|
+ var nowMonth = new Date().getMonth()+1;
|
|
|
+ var nowYear = new Date().getFullYear();
|
|
|
+ var nowDay = new Date().getDate();
|
|
|
//
|
|
|
var endMonth = new Date(endTime).getMonth()+1;
|
|
|
var endYear = new Date(endTime).getFullYear();
|
|
@@ -991,6 +991,7 @@
|
|
|
var price = "";
|
|
|
// var effect = "";
|
|
|
var buyCheck = true;
|
|
|
+ var cPrice = 0;
|
|
|
if(sessionStorage.buyCheck!==undefined&&sessionStorage.buyCheck!==""){
|
|
|
let bcheck = sessionStorage.buyCheck;
|
|
|
if(bcheck === "true"){
|
|
@@ -1001,96 +1002,137 @@
|
|
|
}
|
|
|
if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
|
|
|
var vipArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
|
|
|
- if(area !== ""&&area !== undefined){
|
|
|
- for(let province in area){
|
|
|
- let citys = area[province];
|
|
|
- if(citys.length===0){
|
|
|
- areasArr[province] = [];
|
|
|
- }else{
|
|
|
- areasArr[province] = citys;
|
|
|
- }
|
|
|
- }
|
|
|
- for(let province in vipArea){
|
|
|
- let citys = vipArea[province];
|
|
|
- if(areasArr[province] === undefined){
|
|
|
- areasArr[province] = citys
|
|
|
- }else{
|
|
|
- let cityArr = [];
|
|
|
- for(let i in citys){
|
|
|
- cityArr.push(citys[i]);
|
|
|
- }
|
|
|
- for(let i in areasArr[province]){
|
|
|
- cityArr.push(areasArr[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++;
|
|
|
- }
|
|
|
- }
|
|
|
- //
|
|
|
- areasArr[province] = cityArr;
|
|
|
- }
|
|
|
- if(province === "全国"){
|
|
|
- areasArr = {"全国":[]};
|
|
|
- }
|
|
|
+ for(let province in vipArea){
|
|
|
+ let citys = vipArea[province];
|
|
|
+ if(citys.length===0){
|
|
|
+ areasArr[province] = [];
|
|
|
+ }else{
|
|
|
+ areasArr[province] = citys;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let province in vipArea){
|
|
|
+ if(province === "全国"){
|
|
|
+ areasArr = {"全国":[]};
|
|
|
}
|
|
|
- }
|
|
|
- console.log($(".save_upgrade").attr("disabled"))
|
|
|
+ }
|
|
|
if(buyCheck){
|
|
|
$(".save_upgrade").removeAttr("disabled");
|
|
|
}
|
|
|
}else{
|
|
|
- if(area !== ""&&area !== undefined){
|
|
|
- for(let province in area){
|
|
|
- let citys = area[province];
|
|
|
- if(citys.length===0){
|
|
|
- areasArr[province] = [];
|
|
|
- }else{
|
|
|
- areasArr[province] = citys;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ areasArr = null;
|
|
|
}
|
|
|
+// if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
|
|
|
+// var vipArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
|
|
|
+// if(area !== ""&&area !== undefined){
|
|
|
+// for(let province in area){
|
|
|
+// let citys = area[province];
|
|
|
+// if(citys.length===0){
|
|
|
+// areasArr[province] = [];
|
|
|
+// }else{
|
|
|
+// areasArr[province] = citys;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// for(let province in vipArea){
|
|
|
+// let citys = vipArea[province];
|
|
|
+// if(areasArr[province] === undefined){
|
|
|
+// areasArr[province] = citys
|
|
|
+// }else{
|
|
|
+// let cityArr = [];
|
|
|
+// for(let i in citys){
|
|
|
+// cityArr.push(citys[i]);
|
|
|
+// }
|
|
|
+// for(let i in areasArr[province]){
|
|
|
+// cityArr.push(areasArr[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++;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //
|
|
|
+// areasArr[province] = cityArr;
|
|
|
+// }
|
|
|
+// if(province === "全国"){
|
|
|
+// areasArr = {"全国":[]};
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// console.log($(".save_upgrade").attr("disabled"))
|
|
|
+// if(buyCheck){
|
|
|
+// $(".save_upgrade").removeAttr("disabled");
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// if(area !== ""&&area !== undefined){
|
|
|
+// for(let province in area){
|
|
|
+// let citys = area[province];
|
|
|
+// if(citys.length===0){
|
|
|
+// areasArr[province] = [];
|
|
|
+// }else{
|
|
|
+// areasArr[province] = citys;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
console.log("areasArr",areasArr)
|
|
|
if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
|
|
|
var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
|
|
|
- if(buyerclass!==""&&buyerclass!==undefined){
|
|
|
- for(let i in buyerclass){
|
|
|
- let industry = buyerclass[i];
|
|
|
- industrysArr.push(industry);
|
|
|
- }
|
|
|
- for(let i in vipIndustry){
|
|
|
- let industry = vipIndustry[i];
|
|
|
- industrysArr.push(industry);
|
|
|
- if(industry === "全部行业"){
|
|
|
- industrysArr = ["全部行业"];
|
|
|
- }
|
|
|
+ for(let i in vipIndustry){
|
|
|
+ let industry = vipIndustry[i];
|
|
|
+ industrysArr.push(industry);
|
|
|
+ }
|
|
|
+ for(let i in vipIndustry){
|
|
|
+ if(industry === "全部行业"){
|
|
|
+ industrysArr = ["全部行业"];
|
|
|
}
|
|
|
}
|
|
|
if(buyCheck){
|
|
|
$(".save_upgrade").removeAttr("disabled");
|
|
|
}
|
|
|
}else{
|
|
|
- if(buyerclass!==""&&buyerclass!==undefined){
|
|
|
- for(let i in buyerclass){
|
|
|
- let industry = buyerclass[i];
|
|
|
- industrysArr.push(industry);
|
|
|
- }
|
|
|
- }
|
|
|
+ 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++;
|
|
|
- }
|
|
|
- }
|
|
|
+// if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
|
|
|
+// var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
|
|
|
+// if(buyerclass!==""&&buyerclass!==undefined){
|
|
|
+// for(let i in buyerclass){
|
|
|
+// let industry = buyerclass[i];
|
|
|
+// industrysArr.push(industry);
|
|
|
+// }
|
|
|
+// for(let i in vipIndustry){
|
|
|
+// let industry = vipIndustry[i];
|
|
|
+// industrysArr.push(industry);
|
|
|
+// if(industry === "全部行业"){
|
|
|
+// industrysArr = ["全部行业"];
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(buyCheck){
|
|
|
+// $(".save_upgrade").removeAttr("disabled");
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// if(buyerclass!==""&&buyerclass!==undefined){
|
|
|
+// for(let i in buyerclass){
|
|
|
+// let industry = buyerclass[i];
|
|
|
+// industrysArr.push(industry);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
console.log("industrysArr",industrysArr);
|
|
|
// if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
|
|
@@ -1182,9 +1224,30 @@
|
|
|
|
|
|
//
|
|
|
if(nowUpgradeYear >= 1){
|
|
|
- let yearprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgradeYear,1]);
|
|
|
- let monthprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
- price = yearprice + monthprice;
|
|
|
+ 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,buyerclass,[nowUpgradeYear,1]);
|
|
|
+ oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
|
|
|
+ }
|
|
|
+ if(industrysArr !== null){
|
|
|
+ addIndustryPriceY = getsubVipOrderPrice(area,industrysArr,[nowUpgradeYear,1]);
|
|
|
+ addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
|
|
|
+ }
|
|
|
+// let yearprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgradeYear,1]);
|
|
|
+// let monthprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
+// price = yearprice + monthprice;
|
|
|
+ price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
|
|
|
+ let yearprice = addAreaPriceY + oldAreaPriceY + addIndustryPriceY;
|
|
|
+ let monthprice = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
if(monthprice === 0){
|
|
|
completeMonth = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
|
|
|
completeYear = (yearprice / nowUpgradeYear).toFixed(1);
|
|
@@ -1196,7 +1259,20 @@
|
|
|
console.log("monthprice",monthprice);
|
|
|
console.log(">=1",price);
|
|
|
}else{
|
|
|
- price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
+ 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,buyerclass,[nowUpgrade,2]);
|
|
|
+ }
|
|
|
+ if(industrysArr !== null){
|
|
|
+ addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
|
|
|
+ }
|
|
|
+// price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
+ price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
completeMonth = (price / nowUpgrade).toFixed(1);
|
|
|
completeYear = ((price / nowUpgrade)*10).toFixed(1);
|
|
|
console.log("<1",price)
|
|
@@ -1204,8 +1280,8 @@
|
|
|
|
|
|
console.log("oldPrice", oldPrice);
|
|
|
if(sessionStorage.vipSubSelectAreaUpgrade===undefined&&sessionStorage.vipSubSelectIndustryUpgrade===undefined){
|
|
|
- completeMonth = oldMonthPrice
|
|
|
- completeYear = oldYearPrice
|
|
|
+ completeMonth = oldMonthPrice;
|
|
|
+ completeYear = oldYearPrice;
|
|
|
}
|
|
|
console.log("completeMonth",completeMonth)
|
|
|
console.log("completeYear",completeYear)
|
|
@@ -1220,10 +1296,10 @@
|
|
|
sessionStorage.proPrice = price;
|
|
|
}
|
|
|
}
|
|
|
- var cPrice = 0;
|
|
|
- if(price>0){
|
|
|
- var cPrice = (price - oldPrice).toFixed(1);
|
|
|
- }
|
|
|
+
|
|
|
+ if(price>0){
|
|
|
+ var cPrice = price;
|
|
|
+ }
|
|
|
console.log(cPrice);
|
|
|
if(sessionStorage.proPrice!==""&&sessionStorage.proPrice!==undefined){
|
|
|
let proPrice = sessionStorage.proPrice;
|
|
@@ -1272,12 +1348,24 @@
|
|
|
//
|
|
|
let areas = areasArr;
|
|
|
let industrys = industrysArr;
|
|
|
- if(areas["全国"]){
|
|
|
- areas={};
|
|
|
- }
|
|
|
- if(industrys.length==1&&industrys[0]=="全部行业"){
|
|
|
- industrys=[];
|
|
|
- }
|
|
|
+ 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";
|
|
|
+ }
|
|
|
//
|
|
|
let areaarr = area;
|
|
|
let industryarr = buyerclass;
|
|
@@ -1290,8 +1378,8 @@
|
|
|
}
|
|
|
//
|
|
|
var param = {
|
|
|
- "area": JSON.stringify(areas),
|
|
|
- "industry": industrys.join(","),
|
|
|
+ "area": areaArr,
|
|
|
+ "industry": industryArr,
|
|
|
"areas": JSON.stringify(areaarr),
|
|
|
"industryarr": industryarr.join(","),
|
|
|
"payWay": "wx_js",
|