|
@@ -45,32 +45,16 @@
|
|
|
<li class="choose_item">
|
|
|
<a href="/jyapp/vipsubscribe/toChooseAreaUpgrade">
|
|
|
<span class="label">区域</span>
|
|
|
- <input type="text" id="area" value="" disabled placeholder="选择全国、省份、地市" class="info">
|
|
|
+ <input type="text" id="area" value="" disabled placeholder="选择升级区域" class="info">
|
|
|
<i class="iconfont icon-arrow"></i>
|
|
|
</a>
|
|
|
- <p class="add_tips area-list" style="display: none;">已新增 1 个省级区域、4 个地市</p>
|
|
|
</li>
|
|
|
<li class="choose_item">
|
|
|
<a href="/jyapp/vipsubscribe/toChooseIndustryUpgrade">
|
|
|
<span class="label">行业</span>
|
|
|
- <input type="text" id="buyerclass" disabled value="" placeholder="选择采购单位行业" class="info">
|
|
|
+ <input type="text" id="buyerclass" disabled value="" placeholder="选择升级行业" class="info">
|
|
|
<i class="iconfont icon-arrow"></i>
|
|
|
</a>
|
|
|
- <p class="add_tips industry-list" style="display: none;">已新增 2 个行业</p>
|
|
|
- </li>
|
|
|
- <!-- <li class="choose_item select_cycle">
|
|
|
- <a href="javascript:;">
|
|
|
- <span class="label">订阅周期</span>
|
|
|
- <input type="text" disabled value="" placeholder="选择年、月" class="info choose_time">
|
|
|
- <i class="iconfont icon-arrow choose_time"></i>
|
|
|
- </a>
|
|
|
- </li> -->
|
|
|
- <li class="choose_item choose_effect_date">
|
|
|
- <a href="javascript:;">
|
|
|
- <span class="label">生效日期</span>
|
|
|
- <span class="info" id="effect_date_name">立即生效,需支付当月费用差价</span>
|
|
|
- <i class="iconfont icon-arrow choose_time"></i>
|
|
|
- </a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul class="chooseList">
|
|
@@ -157,7 +141,6 @@
|
|
|
<div class="price">
|
|
|
<label>需补差价:</label>
|
|
|
<p>
|
|
|
- <!--<span class="old_price">¥610.80</span>-->
|
|
|
<strong class="finally_price">¥0.00</strong>
|
|
|
</p>
|
|
|
</div>
|
|
@@ -237,41 +220,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 选择生效日期 -->
|
|
|
- <div class="js_dialog effective_date" id="effective_date" style="display: none;">
|
|
|
- <div class="weui-mask"></div>
|
|
|
- <div class="box">
|
|
|
- <div class="box_hd">
|
|
|
- <span style="font-size:0.32rem;">生效日期</span>
|
|
|
- <h3></h3>
|
|
|
- <span class="cancel">取消</span>
|
|
|
- </div>
|
|
|
- <div class="box_bd">
|
|
|
- <div class="weui-cells weui-cells_checkbox choose-form">
|
|
|
- <label class="weui-cell weui-check__label now_label" for="nowTime">
|
|
|
- <div class="weui-cell__bd read">
|
|
|
- <p class="effective_name now">立即生效,需支付当月费用差价</p>
|
|
|
- <p class="effective_time nownow">2019.08.23 - 2020.06.06</p>
|
|
|
- </div>
|
|
|
- <div class="weui-cell__hd">
|
|
|
- <input type="radio" class="weui-check" name="date" value="立即生效,需支付当月费用差价" id="nowTime" checked />
|
|
|
- <i class="weui-icon-checked"></i>
|
|
|
- </div>
|
|
|
- </label>
|
|
|
- <label class="weui-cell weui-check__label next_label effect_next" for="nextMonth">
|
|
|
- <div class="weui-cell__bd read">
|
|
|
- <p class="effective_name notnow"></p>
|
|
|
- <p class="effective_time notnownow">2019.09.01 - 2020.06.06</p>
|
|
|
- </div>
|
|
|
- <div class="weui-cell__hd">
|
|
|
- <input type="radio" class="weui-check" name="date" value="" id="nextMonth" />
|
|
|
- <i class="weui-icon-checked"></i>
|
|
|
- </div>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<!-- 选择支付方式 -->
|
|
|
<div class="js_dialog pay_way" id="pay_way" style="display: none;">
|
|
|
<div class="weui-mask"></div>
|
|
@@ -308,7 +256,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js"></script>
|
|
|
- <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
|
|
|
<script src="/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
<script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}3"></script>
|
|
|
<script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
|
|
@@ -353,6 +300,16 @@
|
|
|
sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
|
|
|
}
|
|
|
}
|
|
|
+ if(sessionStorage.vipSubSelectIndustryAdd!==undefined&&sessionStorage.vipSubSelectIndustryAdd!==""){
|
|
|
+ if(checkObj(JSON.parse(sessionStorage.vipSubSelectIndustryAdd))){
|
|
|
+ sessionStorage.removeItem("vipSubSelectIndustryAdd");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
|
|
|
+ if(checkObj(JSON.parse(sessionStorage.vipSubSelectAreaAdd))){
|
|
|
+ sessionStorage.removeItem("vipSubSelectAreaAdd");
|
|
|
+ }
|
|
|
+ }
|
|
|
//
|
|
|
var monthPrice = "";
|
|
|
var yearPrice = "";
|
|
@@ -383,57 +340,7 @@
|
|
|
// console.log(checkValue);
|
|
|
$('.pay_way').hide(200);
|
|
|
$('.pay_mode .select_payment .choose_way.info').html(checkValue);
|
|
|
- });
|
|
|
- // 选择生效日期
|
|
|
-// $('.choose_effect_date > a').click(function () {
|
|
|
-// $('#effective_date').show(200);
|
|
|
-// var nowMonths = new Date().getMonth()+1;
|
|
|
-// var nowYears = new Date().getFullYear();
|
|
|
-// var as = nowMonths +1;
|
|
|
-// if(as > 12){
|
|
|
-// as = as-12;
|
|
|
-// nowYears = nowYears +1;
|
|
|
-// }
|
|
|
-// var bs = nowYears+"/"+as+"/1";
|
|
|
-// var effects = new Date(bs).getTime() /1000;
|
|
|
-// var a = nowYears+"."+as+".01";
|
|
|
-// $(".notnownow").text(a + " - " + endTime.replace(/-/g, "."))
|
|
|
-// if(ends < effects){
|
|
|
-// $(".effect_next").hide();
|
|
|
-//// $(".box").css("height", "2.7rem");
|
|
|
-// }
|
|
|
-// })
|
|
|
-// //
|
|
|
-// var effectiveName = new Date().getMonth()+2;
|
|
|
-// if(effectiveName > 12){
|
|
|
-// effectiveName = effectiveName - 12
|
|
|
-// }
|
|
|
-// var effectiveNames = effectiveName+"月1日生效"
|
|
|
-// $(".effective_name.notnow").text(effectiveNames);
|
|
|
-// $('#nextMonth').val(effectiveNames);
|
|
|
-//
|
|
|
-// // 对生效日期方式选择的input绑定点击事件
|
|
|
-// $('#effective_date input:radio[name="date"]').click(function () {
|
|
|
-// var checkValue = $('input:radio[name="date"]:checked').val();
|
|
|
-//// console.log(checkValue);
|
|
|
-// $('#effective_date').hide(200);
|
|
|
-// var effective = "";
|
|
|
-// var effectiveName = new Date().getMonth()+2;
|
|
|
-// if(effectiveName > 12){
|
|
|
-// effectiveName = effectiveName - 12
|
|
|
-// }
|
|
|
-// var effectiveNames = effectiveName+"月1日生效"
|
|
|
-// if(checkValue === "立即生效,需支付当月费用差价"){
|
|
|
-// effective = "now";
|
|
|
-// }else if(checkValue === effectiveNames){
|
|
|
-// effective = "notnow";
|
|
|
-// }
|
|
|
-// sessionStorage.effectiveDate = effective;
|
|
|
-// $('#effect_date_name').html(checkValue);
|
|
|
-// FinallyPrice();
|
|
|
-// });
|
|
|
-
|
|
|
-
|
|
|
+ });
|
|
|
// 选择周期
|
|
|
$('.lengthen > a').click(function () {
|
|
|
if((nowRenew)>=36){
|
|
@@ -457,17 +364,11 @@
|
|
|
// 按月订阅
|
|
|
$('.computed_price').show()
|
|
|
// 显示隐藏tips提示
|
|
|
- // $('#time_cycle .tips.monthly_tips').show();
|
|
|
- // $('#time_cycle .tips.yearly_tips').hide();
|
|
|
-
|
|
|
$('#number_box_month').addClass('active');
|
|
|
$('#number_box_year span').removeClass('active');
|
|
|
} else if($(e.target).hasClass('yearly')){
|
|
|
$('.computed_price').show()
|
|
|
// 按年订阅
|
|
|
- // $('#time_cycle .tips.yearly_tips').show();
|
|
|
- // $('#time_cycle .tips.monthly_tips').hide();
|
|
|
-
|
|
|
$('#number_box_month').removeClass('active');
|
|
|
}else{
|
|
|
$('.computed_price').hide()
|
|
@@ -538,11 +439,6 @@
|
|
|
$('.computed_price').html('¥' + price)
|
|
|
var firstButton = $('#number_box_month button:first')
|
|
|
var lastButton = $('#number_box_month button:last')
|
|
|
-// if (currentNum >= 10) {
|
|
|
-// $('.profit_tips').show()
|
|
|
-// } else {
|
|
|
-// $('.profit_tips').hide()
|
|
|
-// }
|
|
|
// 如果为操作后的结果为1,则锁定减号按钮
|
|
|
if (currentNum === data.numboxMin) {
|
|
|
firstButton.attr('disabled', true)
|
|
@@ -697,43 +593,24 @@
|
|
|
$("#buy").prop("checked", bCheck);
|
|
|
}
|
|
|
//新增区域
|
|
|
- if(sessionStorage.vipSubSelectAreaUpgrade!==""&&sessionStorage.vipSubSelectAreaUpgrade!==undefined){
|
|
|
- var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
|
|
|
- var provinceArr = [];
|
|
|
- var cityArr = [];
|
|
|
- var isAll = "";
|
|
|
- $(".area-list").show();
|
|
|
- for (var province in vipSubSelectArea){
|
|
|
- if(vipSubSelectArea[province].length > 0){
|
|
|
- var citys = vipSubSelectArea[province];
|
|
|
- for (var i in citys){
|
|
|
- var city = citys[i];
|
|
|
- cityArr.push(city);
|
|
|
- }
|
|
|
- }else{
|
|
|
- provinceArr.push(province);
|
|
|
- }
|
|
|
- if(province === "全国"){
|
|
|
- isAll = "all";
|
|
|
- }
|
|
|
- }
|
|
|
- var provinceLen = provinceArr.length;
|
|
|
- var cityLen = cityArr.length;
|
|
|
- if(isAll === ""){
|
|
|
- $(".area-list").text("已新增 "+ provinceLen +" 个省级区域、"+ cityLen +" 个地市");
|
|
|
+ if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""){
|
|
|
+ var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
|
|
|
+ let cityLen = sessionStorage.vipSubSelectCity;
|
|
|
+ if(vipSubSelectArea.country === -1){
|
|
|
+ areaHtml = "已新增全国";
|
|
|
+ $("#area").attr("placeholder", areaHtml);
|
|
|
}else{
|
|
|
- $(".area-list").text("已新增为 : 全国");
|
|
|
- }
|
|
|
- if(provinceLen === 0 && cityLen === 0){
|
|
|
- $(".area-list").hide();
|
|
|
+ areaHtml = "已新增 "+ vipSubSelectArea.province +" 个省级区域、"+ cityLen +" 个地市";
|
|
|
+ $("#area").attr("placeholder", areaHtml);
|
|
|
}
|
|
|
}
|
|
|
//新增行业
|
|
|
- if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
|
|
|
- var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
|
|
|
+ if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
|
|
|
+ var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
|
|
|
var industryArr = [];
|
|
|
var isAll = "";
|
|
|
- $(".industry-list").show();
|
|
|
+ var industryHtml = "";
|
|
|
+// $(".industry-list").show();
|
|
|
for(var i in vipSubSelectIndustry){
|
|
|
var industry = vipSubSelectIndustry[i];
|
|
|
industryArr.push(industry);
|
|
@@ -743,34 +620,17 @@
|
|
|
}
|
|
|
var industryLen = industryArr.length
|
|
|
if(isAll === ""){
|
|
|
- $(".industry-list").text("已新增 "+ industryLen +" 个行业");
|
|
|
+ industryHtml = "已新增 "+ industryLen +" 个行业";
|
|
|
+ $("#buyerclass").attr("placeholder", industryHtml);
|
|
|
}else{
|
|
|
- $(".industry-list").text("已新增为 : 全部行业");
|
|
|
+ industryHtml = "已新增全行业";
|
|
|
+ $("#buyerclass").attr("placeholder", industryHtml);
|
|
|
}
|
|
|
if(industryLen === 0){
|
|
|
- $(".industry-list").hide();
|
|
|
+ industryHtml = "选择升级行业";
|
|
|
+ $("#buyerclass").attr("placeholder", industryHtml);
|
|
|
}
|
|
|
}
|
|
|
- //生效时间
|
|
|
-// if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
|
|
|
-// var effective = sessionStorage.effectiveDate;
|
|
|
-// var effectiveHtml = "";
|
|
|
-// if(effective === "now"){
|
|
|
-// effectiveHtml = "立即生效,需支付当月费用差价";
|
|
|
-// }else if(effective === "notnow"){
|
|
|
-// var effectiveName = new Date().getMonth()+2;
|
|
|
-// if(effectiveName > 12){
|
|
|
-// effectiveName = effectiveName - 12
|
|
|
-// }
|
|
|
-// effectiveHtml = effectiveName+"月1日生效";
|
|
|
-// }
|
|
|
-// $(".effective_name").each(function(){
|
|
|
-// if($(this).text() === effectiveHtml){
|
|
|
-// $(this).parent().next().find("input").prop("checked", true);
|
|
|
-// }
|
|
|
-// })
|
|
|
-// $('#effect_date_name').html(effectiveHtml);
|
|
|
-// }
|
|
|
//支付方式
|
|
|
if(sessionStorage.payType!==""&&sessionStorage.payType!==undefined){
|
|
|
var payType = sessionStorage.payType;
|
|
@@ -823,6 +683,8 @@
|
|
|
//
|
|
|
var area = "";
|
|
|
var buyerclass = "";
|
|
|
+ var buyArea = "";
|
|
|
+ var buyIndustry = "";
|
|
|
var cycleunit = "";
|
|
|
var cyclecount = "";
|
|
|
var startTime = "";
|
|
@@ -831,57 +693,16 @@
|
|
|
var ends = "";
|
|
|
$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
|
|
|
if (data) {
|
|
|
- area = data.allarea;
|
|
|
- buyerclass = data.allindustry;
|
|
|
+ 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 areaArr = [];
|
|
|
-// var areaHtml = "";
|
|
|
-// var buyerclassArr = [];
|
|
|
-// var buyerclassHtml = "";
|
|
|
-// // var dateName = "";
|
|
|
-// // var dateHtml = "";
|
|
|
-// if (area !== "" && area !== undefined){
|
|
|
-// for(var province in area){
|
|
|
-// var citys = area[province]
|
|
|
-// // console.log(citys);
|
|
|
-// if(citys.length===0){
|
|
|
-// areaArr.push(province);
|
|
|
-// }else{
|
|
|
-// for(var i in citys){
|
|
|
-// areaArr.push(citys[i]);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// areaHtml = areaArr.toString().replace(/,/g, " ");
|
|
|
-// // $(".item_area .label_for").text(areaHtml);
|
|
|
-// if(checkObj(area)){
|
|
|
-// areaHtml = "全国";
|
|
|
-// }
|
|
|
-// $('#area').attr("placeholder",areaHtml);
|
|
|
-// }
|
|
|
-// if(buyerclass !== "" && buyerclass !== undefined){
|
|
|
-// for(var i in buyerclass){
|
|
|
-// var industry = buyerclass[i];
|
|
|
-// buyerclassArr.push(industry);
|
|
|
-// buyerclassHtml = buyerclassArr.toString().replace(/,/g, " ");
|
|
|
-// }
|
|
|
-// // $(".item_industry .label_for").text(buyerclassHtml);
|
|
|
-// if(checkObj(buyerclass)){
|
|
|
-// buyerclassHtml = "全行业";
|
|
|
-// }
|
|
|
-// $('#buyerclass').attr("placeholder",buyerclassHtml);
|
|
|
-// }
|
|
|
- //
|
|
|
-// var nowDate = data.now.replace(/-/g, ".");
|
|
|
-// var a = nowDate+ " - " +endTime;
|
|
|
-// $(".nownow").text(nowDate+ " - " +endTime.replace(/-/g, "."))
|
|
|
-
|
|
|
}
|
|
|
},false);
|
|
|
//
|
|
@@ -890,6 +711,7 @@
|
|
|
var oldYearPrice = 0;
|
|
|
var oldMonthPrice = 0;
|
|
|
var areasArr = {};
|
|
|
+ var areas_arr = {};
|
|
|
var industrysArr = [];
|
|
|
var allArea = {};
|
|
|
var allIndustry = [];
|
|
@@ -923,19 +745,16 @@
|
|
|
for(let province in vipArea){
|
|
|
let citys = vipArea[province];
|
|
|
if(citys.length===0){
|
|
|
- areasArr[province] = [];
|
|
|
+ areas_arr[province] = [];
|
|
|
}else{
|
|
|
- areasArr[province] = citys;
|
|
|
+ areas_arr[province] = citys;
|
|
|
}
|
|
|
}
|
|
|
for(let province in vipArea){
|
|
|
if(province === "全国"){
|
|
|
- areasArr = {"全国":[]};
|
|
|
+ areas_arr = {"全国":[]};
|
|
|
}
|
|
|
}
|
|
|
- if(buyCheck){
|
|
|
- $(".save_upgrade").removeAttr("disabled");
|
|
|
- }
|
|
|
if(area !== ""&&area !== undefined){
|
|
|
for(let province in area){
|
|
|
let citys = area[province];
|
|
@@ -974,11 +793,20 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
|
|
|
+ areasArr = addAreaObj();
|
|
|
+ }else{
|
|
|
+ areasArr = null;
|
|
|
+ }
|
|
|
+ if(buyCheck){
|
|
|
+ $(".save_upgrade").removeAttr("disabled");
|
|
|
+ }
|
|
|
}else{
|
|
|
- areasArr = null;
|
|
|
- if(area !== ""&&area !== undefined){
|
|
|
- for(let province in area){
|
|
|
- let citys = area[province];
|
|
|
+ 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{
|
|
@@ -987,63 +815,20 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// 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;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
+ //
|
|
|
+ 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);
|
|
@@ -1056,6 +841,12 @@
|
|
|
industrysArr = ["全部行业"];
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ industrysArr = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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];
|
|
@@ -1073,41 +864,14 @@
|
|
|
$(".save_upgrade").removeAttr("disabled");
|
|
|
}
|
|
|
}else{
|
|
|
- industrysArr = null;
|
|
|
- if(buyerclass!==""&&buyerclass!==undefined){
|
|
|
- for(let i in buyerclass){
|
|
|
- let industry = buyerclass[i];
|
|
|
+ if(buyIndustry!==""&&buyIndustry!==undefined){
|
|
|
+ for(let i in buyIndustry){
|
|
|
+ let industry = buyIndustry[i];
|
|
|
allIndustry.push(industry);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// 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; ) {
|
|
@@ -1128,16 +892,6 @@
|
|
|
}
|
|
|
|
|
|
console.log("industrysArr",industrysArr);
|
|
|
-// if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
|
|
|
-// let eff = sessionStorage.effectiveDate;
|
|
|
-// if(eff === "now"){
|
|
|
-// effect = "now";
|
|
|
-// }else{
|
|
|
-// effect = "notnow";
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// effect = "now";
|
|
|
-// }
|
|
|
//
|
|
|
if(endYear === nowYear){
|
|
|
if(endMonth === nowMonth){
|
|
@@ -1173,14 +927,6 @@
|
|
|
nowRenew = nowUpgrade;
|
|
|
console.log("monthold",nowUpgrade)
|
|
|
//
|
|
|
-// if(effect === "notnow"){
|
|
|
-// nowUpgrade = nowUpgrade -1;
|
|
|
-// }
|
|
|
-// if(nowUpgrade == 0){
|
|
|
-// nowUpgrade = 1;
|
|
|
-// }
|
|
|
-
|
|
|
- //
|
|
|
var nowUpgradeYear = 0;
|
|
|
if(nowUpgrade >= 12 && nowUpgrade < 24){
|
|
|
nowUpgradeYear = Math.floor(nowUpgrade / 12);
|
|
@@ -1197,8 +943,8 @@
|
|
|
console.log("month",nowUpgrade)
|
|
|
//
|
|
|
if (nowUpgradeYear >= 1) {
|
|
|
- let monthprice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
|
|
|
- let yearprice = getsubVipOrderPrice(area, buyerclass, [nowUpgradeYear, 1])
|
|
|
+ let monthprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
|
|
|
+ let yearprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgradeYear, 1])
|
|
|
oldPrice = yearprice + monthprice
|
|
|
if (monthprice == 0) {
|
|
|
oldMonthPrice = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
|
|
@@ -1208,7 +954,7 @@
|
|
|
oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
|
|
|
}
|
|
|
} else {
|
|
|
- oldPrice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
|
|
|
+ oldPrice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
|
|
|
oldMonthPrice = (oldPrice / nowUpgrade)
|
|
|
oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
|
|
|
}
|
|
@@ -1228,12 +974,12 @@
|
|
|
addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
}
|
|
|
if(areasArr !== null){
|
|
|
- oldAreaPriceY = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgradeYear,1]);
|
|
|
- oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
|
|
|
+ oldAreaPriceY = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgradeYear,1]);
|
|
|
+ oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
|
|
|
}
|
|
|
if(industrysArr !== null){
|
|
|
- addIndustryPriceY = getsubVipOrderPrice(area,industrysArr,[nowUpgradeYear,1]);
|
|
|
- addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
|
|
|
+ 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]);
|
|
@@ -1259,10 +1005,10 @@
|
|
|
addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
|
}
|
|
|
if(areasArr !== null){
|
|
|
- oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
|
|
|
+ oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
|
|
|
}
|
|
|
if(industrysArr !== null){
|
|
|
- addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
|
|
|
+ addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
|
|
|
}
|
|
|
let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
|
|
|
// price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
|
|
@@ -1285,6 +1031,9 @@
|
|
|
sessionStorage.upgrade_price = "¥"+price;
|
|
|
sessionStorage.proPrice = price;
|
|
|
}else if(sessionStorage.upgrade_cycleunit === "2"){
|
|
|
+ if(Number(sessionStorage.upgrade_cyclecount)>10){
|
|
|
+ sessionStorage.upgrade_cyclecount = 10;
|
|
|
+ }
|
|
|
let price = (Number(sessionStorage.upgrade_cyclecount)*completeMonth).toFixed(1);
|
|
|
sessionStorage.upgrade_price = "¥"+price;
|
|
|
sessionStorage.proPrice = price;
|
|
@@ -1300,10 +1049,7 @@
|
|
|
console.log("proprice",proPrice);
|
|
|
cPrice = (Number(cPrice) + Number(proPrice)).toFixed(1);
|
|
|
}
|
|
|
-// if(effect === "notnow"){
|
|
|
-// cPrice = cPrice -(completeMonth - oldMonthPrice);
|
|
|
-// }
|
|
|
- if(cPrice < 0){
|
|
|
+ if(cPrice <= 0){
|
|
|
cPrice = 0;
|
|
|
}
|
|
|
$(".finally_price").html("¥"+cPrice);
|
|
@@ -1325,20 +1071,7 @@
|
|
|
|
|
|
//
|
|
|
$(".save_upgrade").on("click", function(){
|
|
|
- $(".save_upgrade").attr("disabled","disabled")
|
|
|
-// let effective = $("#effect_date_name").text();
|
|
|
-// var effect = "now";
|
|
|
-// if(effective !== "立即生效,需支付当月费用差价"){
|
|
|
-// let nowMonth = new Date().getMonth()+1;
|
|
|
-// let nowYear = new Date().getFullYear();
|
|
|
-// let a = nowMonth +1
|
|
|
-// if(a > 12){
|
|
|
-// a = a-12;
|
|
|
-// nowYear = nowYear +1;
|
|
|
-// }
|
|
|
-// let b = nowYear+"/"+a+"/1";
|
|
|
-// effect = new Date(b).getTime() /1000;
|
|
|
-// }
|
|
|
+ $(".save_upgrade").attr("disabled","disabled");
|
|
|
//
|
|
|
let areas = areasArr;
|
|
|
let industrys = null;
|
|
@@ -1363,9 +1096,18 @@
|
|
|
}else{
|
|
|
industryArr = "no";
|
|
|
}
|
|
|
+ //
|
|
|
+ if(areas_arr !== null){
|
|
|
+ if(areas_arr["全国"]){
|
|
|
+ areas_arr={};
|
|
|
+ }
|
|
|
+ areas_arr = JSON.stringify(areas_arr);
|
|
|
+ }else{
|
|
|
+ areas_arr = "no";
|
|
|
+ }
|
|
|
//
|
|
|
- let areaarr = area;
|
|
|
- let industryarr = buyerclass;
|
|
|
+ let areaarr = buyArea;
|
|
|
+ let industryarr = buyIndustry;
|
|
|
let allAreaArr = allArea;
|
|
|
let allIndustryArr = allIndustry;
|
|
|
if(allAreaArr["全国"]){
|
|
@@ -1381,6 +1123,19 @@
|
|
|
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(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 === "支付宝支付"){
|
|
@@ -1388,17 +1143,19 @@
|
|
|
}
|
|
|
//
|
|
|
var param = {
|
|
|
- "area": areaArr,
|
|
|
+ "area": areas_arr,
|
|
|
"industry": industryArr,
|
|
|
"areas": JSON.stringify(areaarr),
|
|
|
+ "areas_arr": areaArr,
|
|
|
"industryarr": industryarr.join(","),
|
|
|
"allArea": JSON.stringify(allAreaArr),
|
|
|
"allIndustry": allIndustryArr.join(","),
|
|
|
- "payWay": payType,
|
|
|
-// "effect": effect,
|
|
|
+ "payWay": "wx_js",
|
|
|
"pay_source" : "Upgrade",
|
|
|
"time": times,
|
|
|
-// "nowUp": Number(nowRenew),
|
|
|
+ "addCount":vipCount,
|
|
|
+ "addIndustryCount": vipIndustry,
|
|
|
+ "payWay": payType,
|
|
|
}
|
|
|
console.log(param)
|
|
|
$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder", param, function (r) {
|
|
@@ -1432,7 +1189,9 @@
|
|
|
sessionStorage.removeItem("vipSubSelectAreaUpgrade");
|
|
|
sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
|
|
|
sessionStorage.removeItem("vipSubSelectIndustryAdd");
|
|
|
-// sessionStorage.removeItem("effectiveDate");
|
|
|
+ sessionStorage.removeItem("vipSubSelectAreaAdd");
|
|
|
+ sessionStorage.removeItem("vipAddCount");
|
|
|
+ sessionStorage.removeItem("vipSubSelectCity");
|
|
|
sessionStorage.removeItem("buyCheck");
|
|
|
}
|
|
|
//
|
|
@@ -1465,6 +1224,47 @@
|
|
|
}
|
|
|
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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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>
|