|
@@ -37,7 +37,9 @@
|
|
|
::-webkit-input-placeholder{
|
|
|
color: #000;
|
|
|
}
|
|
|
-
|
|
|
+ .weui-check__label:active {
|
|
|
+ background-color: #fff!important;
|
|
|
+ }
|
|
|
</style>
|
|
|
<body class="no-touch">
|
|
|
<div class="vip_update">
|
|
@@ -393,6 +395,9 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if($(".month_number").text() === "1"){
|
|
|
+ $('#number_box_month button:first').attr('disabled', true);
|
|
|
+ }
|
|
|
$('#time_cycle').show(200);
|
|
|
})
|
|
|
// 对订阅时间选择的 input绑定点击事件
|
|
@@ -857,17 +862,17 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
|
|
|
- areasArr = addAreaObj();
|
|
|
- }else{
|
|
|
- areasArr = null;
|
|
|
- }
|
|
|
+ // if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
|
|
|
+ // areasArr = addAreaObj();
|
|
|
+ // }else{
|
|
|
+ // areasArr = null;
|
|
|
+ // }
|
|
|
if(buyCheck){
|
|
|
$(".save_upgrade").removeAttr("disabled");
|
|
|
}
|
|
|
}else{
|
|
|
areas_arr = null
|
|
|
- areasArr = null
|
|
|
+ // areasArr = null
|
|
|
if(buyArea !== ""&&buyArea !== undefined){
|
|
|
// for(let province in buyArea){
|
|
|
// let citys = buyArea[province];
|
|
@@ -902,20 +907,20 @@
|
|
|
// }
|
|
|
//
|
|
|
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.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);
|
|
@@ -944,16 +949,16 @@
|
|
|
}
|
|
|
}
|
|
|
//
|
|
|
- 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++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // 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]){
|
|
@@ -1035,32 +1040,34 @@
|
|
|
|
|
|
//
|
|
|
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 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]);
|
|
|
+ // }
|
|
|
+ // 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]);
|
|
|
-// price = yearprice + monthprice;
|
|
|
- price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
|
|
|
-// let yearprice = addAreaPriceY + oldAreaPriceY + addIndustryPriceY;
|
|
|
-// let monthprice = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
+ price = newPriceY + newPriceM - oldPrice;
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
if(monthprice === 0){
|
|
|
completeMonth = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
|
|
|
completeYear = (yearprice / nowUpgradeYear).toFixed(1);
|
|
@@ -1068,28 +1075,36 @@
|
|
|
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 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]);
|
|
|
+ // }
|
|
|
+ // price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
+ // // ------- 升级价格交叉计算 ---------
|
|
|
let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
-// price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
- price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
|
|
|
+
|
|
|
+ // ------- 升级价格差价计算 ---------
|
|
|
+ let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
|
|
|
+ price = newPrice - oldPrice;
|
|
|
+ // ------- 升级价格差价计算 ---------
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
completeMonth = (monthprice / nowUpgrade).toFixed(1);
|
|
|
completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
|
|
|
+ // ------- 升级延长周期价格计算 ---------
|
|
|
console.log("<1",price)
|
|
|
}
|
|
|
|
|
@@ -1100,6 +1115,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);
|
|
@@ -1148,38 +1164,38 @@
|
|
|
$(".save_upgrade").on("click", function(){
|
|
|
$(".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";
|
|
|
- }
|
|
|
+ // 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(areas_arr !== null){
|
|
|
+ // if(areas_arr["全国"]){
|
|
|
+ // areas_arr={};
|
|
|
+ // }
|
|
|
+ // areas_arr = JSON.stringify(areas_arr);
|
|
|
+ // }else{
|
|
|
+ // areas_arr = "no";
|
|
|
+ // }
|
|
|
if(allBuyArea["全国"]){
|
|
|
allBuyArea={};
|
|
|
}
|
|
@@ -1215,10 +1231,10 @@
|
|
|
}
|
|
|
//
|
|
|
var param = {
|
|
|
- "area": areas_arr,
|
|
|
- "industry": industryArr,
|
|
|
+ // "area": areas_arr,
|
|
|
+ // "industry": industryArr,
|
|
|
"areas": JSON.stringify(areaarr),
|
|
|
- "areas_arr": areaArr,
|
|
|
+ // "areas_arr": areaArr,
|
|
|
"industryarr": industryarr.join(","),
|
|
|
// "allArea": JSON.stringify(allAreaArr),
|
|
|
"allIndustry": allIndustryArr.join(","),
|
|
@@ -1267,48 +1283,48 @@
|
|
|
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);
|
|
|
- }
|
|
|
- console.log(provinceArr)
|
|
|
- for(let a in provinceArr){
|
|
|
- let province = provinceArr[a];
|
|
|
- areasObj[province] = [];
|
|
|
- }
|
|
|
- console.log(areasObj)
|
|
|
- }
|
|
|
- return areasObj
|
|
|
- }
|
|
|
+ // 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);
|
|
|
+ // }
|
|
|
+ // console.log(provinceArr)
|
|
|
+ // for(let a in provinceArr){
|
|
|
+ // let province = provinceArr[a];
|
|
|
+ // areasObj[province] = [];
|
|
|
+ // }
|
|
|
+ // console.log(areasObj)
|
|
|
+ // }
|
|
|
+ // return areasObj
|
|
|
+ // }
|
|
|
|
|
|
</script>
|
|
|
</body>
|