|
@@ -574,7 +574,7 @@
|
|
|
if (checkOrder_bl){
|
|
|
return;
|
|
|
}*/
|
|
|
- window.location.href="/jyapp/vipsubscribe/renewPayPage?orderCode="+orderCode;
|
|
|
+ window.location.href="/jyapp/vipsubscribe/vipsubscribe_renew?orderCode="+orderCode;
|
|
|
}else if (pattern==2){
|
|
|
window.location.href="/jyapp/vipsubscribe/vipsubscribe_new?orderCode="+orderCode;
|
|
|
}
|
|
@@ -582,6 +582,9 @@
|
|
|
|
|
|
//删除订单
|
|
|
function deleteOrder(id,obj,cancel) {
|
|
|
+ if (getParam("active")){
|
|
|
+ typ=getParam("active");
|
|
|
+ }
|
|
|
$.confirm({
|
|
|
title: '提示信息',
|
|
|
content: '确定删除订单?',
|
|
@@ -590,13 +593,14 @@
|
|
|
text: '确定',
|
|
|
btnClass: 'btn-primary-0',
|
|
|
action: function() {
|
|
|
+ $(".loading_").show();
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: "/subscribepay/orderListDetails/deleteOrder",
|
|
|
data: {"id":id,"pageNum":pageIndex,"type":typ},
|
|
|
dataType: 'json',
|
|
|
success: function(data){
|
|
|
- console.log(data)
|
|
|
+ $(".loading_").hide();
|
|
|
if(data && data["success"]){
|
|
|
var self = $(obj).parent().parent();
|
|
|
var parent = self.parent();
|
|
@@ -622,6 +626,7 @@
|
|
|
text: '确定',
|
|
|
btnClass: 'btn-primary-2',
|
|
|
action: function() {
|
|
|
+ $(".loading_").show();
|
|
|
if(parent.children("div").length<10){
|
|
|
$(".dropload-refresh").text("没有更多了");
|
|
|
}
|
|
@@ -634,122 +639,11 @@
|
|
|
$(".card_lists").append(nodataHtml);
|
|
|
$(".dropload-down").hide();
|
|
|
}else{//删除一条数据 往后铺一条数据
|
|
|
- /*
|
|
|
- var listhtml=""
|
|
|
- var oneD=data.res;
|
|
|
- for(var index in oneD){
|
|
|
- var obj=oneD[index];
|
|
|
- count++;
|
|
|
- var id = obj.id;
|
|
|
- //订单编号
|
|
|
- var orderCode = obj.order_code;
|
|
|
- //创建时间
|
|
|
- var createTime=obj.create_time;
|
|
|
- createTime=createTime.replace(/-/g,".")
|
|
|
- //选择时间
|
|
|
- var publishTime = obj.filter_publishtime;
|
|
|
- if(!publishTime){
|
|
|
- publishTime = "全部";
|
|
|
- }else{
|
|
|
- if(publishTime.length==11){
|
|
|
- if(publishTime.slice(0,1)!="_"){
|
|
|
- var publishtime_=publishTime.slice(0,10);
|
|
|
- publishTime=timestampToTime(publishtime_);
|
|
|
- publishTime=publishTime+"-";
|
|
|
- }else{
|
|
|
- var publishtime_=publishTime.slice(1,11);
|
|
|
- publishTime=timestampToTime(publishtime_);
|
|
|
- publishTime=publishTime+"前全部";
|
|
|
- }
|
|
|
- }else{
|
|
|
- //publishTime= publishTime.replace(/\./g,"/")
|
|
|
- }
|
|
|
- }
|
|
|
- //1标准字段包 2高级字段包
|
|
|
- var spec = obj.data_spec;
|
|
|
- if(spec=="标准字段包"){
|
|
|
- spec_=1;
|
|
|
- }else if(spec =="高级字段包"){
|
|
|
- spec_=2;
|
|
|
- }
|
|
|
- //订单状态 0待支付 1已完成 -1删除
|
|
|
- var orderStatus = obj.order_status;
|
|
|
- if(orderStatus==0){
|
|
|
- orderStatus="待付款"
|
|
|
- orderHtml=""
|
|
|
- orderHtml+='<span class="status notpay">'+orderStatus+'</span>'
|
|
|
- orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id +",this)\"></a>";
|
|
|
- iconHtml=""
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'<a class="btn cancle" onclick="cancelOrder('+id+',this,)">取消订单</a>'
|
|
|
- +'<a class="btn pay_" onclick="choosePayWay(\''+orderMoney+'\','+spec_+',"'+obj.filter_id+'",this)" >去支付</a>'
|
|
|
- +'</div>'
|
|
|
- }else if(orderStatus==1){
|
|
|
- orderStatus="已完成";
|
|
|
- orderHtml=""
|
|
|
- orderHtml+='<span class="status">'+orderStatus+'</span>'
|
|
|
- iconHtml=""
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'<a href="/jyapp/front/dataExport/toSieve" class="btn cancle">再次购买</a>'
|
|
|
- +'</div>'
|
|
|
- }
|
|
|
- //订单总数
|
|
|
- var data_count=obj.data_count;
|
|
|
- //订单金额
|
|
|
- var orderMoney = obj.order_money;
|
|
|
- //金额格式化 小数点前 1,000
|
|
|
- orderMoney=orderMoney+"";
|
|
|
- orderMoney_1=toThousands(orderMoney.split(".")[0]);
|
|
|
- orderMoney_2=orderMoney.split(".")[1];
|
|
|
- if(orderMoney_2){
|
|
|
- orderMoney=orderMoney_1+"."+orderMoney_2;
|
|
|
- }else{
|
|
|
- orderMoney=orderMoney_1;
|
|
|
- }
|
|
|
- //
|
|
|
- var token = obj.token;
|
|
|
- //关键词
|
|
|
- if(obj.filter_keys && obj.filter_keys.split(",").length>0){
|
|
|
- var keysHtml="";
|
|
|
- var keysArr = obj.filter_keys.split(",");
|
|
|
- var keysLen = keysArr.length;for(var j=0;j<keysLen;j++){
|
|
|
- keysHtml += "<span>" + keysArr[j] + " </span>";
|
|
|
- }
|
|
|
- }else{
|
|
|
- keysHtml=""
|
|
|
- }
|
|
|
-
|
|
|
- listhtml+='<div class="card">'
|
|
|
- +'<div class="card-header">'
|
|
|
- +'<span class="time">'+createTime+'</span>'
|
|
|
- +orderHtml
|
|
|
- +'</div>'
|
|
|
- +'<div class="card-content">'
|
|
|
- +'<a eid='+orderCode+' class="media">'
|
|
|
- +'<div class="media-img">'
|
|
|
- +'<img src="/jyapp/images/myorder/historical_data.png">'
|
|
|
- +'</div>'
|
|
|
- +'<div class="media-info">'
|
|
|
- +'<p class="item-ifo ellipsis">关键词:'+ keysHtml+'</p>'
|
|
|
- +'<p class="item-ifo ellipsis">数据量:'+ data_count +'条</p>'
|
|
|
- +'<p class="item-ifo ellipsis">数据规格:'+spec+'</p>'
|
|
|
- +'<p class="item-ifo ellipsis">筛选日期:'+publishTime+'</p>'
|
|
|
- +'</div>'
|
|
|
- +'</a>'
|
|
|
- +'<div class="price">'
|
|
|
- +'<strong class="current">¥'+orderMoney+'</strong>'
|
|
|
- +'</div>'
|
|
|
- +'</div>'
|
|
|
- +iconHtml
|
|
|
- +'</div>'
|
|
|
-
|
|
|
- }
|
|
|
- */
|
|
|
structureHtml(data.res);
|
|
|
//删除完成后补的订单仍可点击
|
|
|
//appendList($(listhtml))
|
|
|
}
|
|
|
-
|
|
|
+ $(".loading_").hide();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -776,6 +670,9 @@
|
|
|
//-------------------------------------------------
|
|
|
//取消订单
|
|
|
function cancelOrder(id,obj) {
|
|
|
+ if (getParam("active")){
|
|
|
+ typ=getParam("active");
|
|
|
+ }
|
|
|
$.confirm({
|
|
|
title: '提示信息',
|
|
|
content: '确定取消订单?',
|
|
@@ -784,12 +681,14 @@
|
|
|
text: '确定',
|
|
|
btnClass: 'btn-primary-0',
|
|
|
action: function() {
|
|
|
+ $(".loading_").show();
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: "/subscribepay/orderListDetails/deleteOrder",
|
|
|
data: {"id":id,"pageNum":pageIndex,"type":typ,"cancel":"cancel"},
|
|
|
dataType: 'json',
|
|
|
success: function(data){
|
|
|
+ $(".loading_").hide();
|
|
|
if(data && data["success"]){
|
|
|
$.alert({
|
|
|
title:"提示信息",
|
|
@@ -799,6 +698,7 @@
|
|
|
text: '确定',
|
|
|
btnClass: 'btn-primary-2',
|
|
|
action: function() {
|
|
|
+ $(".loading_").show();
|
|
|
if (typ==1){
|
|
|
var self = $(obj).parent().parent();
|
|
|
self.remove();
|
|
@@ -823,13 +723,22 @@
|
|
|
$(".card_lists").empty();
|
|
|
queryOrder($("ul .active").index(),10);
|
|
|
}
|
|
|
-
|
|
|
+ if($(".card_lists").children("div").length==0){
|
|
|
+ nodataHtml=""
|
|
|
+ nodataHtml+='<div style="text-align:center;">';
|
|
|
+ //nodataHtml+='<div style="display:flex;justify-content:center;align-items: center;">';
|
|
|
+ nodataHtml+='<img src="/jyapp/images/myorder/fish.png" style="width: 2.8rem;height: 2.8rem;margin-top: 45%;">'
|
|
|
+ nodataHtml+='<div style="color: #888;font-size: .32rem;text-align:center;">暂无数据</div></div>'
|
|
|
+ $(".card_lists").append(nodataHtml);
|
|
|
+ $(".dropload-down").hide();
|
|
|
+ }
|
|
|
+ $(".loading_").hide();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}else{
|
|
|
- alertS("删除失败,请联系管理员!");
|
|
|
+ alertS("取消失败,请联系管理员!");
|
|
|
}
|
|
|
},
|
|
|
error: function(xhr, type){
|
|
@@ -889,19 +798,26 @@
|
|
|
/* 选择支付方式*/
|
|
|
$('input:radio[name="way"]').click(function() {
|
|
|
var checkValue = $('input:radio[name="way"]:checked').val();
|
|
|
+ var order_code_vip=$(".order_code_vip").text();
|
|
|
if(checkValue=="微信支付"){
|
|
|
localStorage.setItem($(".param_id").text(),"wx");
|
|
|
+ if(order_code_vip){
|
|
|
+ localStorage.setItem(order_code_vip,"wx");
|
|
|
+ }
|
|
|
$("#wx").prop("checked",true);
|
|
|
$("#zfb").prop("checked",false);
|
|
|
pay_way="wx_app";
|
|
|
}else{
|
|
|
localStorage.setItem($(".param_id").text(),"ali");
|
|
|
+ if(order_code_vip){
|
|
|
+ localStorage.setItem(order_code_vip,"ali");
|
|
|
+ }
|
|
|
$("#wx").prop("checked",false);
|
|
|
$("#zfb").prop("checked",true);
|
|
|
pay_way="ali_app";
|
|
|
}
|
|
|
});
|
|
|
- var canpay=true;
|
|
|
+ // var canpay=true;
|
|
|
//确认支付
|
|
|
$(".surePay").on("click", function() {
|
|
|
$(".loading_").show();
|
|
@@ -909,21 +825,24 @@
|
|
|
var order_code_vip=$(".order_code_vip").html();
|
|
|
//vip支付;
|
|
|
if (order_code_vip!=""){
|
|
|
- var orderCode =$(".media").attr("eid");
|
|
|
- if(!canpay)return
|
|
|
- canpay=false;
|
|
|
+ var orderCode =order_code_vip;
|
|
|
+ // if(!canpay)return
|
|
|
+ // canpay=false;
|
|
|
$.post("/subscribepay/vipsubscribe/orderToPay",{"orderCode":orderCode,"pay_way":pay_way},function(r){
|
|
|
if(r.success){
|
|
|
if(pay_way=="wx_app"){
|
|
|
- JyObj.wxPay(r.data.res);
|
|
|
+ JyObj.wxPay(r.data.res);
|
|
|
+ $(".loading_").hide();
|
|
|
}else{
|
|
|
- JyObj.aliPay(r.data.res);
|
|
|
+ JyObj.aliPay(r.data.res);
|
|
|
+ $(".loading_").hide();
|
|
|
}
|
|
|
$('.pay_way').hide(200)
|
|
|
- checkPaySuccess_vip(data.order);
|
|
|
- }else{
|
|
|
+ checkPaySuccess_vip(orderCode);
|
|
|
+ }/*else{
|
|
|
canpay=true;
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ $(".loading_").hide();
|
|
|
})
|
|
|
}else{ //移动端数据导出支付;
|
|
|
//canpay = false;
|
|
@@ -984,6 +903,7 @@
|
|
|
|
|
|
var interval_vip
|
|
|
//支付完成跳转 VIP订单
|
|
|
+ /*
|
|
|
function checkPaySuccess_vip(order_vipcode){
|
|
|
if(interval_vip){
|
|
|
clearInterval(interval_vip)
|
|
@@ -1001,6 +921,33 @@
|
|
|
},3000)
|
|
|
$(".loading_").hide();
|
|
|
}
|
|
|
+ */
|
|
|
+ //支付完成跳转 VIP订单
|
|
|
+ function checkPaySuccess_vip(order_vipcode){
|
|
|
+ if(interval_vip){
|
|
|
+ clearInterval(interval_vip)
|
|
|
+ }
|
|
|
+ $(".loading_").show();
|
|
|
+ interval_vip=setInterval(function(){
|
|
|
+ $.post("/jypay/isPaySuccess",{code:order_vipcode},function(r){
|
|
|
+ if(r.success){
|
|
|
+ $(".loading_").show();
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".loading_").hide();
|
|
|
+ setSessionStorage();
|
|
|
+ try{
|
|
|
+ JyObj.checkLab()//刷新搜索首页和订阅首页
|
|
|
+ sessionStorage.reloadHomePage = true;
|
|
|
+ sessionStorage.reloadSubPage = true;
|
|
|
+ }catch(e){}
|
|
|
+ window.location.href="/jyapp/vipsubscribe/toPaySuccessPage?orderCode="+order_vipcode;
|
|
|
+ clearInterval(interval_vip);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },3000)
|
|
|
+ $(".loading_").hide();
|
|
|
+ }
|
|
|
|
|
|
function getParam(pname) {
|
|
|
var params = location.search.substr(1);
|
|
@@ -1150,6 +1097,7 @@
|
|
|
//选择
|
|
|
function choosePayWay(orderMoney,param_dataType,param_id,e){
|
|
|
$(".pay_way").show();
|
|
|
+ $(".order_code_vip").text("");
|
|
|
$(".money_pay").text("¥"+orderMoney);
|
|
|
$(".param_dataType").text(param_dataType);
|
|
|
$(".param_id").text(param_id);
|
|
@@ -1170,14 +1118,30 @@
|
|
|
this_e=e;
|
|
|
}
|
|
|
//vip付款 弹窗
|
|
|
- function choosePayWay_vip(orderMoney,orderCode,e){
|
|
|
+ function choosePayWay_vip(orderMoney,orderCode,e,way){
|
|
|
$(".pay_way").show();
|
|
|
$(".money_pay").text("¥"+orderMoney);
|
|
|
$(".order_code_vip").text(orderCode);
|
|
|
-
|
|
|
- $("#wx").prop("checked",true);
|
|
|
- $("#zfb").prop("checked",false);
|
|
|
- pay_way="wx_app";
|
|
|
+ if(localStorage.getItem(orderCode)=="wx"){
|
|
|
+ $("#wx").prop("checked",true);
|
|
|
+ $("#zfb").prop("checked",false);
|
|
|
+ pay_way="wx_app";
|
|
|
+ }else if(localStorage.getItem(orderCode)=="ali"){
|
|
|
+ pay_way="ali_app";
|
|
|
+ $("#zfb").prop("checked",true);
|
|
|
+ $("#wx").prop("checked",false);
|
|
|
+ }else{
|
|
|
+ //没有缓存取 生成订单时的购买方式
|
|
|
+ if(way.indexOf("wx")!=-1){
|
|
|
+ $("#wx").prop("checked",true);
|
|
|
+ $("#zfb").prop("checked",false);
|
|
|
+ pay_way="wx_app";
|
|
|
+ }else{
|
|
|
+ $("#wx").prop("checked",false);
|
|
|
+ $("#zfb").prop("checked",true);
|
|
|
+ pay_way="ali_app";
|
|
|
+ }
|
|
|
+ }
|
|
|
this_e=e;
|
|
|
}
|
|
|
|
|
@@ -1350,152 +1314,268 @@
|
|
|
+'</div>'
|
|
|
|
|
|
}else if(obj.product_type=="VIP订阅"){
|
|
|
+ if(typ==1){ //待付款订单列表页
|
|
|
+ if(obj.order_status==-2){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
count++;
|
|
|
var id_vip = obj.id;
|
|
|
//订单编号
|
|
|
- var orderCode_vip = obj.order_code;
|
|
|
- //创建时间
|
|
|
- var createTime_vip=obj.create_time;
|
|
|
- createTime_vip =createTime_vip.replace(/-/g,".")
|
|
|
- //筛选条件
|
|
|
- var filter_vip = JSON.parse(obj.filter);
|
|
|
- //地区
|
|
|
- var region_vipArr = filter_vip.area;
|
|
|
- var region_vip=""
|
|
|
- var province_length=0;
|
|
|
- var city_length=0;
|
|
|
- var vip_type=obj.vip_type;
|
|
|
- if (vip_type!=2){
|
|
|
- if(JSON.stringify(region_vipArr) != JSON.stringify({})){
|
|
|
- for(i in region_vipArr){
|
|
|
- if(region_vipArr[i].length==0){
|
|
|
- province_length++;
|
|
|
+ var orderCode_vip = obj.order_code;
|
|
|
+ //创建时间
|
|
|
+ var createTime_vip=obj.create_time;
|
|
|
+ createTime_vip =createTime_vip.replace(/-/g,".")
|
|
|
+ //筛选条件
|
|
|
+ var filter_vip = JSON.parse(obj.filter);
|
|
|
+ //判断该订单是否是升级订单
|
|
|
+ var vip_type = obj.vip_type;
|
|
|
+ //升级续费逻辑修改后的判断条件
|
|
|
+ var newbuyset= filter_vip.newBuyset;
|
|
|
+ var region_vip=""
|
|
|
+ var industry_vip=""
|
|
|
+ if ((vip_type != 2)&&(vip_type!=1)){
|
|
|
+ //地区
|
|
|
+ var region_vipArr = filter_vip.area;
|
|
|
+ var province_length=0;
|
|
|
+ var city_length=0;
|
|
|
+ if (!$.isEmptyObject(newbuyset)){
|
|
|
+ var val=getnewbuyset(newbuyset);
|
|
|
+ region_vip=val[0];
|
|
|
+ industry_vip=val[1];
|
|
|
+ }else{
|
|
|
+ if(JSON.stringify(region_vipArr) != JSON.stringify({})){
|
|
|
+ for(i in region_vipArr){
|
|
|
+ if(region_vipArr[i].length==0){
|
|
|
+ province_length++;
|
|
|
+ }else{
|
|
|
+ city_length+=region_vipArr[i].length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ region_vip="全国";
|
|
|
+ }
|
|
|
+ if((province_length!=0)&&(city_length!=0)){
|
|
|
+ region_vip=province_length+"个省级区域、"+city_length+"个地市";
|
|
|
+ }else if((province_length==0)&&(city_length!=0)){
|
|
|
+ region_vip=city_length+"个地市";
|
|
|
+ }else if((province_length!=0)&&(city_length==0)){
|
|
|
+ region_vip=province_length+"个省级区域";
|
|
|
+ }
|
|
|
+ //行业
|
|
|
+ var industry_vip = filter_vip.industry.length; //数组
|
|
|
+ if(industry_vip==0){
|
|
|
+ industry_vip="全行业";
|
|
|
+ }else{
|
|
|
+ industry_vip=industry_vip+"个行业";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var cyclecount_vip = filter_vip.cyclecount; //时长
|
|
|
+ var cycleunit_vip = filter_vip.cycleunit;//单位 1:年 2:月 3:天
|
|
|
+ //订阅周期
|
|
|
+ var effectiveduration_vip=""
|
|
|
+ if((obj.vip_starttime!=undefined)&&(obj.vip_endtime!=undefined)){
|
|
|
+ var start_time_vip = obj.vip_starttime;
|
|
|
+ var end_time_vip = obj.vip_endtime;
|
|
|
+ var start_time_arr = start_time_vip.split(" ")[0].split("-")
|
|
|
+ var end_time_arr = end_time_vip.split(" ")[0].split("-")
|
|
|
+ var start_year=start_time_arr[0];
|
|
|
+ var start_month=start_time_arr[1];
|
|
|
+ var end_year=end_time_arr[0];
|
|
|
+ var end_month=end_time_arr[1];
|
|
|
+
|
|
|
+ var year = 0;
|
|
|
+ var month = 0;
|
|
|
+ if(end_year > start_year){
|
|
|
+ if(end_month > start_month){
|
|
|
+ year = end_year - start_year;
|
|
|
+ month = end_month - start_month;
|
|
|
}else{
|
|
|
- city_length+=region_vipArr[i].length;
|
|
|
+ year = end_year - start_year-1;
|
|
|
+ month = 12+Number(end_month)-start_month;
|
|
|
+ if (month==12){
|
|
|
+ year=Number(year)+1;
|
|
|
+ month=0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(end_year == start_year){
|
|
|
+ month = end_month - start_month;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(year != 0 && month !=0){
|
|
|
+ effectiveduration_vip=year+"年"+month+"个月";
|
|
|
+ }else if(year !== 0&& month ===0){
|
|
|
+ effectiveduration_vip=year+"年";
|
|
|
+ }else if(year === 0&& month !==0){
|
|
|
+ effectiveduration_vip=month+"个月";
|
|
|
+ }
|
|
|
+ if(cycleunit_vip==3){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"天";
|
|
|
+ }
|
|
|
+ if (!$.isEmptyObject(newbuyset)){
|
|
|
+ if(cycleunit_vip==1){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"年";
|
|
|
+ }else if(cycleunit_vip==2){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"个月"
|
|
|
+ }else if(cycleunit_vip==3){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"天";
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
- region_vip="全国";
|
|
|
+ if(cycleunit_vip==1){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"年";
|
|
|
+ }else if(cycleunit_vip==2){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"个月"
|
|
|
+ }else if(cycleunit_vip==3){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"天";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(vip_type==2){
|
|
|
+ //新增全部行业:-1 新增部分行业:123 无新增:0
|
|
|
+ //新增全国{"province":0,"city":0} 无新增:{}
|
|
|
+ //升级订单 单独处理
|
|
|
+ //区域
|
|
|
+ var filterObj =filter_vip;
|
|
|
+ if(!$.isEmptyObject(newbuyset)){
|
|
|
+ var val=getnewbuyset(newbuyset);
|
|
|
+ region_vip=val[0];
|
|
|
+ industry_vip=val[1];
|
|
|
+ }else{
|
|
|
+ if(!$.isEmptyObject(filterObj.addareacount)){
|
|
|
+ if((filterObj.addareacount.province==0)&&(filterObj.addareacount.city==0)){
|
|
|
+ region_vip="全国";
|
|
|
+ }
|
|
|
+ if((filterObj.addareacount.province!=0)&&(filterObj.addareacount.city==0)){
|
|
|
+ region_vip=filterObj.addareacount.province+"个省级区域";
|
|
|
+ }
|
|
|
+ if((filterObj.addareacount.province==0)&&(filterObj.addareacount.city!=0)){
|
|
|
+ region_vip=filterObj.addareacount.city+"个地市";
|
|
|
+ }
|
|
|
+ if((filterObj.addareacount.province!=0)&&(filterObj.addareacount.city!=0)){
|
|
|
+ region_vip=filterObj.addareacount.province+"个省级区域、"+filterObj.addareacount.city+"个地市";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ region_vip="无";
|
|
|
+ }
|
|
|
+ //行业
|
|
|
+ var industry_vip="";
|
|
|
+ industry_vip=filterObj.addbuyerclasscount+"个行业";
|
|
|
+ if(filterObj.addbuyerclasscount==0){
|
|
|
+ industry_vip="无";
|
|
|
+ }
|
|
|
+ if(filterObj.addbuyerclasscount==-1){
|
|
|
+ industry_vip="全行业";
|
|
|
+ }
|
|
|
}
|
|
|
- if((province_length!=0)&&(city_length!=0)){
|
|
|
- region_vip=province_length+"个省级区域、"+city_length+"个地市";
|
|
|
- }else if((province_length==0)&&(city_length!=0)){
|
|
|
- region_vip=city_length+"个地市";
|
|
|
- }else if((province_length!=0)&&(city_length==0)){
|
|
|
- region_vip=province_length+"个省级区域";
|
|
|
+ //延长周期
|
|
|
+ var effectiveduration_vip="";
|
|
|
+ if(filterObj.cycleunit==1){
|
|
|
+ effectiveduration_vip=filterObj.cyclecount+"年";
|
|
|
+ }else if(filterObj.cycleunit==2){
|
|
|
+ effectiveduration_vip=filterObj.cyclecount+"个月";
|
|
|
+ }else if(filterObj.cycleunit==3){
|
|
|
+ effectiveduration_vip=filterObj.cyclecount+"天";
|
|
|
+ }else if (filterObj.cycleunit==-1){
|
|
|
+ effectiveduration_vip="不延期";
|
|
|
}
|
|
|
- //行业
|
|
|
- var industry_vip = filter_vip.industry.length; //数组
|
|
|
- if(industry_vip==0){
|
|
|
- industry_vip="全行业";
|
|
|
- }else{
|
|
|
- industry_vip=industry_vip+"个行业";
|
|
|
- }
|
|
|
- var cyclecount_vip = filter_vip.cyclecount; //时长
|
|
|
- var cycleunit_vip = filter_vip.cycleunit;//单位 1:年 2:月 3:天
|
|
|
- //订阅周期
|
|
|
- var effectiveduration_vip=""
|
|
|
- if((obj.vip_starttime!=undefined)&&(obj.vip_endtime!=undefined)){
|
|
|
- var start_time_vip = obj.vip_starttime;
|
|
|
- var end_time_vip = obj.vip_endtime;
|
|
|
- var start_time_arr = start_time_vip.split(" ")[0].split("-")
|
|
|
- var end_time_arr = end_time_vip.split(" ")[0].split("-")
|
|
|
- var start_year=start_time_arr[0];
|
|
|
- var start_month=start_time_arr[1];
|
|
|
- var end_year=end_time_arr[0];
|
|
|
- var end_month=end_time_arr[1];
|
|
|
-
|
|
|
- var year = 0;
|
|
|
+ //续费升级逻辑修改后判断是否不延期
|
|
|
+ if(filterObj.cycleunit==0&&filterObj.cyclecount==0){
|
|
|
+ effectiveduration_vip="不延期";
|
|
|
+ }
|
|
|
+ }else if (vip_type==1){
|
|
|
+ filter_vip = JSON.parse(obj.filter);
|
|
|
+ var renewal_market=0; //续费市级地区
|
|
|
+ var buyset=filter_vip.buyset;
|
|
|
+ if(!$.isEmptyObject(newbuyset)){
|
|
|
+ var val = getnewbuyset(newbuyset);
|
|
|
+ region_vip=val[0];
|
|
|
+ industry_vip=val[1];
|
|
|
+ }else{
|
|
|
+ if (!$.isEmptyObject(buyset)){
|
|
|
+ if (buyset.areacount==-1){
|
|
|
+ region_vip = "全国";
|
|
|
+ }else{
|
|
|
+ if(!$.isEmptyObject(buyset.citys)){
|
|
|
+ for (var key in buyset.citys) {
|
|
|
+ renewal_market+=(buyset.citys[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ var areaText="";
|
|
|
+ if ((buyset.areacount!=0)&&(renewal_market!=0)){
|
|
|
+ region_vip=buyset.areacount+"个省级地区、"+renewal_market+"个地市";
|
|
|
+ }else if((buyset.areacount==0)&&(renewal_market!=0)){
|
|
|
+ region_vip=renewal_market+"个地市";
|
|
|
+ }else if((buyset.areacount!=0)&&(renewal_market==0)){
|
|
|
+ region_vip=buyset.areacount+"个省级地区";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(buyset.buyerclasscount==-1){
|
|
|
+ industry_vip="全行业";
|
|
|
+ }else{
|
|
|
+ industry_vip=buyset.buyerclasscount+"个行业";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ industry_vip=""
|
|
|
+ region_vip=""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //订阅周期
|
|
|
+ var effectiveduration_vip=""
|
|
|
+ if((obj.vip_starttime!=undefined)&&(obj.vip_endtime!=undefined)){
|
|
|
+ var start_time_vip = obj.vip_starttime;
|
|
|
+ var end_time_vip = obj.vip_endtime;
|
|
|
+ var start_time_arr = start_time_vip.split(" ")[0].split("-")
|
|
|
+ var end_time_arr = end_time_vip.split(" ")[0].split("-")
|
|
|
+ var start_year=start_time_arr[0];
|
|
|
+ var start_month=start_time_arr[1];
|
|
|
+ var end_year=end_time_arr[0];
|
|
|
+ var end_month=end_time_arr[1];
|
|
|
+
|
|
|
+ var year = 0;
|
|
|
var month = 0;
|
|
|
if(end_year > start_year){
|
|
|
- if(end_month > start_month){
|
|
|
- year = end_year - start_year;
|
|
|
- month = end_month - start_month;
|
|
|
- }else{
|
|
|
- year = end_year - start_year-1;
|
|
|
- month = 12+Number(end_month)-start_month;
|
|
|
- if (month==12){
|
|
|
- year=Number(year)+1;
|
|
|
- month=0;
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(end_year == start_year){
|
|
|
- month = end_month - start_month;
|
|
|
- }
|
|
|
-
|
|
|
- if(year != 0 && month !=0){
|
|
|
- effectiveduration_vip=year+"年"+month+"个月";
|
|
|
- }else if(year !== 0&& month ===0){
|
|
|
- effectiveduration_vip=year+"年";
|
|
|
- }else if(year === 0&& month !==0){
|
|
|
- effectiveduration_vip=month+"个月";
|
|
|
- }
|
|
|
- if(cycleunit_vip==3){
|
|
|
- effectiveduration_vip=cyclecount_vip+"天";
|
|
|
- }
|
|
|
- }else{
|
|
|
- if(cycleunit_vip==1){
|
|
|
- effectiveduration_vip=cyclecount_vip+"年";
|
|
|
- }else if(cycleunit_vip==2){
|
|
|
- effectiveduration_vip=cyclecount_vip+"个月"
|
|
|
- }else if(cycleunit_vip==3){
|
|
|
- effectiveduration_vip=cyclecount_vip+"天";
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- //区域
|
|
|
- var filterObj =filter_vip;
|
|
|
- var region_vip ="";
|
|
|
- //升级订单 单独处理
|
|
|
- if(!$.isEmptyObject(filterObj.addarea)){
|
|
|
- var cityNum_u=0;
|
|
|
- var provinceNum_u=0;
|
|
|
- for(var i in filterObj.addarea) {
|
|
|
- let citys_u=filterObj.addarea[i];
|
|
|
- if (citys_u=="no"){
|
|
|
- region_vip="无"
|
|
|
- }else{
|
|
|
- if (citys_u.length>0){
|
|
|
- cityNum_u+=citys_u.length;
|
|
|
- }else{
|
|
|
- provinceNum_u++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(provinceNum_u>0) region_vip= region_vip + provinceNum_u+"个省级区域";
|
|
|
- if(cityNum_u>0){
|
|
|
- if(provinceNum_u>0) region_vip= region_vip+"、"
|
|
|
- region_vip = region_vip+ cityNum_u+"个地市";
|
|
|
- }
|
|
|
- }else {
|
|
|
- region_vip="全国";
|
|
|
- }
|
|
|
- //行业
|
|
|
- var industry_vip="";
|
|
|
- if(!$.isEmptyObject(filterObj.addindustry)) {
|
|
|
- if(filterObj.addindustry[0]=="no"){
|
|
|
- industry_vip="无";
|
|
|
- }else{
|
|
|
- if(filterObj.addindustry.length==0){
|
|
|
- industry_vip="全行业";
|
|
|
- }else{
|
|
|
- industry_vip=filterObj.addindustry.length+"个行业";
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- industry_vip="全行业";
|
|
|
- }
|
|
|
- //延长周期
|
|
|
- var effectiveduration_vip="";
|
|
|
- if(filterObj.cycleunit==1){
|
|
|
- effectiveduration_vip=filterObj.cyclecount+"年";
|
|
|
- }else if(filterObj.cycleunit==2){
|
|
|
- effectiveduration_vip=filterObj.cyclecount+"个月";
|
|
|
- }else if(filterObj.cycleunit==3){
|
|
|
- effectiveduration_vip=filterObj.cyclecount+"天";
|
|
|
- }else if (filterObj.cycleunit==-1){
|
|
|
- effectiveduration_vip="不延期";
|
|
|
- }
|
|
|
+ if(end_month > start_month){
|
|
|
+ year = end_year - start_year;
|
|
|
+ month = end_month - start_month;
|
|
|
+ }else{
|
|
|
+ year = end_year - start_year-1;
|
|
|
+ month = 12+Number(end_month)-start_month;
|
|
|
+ if (month==12){
|
|
|
+ year=Number(year)+1;
|
|
|
+ month=0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(end_year == start_year){
|
|
|
+ month = end_month - start_month;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(year != 0 && month !=0){
|
|
|
+ effectiveduration_vip=year+"年"+month+"个月";
|
|
|
+ }else if(year !== 0&& month ===0){
|
|
|
+ effectiveduration_vip=year+"年";
|
|
|
+ }else if(year === 0&& month !==0){
|
|
|
+ effectiveduration_vip=month+"个月";
|
|
|
+ }
|
|
|
+ //试用用户生成订单 周期
|
|
|
+ if (effectiveduration_vip==""){
|
|
|
+ if(cycleunit_vip==1){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"年";
|
|
|
+ }else if(cycleunit_vip==2){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"个月"
|
|
|
+ }else if(cycleunit_vip==3){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"天";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(cycleunit_vip==1){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"年";
|
|
|
+ }else if(cycleunit_vip==2){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"个月"
|
|
|
+ }else if(cycleunit_vip==3){
|
|
|
+ effectiveduration_vip=cyclecount_vip+"天";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1524,7 +1604,7 @@
|
|
|
}else{
|
|
|
orderMoney_vip=orderMoney_vip1;
|
|
|
}
|
|
|
- console.log(orderMoney_vip,"===",orderMoney)
|
|
|
+ var way=obj.pay_way;
|
|
|
if(orderStatus_vip==0){
|
|
|
orderStatus_vip="待付款"
|
|
|
orderHtml=""
|
|
@@ -1533,7 +1613,7 @@
|
|
|
iconHtml=""
|
|
|
iconHtml+='<div class="card-footer">'
|
|
|
+'<a class="btn cancle" onclick="cancelOrder('+id_vip+',this)">取消订单</a>'
|
|
|
- +'<a href="javascript:void(0)" onclick="choosePayWay_vip(\''+orderMoney_vip+'\',"'+orderCode_vip+'",this)" class="gopay_btn pay" filterid="'+obj.filter_id+'" token="'+token_vip+'" id="'+id_vip+'" orderCode='+orderCode_vip+'>去支付</a>'
|
|
|
+ +'<a href="javascript:void(0)" onclick="choosePayWay_vip(\''+orderMoney_vip+'\',"'+orderCode_vip+'",this,"'+way+'")" class="gopay_btn pay" filterid="'+obj.filter_id+'" token="'+token_vip+'" id="'+id_vip+'" orderCode='+orderCode_vip+'>去支付</a>'
|
|
|
+'</div>'
|
|
|
}else if(orderStatus_vip==1){
|
|
|
orderStatus_vip="已完成";
|
|
@@ -1572,7 +1652,7 @@
|
|
|
+'<div class="card-content">'
|
|
|
+'<a eid='+orderCode_vip+' class="media" isvipOrder="true">'
|
|
|
+'<div class="media-img">'
|
|
|
- +'<img src="/vipsubscribe/image/vip_order.png">'
|
|
|
+ +'<img src="/jyapp/vipsubscribe/image/vip_order.png">'
|
|
|
+'</div>'
|
|
|
+'<div class="media-info">'
|
|
|
+'<p class="item-ifo ellipsis">区域:'+ region_vip+'</p>'
|
|
@@ -1602,7 +1682,7 @@
|
|
|
+'<div class="card-content">'
|
|
|
+'<a eid='+orderCode_vip+' class="media" isvipOrder="true">'
|
|
|
+'<div class="media-img">'
|
|
|
- +'<img src="/vipsubscribe/image/vip_order.png">'
|
|
|
+ +'<img src="/jyapp/vipsubscribe/image/vip_order.png">'
|
|
|
+'</div>'
|
|
|
+'<div class="media-info">'
|
|
|
+'<p class="item-ifo ellipsis">区域:'+ region_vip+'</p>'
|
|
@@ -1903,6 +1983,44 @@
|
|
|
function phoneHide(){
|
|
|
$('.jy-alert').hide();
|
|
|
}
|
|
|
+ //2.8.5升级续费更新
|
|
|
+ function getnewbuyset(newbuyset){
|
|
|
+ var region_vip="";
|
|
|
+ if(newbuyset.areacount!=-1){
|
|
|
+ var newcitys=newbuyset.newcitys;
|
|
|
+ var scatter=newcitys.length ;//分布
|
|
|
+ var citynum=0;
|
|
|
+ for(var k in newcitys){
|
|
|
+ citynum+=newcitys[k];
|
|
|
+ }
|
|
|
+ if(newbuyset.areacount>0){
|
|
|
+ region_vip=newbuyset.areacount+"个省级区域";
|
|
|
+ // if(citynum>1){
|
|
|
+ // region_vip+="、"+citynum+"个地市(分布在"+scatter+"省内)";
|
|
|
+ // }else{
|
|
|
+ if(citynum!=0){
|
|
|
+ region_vip+="、"+citynum+"个地市";
|
|
|
+ }
|
|
|
+ //}
|
|
|
+ }else{
|
|
|
+ //region_vip+=citynum+"个地市(分布在"+scatter+"省内)";
|
|
|
+ region_vip+=citynum+"个地市";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ region_vip="全国";
|
|
|
+ }
|
|
|
+ var buyerclasscount=newbuyset.buyerclasscount;
|
|
|
+ if(buyerclasscount>3){
|
|
|
+ buyerclasscount=filterObj.industry.length;
|
|
|
+ industry_vip="全行业("+buyerclasscount+"个行业)";
|
|
|
+ }else{
|
|
|
+ industry_vip=buyerclasscount+"个行业";
|
|
|
+ }
|
|
|
+ if(buyerclasscount==-1){
|
|
|
+ industry_vip="全行业";
|
|
|
+ }
|
|
|
+ return [region_vip,industry_vip]
|
|
|
+ }
|
|
|
</script>
|
|
|
<!--百度统计end-->
|
|
|
{{include "/common/baiducc.html"}}
|