|
@@ -597,38 +597,39 @@
|
|
|
}
|
|
|
$("#buy").prop("checked", bCheck);
|
|
|
}
|
|
|
- //新增区域
|
|
|
- if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""){
|
|
|
- var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
|
|
|
+ //新增区域
|
|
|
+ if(sessionStorage.vipAddCount!==""&&sessionStorage.vipAddCount!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
|
|
|
+ var vipSubSelectArea = JSON.parse(sessionStorage.vipAddCount);
|
|
|
+ var vipadd = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
|
|
|
let cityLen = sessionStorage.vipSubSelectCity;
|
|
|
- if(vipSubSelectArea.country === -1){
|
|
|
+ if(vipadd.country === -1){
|
|
|
areaHtml = "已新增全国";
|
|
|
$("#area").attr("placeholder", areaHtml);
|
|
|
}else{
|
|
|
areaHtml = "已新增 "+ vipSubSelectArea.province +" 个省级区域、"+ cityLen +" 个地市";
|
|
|
if(Number(vipSubSelectArea.province) === 0 && Number(cityLen) === 0){
|
|
|
- areaHtml = "请选择升级区域";
|
|
|
+ areaHtml = "选择升级区域";
|
|
|
}
|
|
|
$("#area").attr("placeholder", areaHtml);
|
|
|
}
|
|
|
- }
|
|
|
- //新增行业
|
|
|
- if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
|
|
|
- var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
|
|
|
- var industryArr = [];
|
|
|
- var isAll = "";
|
|
|
- var industryHtml = "";
|
|
|
+ }
|
|
|
+ //新增行业
|
|
|
+ if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
|
|
|
+ var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
|
|
|
+ var industryArr = [];
|
|
|
+ var isAll = "";
|
|
|
+ var industryHtml = "";
|
|
|
// $(".industry-list").show();
|
|
|
- for(var i in vipSubSelectIndustry){
|
|
|
- var industry = vipSubSelectIndustry[i];
|
|
|
- industryArr.push(industry);
|
|
|
- if(industry === "全部行业"){
|
|
|
- isAll = "all";
|
|
|
- }
|
|
|
- }
|
|
|
- var industryLen = industryArr.length
|
|
|
- if(isAll === ""){
|
|
|
- industryHtml = "已新增 "+ industryLen +" 个行业";
|
|
|
+ for(var i in vipSubSelectIndustry){
|
|
|
+ var industry = vipSubSelectIndustry[i];
|
|
|
+ industryArr.push(industry);
|
|
|
+ if(industry === "全部行业"){
|
|
|
+ isAll = "all";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var industryLen = industryArr.length
|
|
|
+ if(isAll === ""){
|
|
|
+ industryHtml = "已新增 "+ industryLen +" 个行业";
|
|
|
$("#buyerclass").attr("placeholder", industryHtml);
|
|
|
}else{
|
|
|
industryHtml = "已新增全行业";
|
|
@@ -638,7 +639,7 @@
|
|
|
industryHtml = "选择升级行业";
|
|
|
$("#buyerclass").attr("placeholder", industryHtml);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
//支付方式
|
|
|
if(sessionStorage.payType!==""&&sessionStorage.payType!==undefined){
|
|
|
var payType = sessionStorage.payType;
|
|
@@ -690,38 +691,39 @@
|
|
|
|
|
|
//
|
|
|
var area = "";
|
|
|
- var buyerclass = "";
|
|
|
- var buyArea = "";
|
|
|
- var buyIndustry = "";
|
|
|
- var cycleunit = "";
|
|
|
- var cyclecount = "";
|
|
|
- var startTime = "";
|
|
|
- var starts = "";
|
|
|
- var endTime = "";
|
|
|
- var ends = "";
|
|
|
- $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
|
|
|
- if (data) {
|
|
|
- area = data.area;
|
|
|
- buyerclass = data.buyerclass;
|
|
|
- buyArea = data.allarea;
|
|
|
- buyIndustry = data.allindustry;
|
|
|
- cycleunit = data.cycleunit;
|
|
|
- cyclecount = data.cyclecount;
|
|
|
- startTime = data.start;
|
|
|
- starts = data.starttime;
|
|
|
- endTime = data.end;
|
|
|
- ends = data.endtime;
|
|
|
+ var buyerclass = "";
|
|
|
+ var buyArea = "";
|
|
|
+ var buyIndustry = "";
|
|
|
+ var cycleunit = "";
|
|
|
+ var cyclecount = "";
|
|
|
+ var startTime = "";
|
|
|
+ var starts = "";
|
|
|
+ var endTime = "";
|
|
|
+ var ends = "";
|
|
|
+ var oldBuyset = "";
|
|
|
+ $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
|
|
|
+ if (data.success) {
|
|
|
+ area = data.data.area;
|
|
|
+ buyerclass = data.data.buyerclass;
|
|
|
+ cycleunit = data.data.cycleunit;
|
|
|
+ cyclecount = data.data.cyclecount;
|
|
|
+ startTime = data.data.start;
|
|
|
+ starts = data.data.starttime;
|
|
|
+ endTime = data.data.end;
|
|
|
+ ends = data.data.endtime;
|
|
|
+ oldBuyset = data.data.buyset;
|
|
|
}
|
|
|
- },false);
|
|
|
- //
|
|
|
- var completeMonth = 0;
|
|
|
+ },false);
|
|
|
+ console.log("666666666333",oldBuyset)
|
|
|
+ //
|
|
|
+ var completeMonth = 0;
|
|
|
var completeYear = 0;
|
|
|
var oldYearPrice = 0;
|
|
|
var oldMonthPrice = 0;
|
|
|
var areasArr = {};
|
|
|
var areas_arr = {};
|
|
|
var industrysArr = [];
|
|
|
- // var allArea = {};
|
|
|
+ var allArea = {};
|
|
|
var allBuyArea = {};
|
|
|
var allIndustry = [];
|
|
|
var nowRenew = "";
|
|
@@ -764,141 +766,70 @@
|
|
|
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(buyArea !== ""&&buyArea !== undefined){
|
|
|
- for(let province in buyArea){
|
|
|
- let citys = buyArea[province];
|
|
|
+ if(area !== ""&&area !== undefined){
|
|
|
+ for(let province in area){
|
|
|
+ let citys = area[province];
|
|
|
if(citys.length===0){
|
|
|
- allBuyArea[province] = [];
|
|
|
+ allArea[province] = [];
|
|
|
}else{
|
|
|
- allBuyArea[province] = citys;
|
|
|
+ allArea[province] = citys;
|
|
|
}
|
|
|
}
|
|
|
for(let province in vipArea){
|
|
|
let citys = vipArea[province];
|
|
|
- if(allBuyArea[province] === undefined){
|
|
|
- allBuyArea[province] = citys
|
|
|
+ if(allArea[province] === undefined){
|
|
|
+ allArea[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]);
|
|
|
- }
|
|
|
- //
|
|
|
- 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);
|
|
|
+ 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++;
|
|
|
}
|
|
|
- else j++;
|
|
|
}
|
|
|
+ //
|
|
|
+ allArea[province] = cityArr;
|
|
|
}
|
|
|
- //
|
|
|
- allBuyArea[province] = cityArr;
|
|
|
}
|
|
|
if(province === "全国"){
|
|
|
- allBuyArea = {"全国":[]};
|
|
|
+ allArea = {"全国":[]};
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
|
|
|
- areasArr = addAreaObj();
|
|
|
- }else{
|
|
|
- areasArr = null;
|
|
|
- }
|
|
|
+
|
|
|
if(buyCheck){
|
|
|
$(".save_upgrade").removeAttr("disabled");
|
|
|
}
|
|
|
}else{
|
|
|
areas_arr = 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];
|
|
|
+ // areasArr = null
|
|
|
+ if(area !== ""&&area !== undefined){
|
|
|
+ for(let province in area){
|
|
|
+ let citys = area[province];
|
|
|
if(citys.length===0){
|
|
|
- allBuyArea[province] = [];
|
|
|
+ allArea[province] = [];
|
|
|
}else{
|
|
|
- allBuyArea[province] = citys;
|
|
|
+ allArea[province] = citys;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ sessionStorage.removeItem("vipAddCount");
|
|
|
+ sessionStorage.removeItem("vipSubSelectAreaAdd");
|
|
|
+ sessionStorage.removeItem("vipSubSelectCity");
|
|
|
}
|
|
|
//
|
|
|
- // 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 = ["全部行业"];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- //
|
|
|
- console.log("areasArr",areasArr)
|
|
|
- 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){
|
|
|
var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
|
|
@@ -919,24 +850,14 @@
|
|
|
$(".save_upgrade").removeAttr("disabled");
|
|
|
}
|
|
|
}else{
|
|
|
- if(buyIndustry!==""&&buyIndustry!==undefined){
|
|
|
- for(let i in buyIndustry){
|
|
|
- let industry = buyIndustry[i];
|
|
|
+ if(buyerclass!==""&&buyerclass!==undefined){
|
|
|
+ for(let i in buyerclass){
|
|
|
+ let industry = buyerclass[i];
|
|
|
allIndustry.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++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
for (var x = 0; x < allIndustry.length; x++) {
|
|
|
for (var j =x+1; j <allIndustry.length; ) {
|
|
|
if (allIndustry[x] === allIndustry[j]){
|
|
@@ -998,8 +919,10 @@
|
|
|
console.log("month",nowUpgrade)
|
|
|
//
|
|
|
if (nowUpgradeYear >= 1) {
|
|
|
- let monthprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
|
|
|
- let yearprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgradeYear, 1])
|
|
|
+ // let monthprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
|
|
|
+ // let yearprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgradeYear, 1])
|
|
|
+ let monthprice = getsubVipOrderPriceBybuyset(oldBuyset, [nowUpgrade, 2])
|
|
|
+ let yearprice = getsubVipOrderPriceBybuyset(oldBuyset, [nowUpgradeYear,1]);
|
|
|
oldPrice = yearprice + monthprice
|
|
|
if (monthprice == 0) {
|
|
|
oldMonthPrice = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
|
|
@@ -1009,7 +932,7 @@
|
|
|
oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
|
|
|
}
|
|
|
} else {
|
|
|
- oldPrice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
|
|
|
+ oldPrice = getsubVipOrderPriceBybuyset(oldBuyset, [nowUpgrade, 2])
|
|
|
oldMonthPrice = (oldPrice / nowUpgrade)
|
|
|
oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
|
|
|
}
|
|
@@ -1018,32 +941,12 @@
|
|
|
|
|
|
//
|
|
|
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]);
|
|
|
- }
|
|
|
- // let yearprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgradeYear,1]);
|
|
|
- // let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
|
|
|
- let yearprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
|
|
|
- let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
-// price = yearprice + monthprice;
|
|
|
- price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
|
|
|
-// let yearprice = addAreaPriceY + oldAreaPriceY + addIndustryPriceY;
|
|
|
-// let monthprice = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
+ let newPriceY = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
|
|
|
+ let newPriceM = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
|
|
|
+ let yearprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
|
|
|
+ let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
|
|
|
+ price = newPriceY + newPriceM - oldPrice;
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
if(monthprice === 0){
|
|
|
completeMonth = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
|
|
|
completeYear = (yearprice / nowUpgradeYear).toFixed(1);
|
|
@@ -1051,28 +954,23 @@
|
|
|
completeMonth = (monthprice / nowUpgrade).toFixed(1);
|
|
|
completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
|
|
|
}
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
console.log("yearprice",yearprice);
|
|
|
console.log("monthprice",monthprice);
|
|
|
console.log(">=1",price);
|
|
|
}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]);
|
|
|
- }
|
|
|
- // let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
|
|
|
- let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
-// price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
- price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
+ let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
|
|
|
+
|
|
|
+ // ------- 升级价格差价计算 ---------
|
|
|
+
|
|
|
+ // let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
+ let newPrice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
|
|
|
+ price = newPrice - oldPrice;
|
|
|
+ // ------- 升级价格差价计算 ---------
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
completeMonth = (monthprice / nowUpgrade).toFixed(1);
|
|
|
completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
console.log("<1",price)
|
|
|
}
|
|
|
|
|
@@ -1083,6 +981,7 @@
|
|
|
}
|
|
|
console.log("completeMonth",completeMonth)
|
|
|
console.log("completeYear",completeYear)
|
|
|
+ // ------- 延长周期价格赋值 ---------
|
|
|
if(sessionStorage.upgrade_cyclecount !== undefined && sessionStorage.upgrade_cycleunit !== undefined){
|
|
|
if(sessionStorage.upgrade_cycleunit === "1"){
|
|
|
let price = (Number(sessionStorage.upgrade_cyclecount)*completeYear).toFixed(1);
|
|
@@ -1129,74 +1028,46 @@
|
|
|
|
|
|
//
|
|
|
$(".save_upgrade").on("click", function(){
|
|
|
+ if(nowRenew>36){
|
|
|
+ var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowRenew}个月`
|
|
|
+ weui.toast(overtimeWarning, {
|
|
|
+ duration: 3000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ callback: function() {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
$(".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 allAreaArr = allArea;
|
|
|
- let allIndustryArr = allIndustry;
|
|
|
- // if(allAreaArr["全国"]){
|
|
|
- // allAreaArr={};
|
|
|
- // }
|
|
|
- if(allIndustryArr.length==1&&allIndustryArr[0]=="全部行业"){
|
|
|
- allIndustryArr=[];
|
|
|
- }
|
|
|
- //
|
|
|
- let renew_time = $('.choose_item.lengthen .info').text();
|
|
|
- let times = "";
|
|
|
- if(renew_time !== "不延长"){
|
|
|
- times = $('.choose_item.lengthen .info').text();
|
|
|
- }
|
|
|
+ //
|
|
|
+ let allIndustryArr = allIndustry;
|
|
|
+ if(allArea["全国"]){
|
|
|
+ allArea={};
|
|
|
+ }
|
|
|
+ if(allIndustryArr.length==1&&allIndustryArr[0]=="全部行业"){
|
|
|
+ allIndustryArr=[];
|
|
|
+ }
|
|
|
+ //
|
|
|
+ let renew_time = $('.choose_item.lengthen .info').text();
|
|
|
+ let times = "";
|
|
|
+ if(renew_time !== "不延长"){
|
|
|
+ times = $('.choose_item.lengthen .info').text();
|
|
|
+ }
|
|
|
+ //
|
|
|
+ let vipCount = null;
|
|
|
+ if(sessionStorage.vipAddCount!==undefined&&sessionStorage.vipAddCount!==""){
|
|
|
+ vipCount = JSON.stringify(JSON.parse(sessionStorage.vipAddCount));
|
|
|
+ }
|
|
|
+ let vipIndustry = 0
|
|
|
+ if(sessionStorage.vipSubSelectIndustryAdd!==undefined&&sessionStorage.vipSubSelectIndustryAdd!==""){
|
|
|
+ let industrysArr = JSON.parse(sessionStorage.vipSubSelectIndustryAdd)
|
|
|
+ if(industrysArr.length==1&&industrysArr[0]=="全部行业"){
|
|
|
+ vipIndustry = -1;
|
|
|
+ }else{
|
|
|
+ vipIndustry = industrysArr.length;
|
|
|
+ }
|
|
|
+ }
|
|
|
//
|
|
|
- let vipCount = null;
|
|
|
- if(sessionStorage.vipAddCount!==undefined&&sessionStorage.vipAddCount!==""){
|
|
|
- vipCount = JSON.stringify(JSON.parse(sessionStorage.vipAddCount));
|
|
|
- }
|
|
|
- let vipIndustry = 0
|
|
|
- if(industrysArr!==null){
|
|
|
- if(industrysArr.length==1&&industrysArr[0]=="全部行业"){
|
|
|
- vipIndustry = -1;
|
|
|
- }else{
|
|
|
- vipIndustry = industrysArr.length;
|
|
|
- }
|
|
|
- }
|
|
|
- //
|
|
|
let payTypes = $(".weixin_pay").text();
|
|
|
let payType = "wx_app";
|
|
|
if(payTypes === "支付宝支付"){
|
|
@@ -1204,19 +1075,13 @@
|
|
|
}
|
|
|
//
|
|
|
var param = {
|
|
|
- "area": areas_arr,
|
|
|
- "industry": industryArr,
|
|
|
- "areas": JSON.stringify(areaarr),
|
|
|
- "areas_arr": areaArr,
|
|
|
- "industryarr": industryarr.join(","),
|
|
|
- // "allArea": JSON.stringify(allAreaArr),
|
|
|
"allIndustry": allIndustryArr.join(","),
|
|
|
- "allBuyArea": JSON.stringify(allBuyArea),
|
|
|
- "payWay": "wx_js",
|
|
|
+ "allBuyArea": JSON.stringify(allArea),
|
|
|
"pay_source" : "Upgrade",
|
|
|
"time": times,
|
|
|
"addCount":vipCount,
|
|
|
"addIndustryCount": vipIndustry,
|
|
|
+ "buyset":JSON.stringify(areaObj()),
|
|
|
"payWay": payType,
|
|
|
}
|
|
|
console.log(param)
|
|
@@ -1255,6 +1120,14 @@
|
|
|
sessionStorage.removeItem("vipAddCount");
|
|
|
sessionStorage.removeItem("vipSubSelectCity");
|
|
|
sessionStorage.removeItem("buyCheck");
|
|
|
+ sessionStorage.removeItem("buyIndustry");
|
|
|
+ sessionStorage.removeItem("addIndustry");
|
|
|
+ //
|
|
|
+ sessionStorage.removeItem("renew_cyclecount");
|
|
|
+ sessionStorage.removeItem("renew_cycleunit");
|
|
|
+ sessionStorage.removeItem("renew_price");
|
|
|
+ sessionStorage.removeItem("renew_finally_price");
|
|
|
+ sessionStorage.removeItem("buyChecks");
|
|
|
}
|
|
|
//
|
|
|
//校验是否支付
|
|
@@ -1292,47 +1165,58 @@
|
|
|
return false;
|
|
|
}
|
|
|
//
|
|
|
- function addAreaObj(){
|
|
|
- let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade)
|
|
|
- let buyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd)
|
|
|
- //
|
|
|
- let provinceArr = [];
|
|
|
- let areasObj = {};
|
|
|
- if(buyset.country === -1){
|
|
|
- areasObj["全国"] = [];
|
|
|
- }else{
|
|
|
- for(let province in areaObj){
|
|
|
- // console.log("666666",buyset.citys[province]);
|
|
|
- let cityLen = areaObj[province].length
|
|
|
- if(cityLen === 0){
|
|
|
- provinceArr.push(province);
|
|
|
- }else{
|
|
|
- let citys = areaObj[province];
|
|
|
- for(let i in buyset.city){
|
|
|
- let cityCount = buyset.city[i];
|
|
|
- if(province === i){
|
|
|
- if(cityLen > cityCount){
|
|
|
- let reduce = cityLen - cityCount;
|
|
|
- areasObj[province] = citys.slice(0, -reduce);
|
|
|
- }else{
|
|
|
- areasObj[province] = citys;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(provinceArr.length > buyset.province){
|
|
|
- let reduce = provinceArr.length - buyset.province;
|
|
|
- provinceArr = provinceArr.slice(0, -reduce);
|
|
|
+ function areaObj(){
|
|
|
+ let newbuyset = {}
|
|
|
+ let oldset = JSON.parse(JSON.stringify(oldBuyset))
|
|
|
+ newbuyset.areacount = oldset.areacount;
|
|
|
+ newbuyset.buyerclasscount = oldset.buyerclasscount;
|
|
|
+ newbuyset.citys = oldset.citys;
|
|
|
+ // let buyset = oldBuyset
|
|
|
+ console.log("11111",newbuyset)
|
|
|
+ if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
|
|
|
+ let addbuyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
|
|
|
+ if(addbuyset.country !== -1){
|
|
|
+ if(addbuyset.province !== 0){
|
|
|
+ newbuyset.areacount = newbuyset.areacount + addbuyset.province;
|
|
|
+ }
|
|
|
+ if(!checkObj(addbuyset.city)){
|
|
|
+ let cityArr = addbuyset.city
|
|
|
+ for(var i in cityArr){
|
|
|
+ let citysArr = newbuyset.citys
|
|
|
+ if(citysArr[i] !== undefined){
|
|
|
+ citysArr[i] = citysArr[i] + cityArr[i]
|
|
|
+ }else{
|
|
|
+ citysArr[i] = cityArr[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ newbuyset.areacount = -1;
|
|
|
+ newbuyset.citys = {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sessionStorage.vipSubSelectIndustryAdd!==undefined){
|
|
|
+ var addindustrys = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
|
|
|
+ if(addindustrys.length === 1 && addindustrys[0] === "全部行业"){
|
|
|
+ newbuyset.buyerclasscount = -1;
|
|
|
+ }else{
|
|
|
+ newbuyset.buyerclasscount = newbuyset.buyerclasscount + addindustrys.length;
|
|
|
}
|
|
|
- console.log(provinceArr)
|
|
|
- for(let a in provinceArr){
|
|
|
- let province = provinceArr[a];
|
|
|
- areasObj[province] = [];
|
|
|
+ }
|
|
|
+ console.log(JSON.stringify(newbuyset))
|
|
|
+ return newbuyset
|
|
|
+ }
|
|
|
+
|
|
|
+ function newBuysetObj(buyset){
|
|
|
+ let newset = JSON.parse(JSON.stringify(buyset));
|
|
|
+ for(let n in newset.citys){
|
|
|
+ if(newset.citys[n] > 2){
|
|
|
+ let cityarr = newset.citys
|
|
|
+ delete cityarr[n]
|
|
|
+ newset.areacount += 1
|
|
|
}
|
|
|
- console.log(areasObj)
|
|
|
}
|
|
|
- return areasObj
|
|
|
+ return newset
|
|
|
}
|
|
|
|
|
|
</script>
|