|
@@ -466,9 +466,9 @@
|
|
|
}
|
|
|
|
|
|
function setSessionStorage(){
|
|
|
- if(sessionStorage){
|
|
|
- sessionStorage.orderTabActive=$("ul .active").index();
|
|
|
- }
|
|
|
+ sessionStorage.orderTabActive=$("ul .active").index();
|
|
|
+ sessionStorage.orderScrollTop=$(".main")[0].scrollTop;
|
|
|
+ sessionStorage.orderPageNum=parseInt(pageIndex)-1;
|
|
|
}
|
|
|
|
|
|
function onceMore(e){
|
|
@@ -476,8 +476,22 @@
|
|
|
var orderCode = $(e).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
window.location.href="/jyapp/front/dataExport/toSieve?orderCode="+orderCode;;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ //1续费 2再次购买
|
|
|
+ function renewalOrBuyAgain(pattern,e){
|
|
|
+ setSessionStorage();
|
|
|
+ var orderCode = $(e).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
+ if (pattern==1){
|
|
|
+ /*var checkOrder_bl=checkOrder()
|
|
|
+ if (checkOrder_bl){
|
|
|
+ return;
|
|
|
+ }*/
|
|
|
+ window.location.href="/jyapp/vipsubscribe/renewPayPage?orderCode="+orderCode;
|
|
|
+ }else if (pattern==2){
|
|
|
+ window.location.href="/jyapp/vipsubscribe/vipsubscribe_new?orderCode="+orderCode;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//删除订单
|
|
|
function deleteOrder(id,obj,cancel) {
|
|
|
$.confirm({
|
|
@@ -706,7 +720,7 @@
|
|
|
}else {
|
|
|
$(obj).parent().parent().remove();
|
|
|
$(".card_lists").empty();
|
|
|
- queryOrder($("ul .active").index());
|
|
|
+ queryOrder($("ul .active").index(),10);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -762,7 +776,7 @@
|
|
|
$(".tabs>.tab").eq(index).show().siblings().hide();
|
|
|
$(".card_lists").empty();
|
|
|
$("body").scrollTop(0);
|
|
|
- queryOrder(index)
|
|
|
+ queryOrder(index,10)
|
|
|
})
|
|
|
})
|
|
|
|
|
@@ -793,11 +807,12 @@
|
|
|
let isvip_order=$(".media").attr("isviporder");
|
|
|
//vip支付;
|
|
|
if (isvip_order=="true"){
|
|
|
- var orderCode =$(".media").attr("orderCode");
|
|
|
+ var orderCode =$(".media").attr("eid");
|
|
|
if(!canpay)return
|
|
|
canpay=false;
|
|
|
- $.post("/subscribepay/vipsubscribe/orderToPay",{"orderCode":orderCode},function(r){
|
|
|
+ $.post("/subscribepay/vipsubscribe/orderToPay",{"orderCode":orderCode,"pay_way":pay_way},function(r){
|
|
|
if(r.success){
|
|
|
+ alert( JSON.stringify(r))
|
|
|
if(pay_way=="wx_app"){
|
|
|
JyObj.wxPay(r.data.res);
|
|
|
}else{
|
|
@@ -886,13 +901,47 @@
|
|
|
$(".loading_").hide();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ function getParam(pname) {
|
|
|
+ var params = location.search.substr(1);
|
|
|
+ var ArrParam = params.split('&');
|
|
|
+ if (ArrParam.length == 1) {
|
|
|
+ return params.split('=')[1];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //多个参数参数的情况
|
|
|
+ for (var i = 0; i < ArrParam.length; i++) {
|
|
|
+ if (ArrParam[i].split('=')[0] == pname) {
|
|
|
+ return ArrParam[i].split('=')[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(sessionStorage.orderTabActive){
|
|
|
$(".buttons-tab .tab-link").eq(sessionStorage.orderTabActive).addClass("active").siblings().removeClass("active");
|
|
|
- queryOrder(sessionStorage.orderTabActive);
|
|
|
+ var orderPageNum=parseInt(sessionStorage.orderPageNum);
|
|
|
+ queryOrder(sessionStorage.orderTabActive,orderPageNum*10);
|
|
|
+ sessionStorage.removeItem("orderPageNum");
|
|
|
sessionStorage.removeItem("orderTabActive");
|
|
|
+ if(sessionStorage.orderScrollTop){
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".main")[0].scrollTop=parseInt(sessionStorage.orderScrollTop);
|
|
|
+ },500)
|
|
|
+ setTimeout(function(){
|
|
|
+ sessionStorage.removeItem("orderScrollTop");
|
|
|
+ },2000)
|
|
|
+
|
|
|
+ }
|
|
|
}else{
|
|
|
- queryOrder();
|
|
|
+ //后续版本用
|
|
|
+ var active=getParam("active");
|
|
|
+ if (active){
|
|
|
+ $(".buttons-tab .tab-link").eq(active).addClass("active").siblings().removeClass("active");
|
|
|
+ $(".tabs>.tab").eq(active).show().siblings().hide();
|
|
|
+ $(".card_lists").empty();
|
|
|
+ queryOrder(active,10);
|
|
|
+ }else{
|
|
|
+ queryOrder(0,10);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
})
|
|
@@ -901,13 +950,14 @@
|
|
|
/*------------------------------------------------------------------*/
|
|
|
//查询订单ajax
|
|
|
//typ 0全部 1未支付 2已支付3已取消
|
|
|
- function queryOrder(typ){
|
|
|
+ function queryOrder(typ,page_size){
|
|
|
var result = true;
|
|
|
$.ajax({
|
|
|
type:"post",
|
|
|
url:"/subscribepay/orderListDetails/myOrder",
|
|
|
data:{
|
|
|
- "type":typ
|
|
|
+ "type":typ,
|
|
|
+ "page_size":page_size
|
|
|
},
|
|
|
async:false,
|
|
|
dataType: 'json',
|
|
@@ -915,7 +965,11 @@
|
|
|
$(".loading_").hide();
|
|
|
var list=data.res;
|
|
|
dataCache =data.res;
|
|
|
- pageIndex=2;
|
|
|
+ if(page_size!=10){
|
|
|
+ pageIndex=parseInt(page_size/10)+1;
|
|
|
+ }else{
|
|
|
+ pageIndex=2;
|
|
|
+ }
|
|
|
hasNextPage=data.hasNextPage;
|
|
|
if (data.res&&data.res.length>0){
|
|
|
structureHtml(data.res);
|
|
@@ -1019,8 +1073,6 @@
|
|
|
pay_way="wx_app";
|
|
|
this_e=e;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
//提示框
|
|
|
var EasyAlert = {
|
|
@@ -1071,338 +1123,396 @@
|
|
|
function structureHtml(object){
|
|
|
var listhtml='';
|
|
|
for(var index in object){
|
|
|
- var obj=object[index];
|
|
|
- if(obj.product_type=="历史数据"){
|
|
|
- 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,"/")
|
|
|
- }
|
|
|
- }
|
|
|
- //订单金额
|
|
|
- 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;
|
|
|
- }
|
|
|
- //1标准字段包 2高级字段包
|
|
|
- var spec = obj.data_spec;
|
|
|
- if(spec=="标准字段包"){
|
|
|
- spec_=1;
|
|
|
- }else if(spec =="高级字段包"){
|
|
|
- spec_=2;
|
|
|
- }
|
|
|
- var filter_id =obj.filter_id;
|
|
|
+ var obj=object[index];
|
|
|
+ if(obj.product_type=="历史数据"){
|
|
|
+ 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,"/")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //订单金额
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ //1标准字段包 2高级字段包
|
|
|
+ var spec = obj.data_spec;
|
|
|
+ if(spec=="标准字段包"){
|
|
|
+ spec_=1;
|
|
|
+ }else if(spec =="高级字段包"){
|
|
|
+ spec_=2;
|
|
|
+ }
|
|
|
+ var filter_id =obj.filter_id;
|
|
|
|
|
|
- //订单状态 0待支付 1已完成 -1删除
|
|
|
- //+'<span class="status notpay">'+orderStatus+'</span>'
|
|
|
- var orderStatus = obj.order_status;
|
|
|
- if(orderStatus==0){
|
|
|
- orderHtml=""
|
|
|
- orderStatus="待付款"
|
|
|
- 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>'
|
|
|
- orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id +",this)\"></a>";
|
|
|
- iconHtml=""
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'<a onclick="onceMore(this)" class="btn cancle">再次购买</a>'
|
|
|
- +'</div>'
|
|
|
- }else if(orderStatus==-2){
|
|
|
- orderStatus="已取消";
|
|
|
- orderHtml="";
|
|
|
- orderHtml+='<span class="status">'+orderStatus+'</span>'
|
|
|
- orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id +",this)\"></a>";
|
|
|
- iconHtml="";
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'<a onclick="onceMore(this)" class="btn cancle">再次购买</a>'
|
|
|
- +'</div>'
|
|
|
- }
|
|
|
- //订单总数
|
|
|
- var data_count=obj.data_count;
|
|
|
- //
|
|
|
- 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>";
|
|
|
+ //订单状态 0待支付 1已完成 -1删除
|
|
|
+ //+'<span class="status notpay">'+orderStatus+'</span>'
|
|
|
+ var orderStatus = obj.order_status;
|
|
|
+ if(orderStatus==0){
|
|
|
+ orderHtml=""
|
|
|
+ orderStatus="待付款"
|
|
|
+ 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>'
|
|
|
+ orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id +",this)\"></a>";
|
|
|
+ iconHtml=""
|
|
|
+ iconHtml+='<div class="card-footer">'
|
|
|
+ +'<a onclick="onceMore(this)" class="btn cancle">再次购买</a>'
|
|
|
+ +'</div>'
|
|
|
+ }else if(orderStatus==-2){
|
|
|
+ orderStatus="已取消";
|
|
|
+ orderHtml="";
|
|
|
+ orderHtml+='<span class="status">'+orderStatus+'</span>'
|
|
|
+ orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id +",this)\"></a>";
|
|
|
+ iconHtml="";
|
|
|
+ iconHtml+='<div class="card-footer">'
|
|
|
+ +'<a onclick="onceMore(this)" class="btn cancle">再次购买</a>'
|
|
|
+ +'</div>'
|
|
|
}
|
|
|
- }else{
|
|
|
- keysHtml=""
|
|
|
- }
|
|
|
+ //订单总数
|
|
|
+ var data_count=obj.data_count;
|
|
|
+ //
|
|
|
+ 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" id="'+orderCode+'">'
|
|
|
- +'<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>'
|
|
|
+ listhtml+='<div class="card">'
|
|
|
+ +'<div class="card-header">'
|
|
|
+ +'<span class="time">'+createTime+'</span>'
|
|
|
+ +orderHtml
|
|
|
+ +'</div>'
|
|
|
+ +'<div class="card-content">'
|
|
|
+ +'<a eid='+orderCode+' class="media" id="'+orderCode+'">'
|
|
|
+ +'<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>'
|
|
|
- +'</a>'
|
|
|
- +'<div class="price">'
|
|
|
- +'<strong class="current">¥'+orderMoney+'</strong>'
|
|
|
+'</div>'
|
|
|
+ +iconHtml
|
|
|
+'</div>'
|
|
|
- +iconHtml
|
|
|
- +'</div>'
|
|
|
|
|
|
- }else if(obj.product_type=="VIP订阅"){
|
|
|
+ }else if(obj.product_type=="VIP订阅"){
|
|
|
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;
|
|
|
- if(JSON.stringify(region_vipArr) != JSON.stringify({})){
|
|
|
- for(i in region_vipArr){
|
|
|
- if(region_vipArr[i].length==0){
|
|
|
- province_length++;
|
|
|
+ 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++;
|
|
|
+ }else{
|
|
|
+ city_length+=region_vipArr[i].length;
|
|
|
+ }
|
|
|
+ }
|
|
|
}else{
|
|
|
- city_length+=region_vipArr[i].length;
|
|
|
+ region_vip="全国";
|
|
|
}
|
|
|
- }
|
|
|
- }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{
|
|
|
- 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+"天";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var vip_status =obj.i_vip_status; // 1:试用 2:正式 -1:试用到期 -2:正式到期
|
|
|
- //订单状态 0待支付 1已完成 -1删除
|
|
|
- var orderStatus_vip = obj.order_status;
|
|
|
- var token_vip = obj.token;
|
|
|
- if(sessionStorage&&sessionStorage.getItem("paySuccess_"+obj.order_code)!=null){
|
|
|
- orderStatus = sessionStorage.getItem("paySuccess_"+obj.order_code);
|
|
|
- if (orderTabActive==1&&orderStatus==1){
|
|
|
- gopayIndex = index;
|
|
|
- psss=obj.order_code;
|
|
|
- continue;
|
|
|
+ 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{
|
|
|
+ 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{
|
|
|
- sessionStorage.removeItem("paySuccess_"+obj.order_code);
|
|
|
+ //区域
|
|
|
+ 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="不延期";
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //订单金额
|
|
|
- var orderMoney_vip = obj.order_money;
|
|
|
- //金额格式化 小数点前 1,000
|
|
|
- orderMoney_vip=orderMoney_vip+"";
|
|
|
- orderMoney_vip1=toThousands(orderMoney_vip.split(".")[0]);
|
|
|
- orderMoney_vip2=orderMoney_vip.split(".")[1];
|
|
|
- if(orderMoney_vip2){
|
|
|
- orderMoney_vip=orderMoney_vip1+"."+orderMoney_vip2;
|
|
|
- }else{
|
|
|
- orderMoney_vip=orderMoney_vip1;
|
|
|
- }
|
|
|
- console.log(orderMoney_vip)
|
|
|
- if(orderStatus_vip==0){
|
|
|
- orderStatus_vip="待付款"
|
|
|
- orderHtml=""
|
|
|
- orderHtml+='<span class="status notpay">'+orderStatus_vip+'</span>'
|
|
|
- orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip +",this)\"></a>";
|
|
|
- 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+'\','+orderMoney+',"'+orderMoney+'",this)" 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="已完成";
|
|
|
- orderHtml=""
|
|
|
- orderHtml+='<span class="status">'+orderStatus_vip+'</span>'
|
|
|
- orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip +",this)\"></a>";
|
|
|
- iconHtml=""
|
|
|
- //最后一次购买完 1:试用 2:正式 -1:试用到期 -2:正式到期
|
|
|
- console.log(obj.lastbuy_code)
|
|
|
- if((vip_status=="-2")&&(obj.lastbuy_code!=undefined)){
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'<a onclick="renewalOrBuyAgain(2,this)" class="btn cancle">再次购买</a>'
|
|
|
- +'</div>'
|
|
|
- }else if((vip_status=="2")&&(obj.lastbuy_code!=undefined)){
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'<a onclick="renewalOrBuyAgain(1,this)" class="btn cancle">续费</a>'
|
|
|
- +'</div>'
|
|
|
- }
|
|
|
- }else if(orderStatus_vip==-2){
|
|
|
- orderStatus_vip="已取消";
|
|
|
- orderHtml="";
|
|
|
- orderHtml+='<span class="status">'+orderStatus_vip+'</span>'
|
|
|
- orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip +",this)\"></a>";
|
|
|
- iconHtml="";
|
|
|
- iconHtml+='<div class="card-footer">'
|
|
|
- +'</div>'
|
|
|
- }
|
|
|
- //vip状态 0不是vip 1试用 2正式
|
|
|
- if (orderStatus_vip!="已完成"){
|
|
|
- //未支付 或 已取消
|
|
|
- listhtml+='<div class="card">'
|
|
|
- +'<div class="card-header">'
|
|
|
- +'<span class="time" style="color:#888888">'+createTime_vip+'</span>'
|
|
|
- +orderHtml
|
|
|
+
|
|
|
+
|
|
|
+ var vip_status =obj.i_vip_status; // 1:试用 2:正式 -1:试用到期 -2:正式到期
|
|
|
+ //订单状态 0待支付 1已完成 -1删除
|
|
|
+ var orderStatus_vip = obj.order_status;
|
|
|
+ var token_vip = obj.token;
|
|
|
+ if(sessionStorage&&sessionStorage.getItem("paySuccess_"+obj.order_code)!=null){
|
|
|
+ orderStatus = sessionStorage.getItem("paySuccess_"+obj.order_code);
|
|
|
+ if (orderTabActive==1&&orderStatus==1){
|
|
|
+ gopayIndex = index;
|
|
|
+ psss=obj.order_code;
|
|
|
+ continue;
|
|
|
+ }else{
|
|
|
+ sessionStorage.removeItem("paySuccess_"+obj.order_code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //订单金额
|
|
|
+ var orderMoney_vip = obj.order_money;
|
|
|
+ //金额格式化 小数点前 1,000
|
|
|
+ orderMoney_vip=orderMoney_vip+"";
|
|
|
+ orderMoney_vip1=toThousands(orderMoney_vip.split(".")[0]);
|
|
|
+ orderMoney_vip2=orderMoney_vip.split(".")[1];
|
|
|
+ if(orderMoney_vip2){
|
|
|
+ orderMoney_vip=orderMoney_vip1+"."+orderMoney_vip2;
|
|
|
+ }else{
|
|
|
+ orderMoney_vip=orderMoney_vip1;
|
|
|
+ }
|
|
|
+ console.log(orderMoney_vip)
|
|
|
+ if(orderStatus_vip==0){
|
|
|
+ orderStatus_vip="待付款"
|
|
|
+ orderHtml=""
|
|
|
+ orderHtml+='<span class="status notpay">'+orderStatus_vip+'</span>'
|
|
|
+ orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip +",this)\"></a>";
|
|
|
+ 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+'\','+orderMoney+',"'+orderMoney+'",this)" class="gopay_btn pay" filterid="'+obj.filter_id+'" token="'+token_vip+'" id="'+id_vip+'" orderCode='+orderCode_vip+'>去支付</a>'
|
|
|
+'</div>'
|
|
|
- +'<div class="card-content">'
|
|
|
- +'<a eid='+orderCode_vip+' class="media" isvipOrder="true">'
|
|
|
- +'<div class="media-img">'
|
|
|
- +'<img src="/vipsubscribe/image/vip_order.png">'
|
|
|
- +'</div>'
|
|
|
- +'<div class="media-info">'
|
|
|
- +'<p class="item-ifo ellipsis">区域:'+ region_vip+'</p>'
|
|
|
- +'<p class="item-ifo ellipsis">行业:'+ industry_vip +'行业</p>'
|
|
|
- +'<p class="item-ifo ellipsis">订阅周期:'+effectiveduration_vip+'</p>'
|
|
|
- +'</div>'
|
|
|
- +'</a>'
|
|
|
- +'<div class="price">'
|
|
|
- +'<strong class="current">¥'+orderMoney_vip+'</strong>'
|
|
|
- +'</div>'
|
|
|
+ }else if(orderStatus_vip==1){
|
|
|
+ orderStatus_vip="已完成";
|
|
|
+ orderHtml=""
|
|
|
+ orderHtml+='<span class="status">'+orderStatus_vip+'</span>'
|
|
|
+ orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip +",this)\"></a>";
|
|
|
+ iconHtml=""
|
|
|
+ //最后一次购买完 1:试用 2:正式 -1:试用到期 -2:正式到期
|
|
|
+ console.log(obj.lastbuy_code)
|
|
|
+ if((vip_status=="-2")&&(obj.lastbuy_code!=undefined)){
|
|
|
+ iconHtml+='<div class="card-footer">'
|
|
|
+ +'<a onclick="renewalOrBuyAgain(2,this)" class="btn cancle">再次购买</a>'
|
|
|
+ +'</div>'
|
|
|
+ }else if((vip_status=="2")&&(obj.lastbuy_code!=undefined)){
|
|
|
+ iconHtml+='<div class="card-footer">'
|
|
|
+ +'<a onclick="renewalOrBuyAgain(1,this)" class="btn cancle">续费</a>'
|
|
|
+'</div>'
|
|
|
- +iconHtml
|
|
|
- +'</div>'
|
|
|
- }else{
|
|
|
- //有效时间
|
|
|
- var starttime_vip= obj.vip_starttime+"";
|
|
|
- var endtime_vip= obj.vip_endtime+"";
|
|
|
- starttime_vip= starttime_vip.split(" ")[0].replace(/-/g,".")
|
|
|
- endtime_vip= endtime_vip.split(" ")[0].replace(/-/g,".")
|
|
|
- var effectivetime_vip =starttime_vip+"-"+endtime_vip;
|
|
|
- //已完成
|
|
|
- listhtml+='<div class="card">'
|
|
|
- +'<div class="card-header">'
|
|
|
- +'<span class="time" style="color:#888888">'+createTime_vip+'</span>'
|
|
|
- +orderHtml
|
|
|
+ }
|
|
|
+ }else if(orderStatus_vip==-2){
|
|
|
+ orderStatus_vip="已取消";
|
|
|
+ orderHtml="";
|
|
|
+ orderHtml+='<span class="status">'+orderStatus_vip+'</span>'
|
|
|
+ orderHtml+="<a class=\"shanchu iconfont icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip +",this)\"></a>";
|
|
|
+ iconHtml="";
|
|
|
+ iconHtml+='<div class="card-footer">'
|
|
|
+ +'</div>'
|
|
|
+ }
|
|
|
+ //vip状态 0不是vip 1试用 2正式
|
|
|
+ if (orderStatus_vip!="已完成"){
|
|
|
+ //未支付 或 已取消
|
|
|
+ listhtml+='<div class="card">'
|
|
|
+ +'<div class="card-header">'
|
|
|
+ +'<span class="time" style="color:#888888">'+createTime_vip+'</span>'
|
|
|
+ +orderHtml
|
|
|
+ +'</div>'
|
|
|
+ +'<div class="card-content">'
|
|
|
+ +'<a eid='+orderCode_vip+' class="media" isvipOrder="true">'
|
|
|
+ +'<div class="media-img">'
|
|
|
+ +'<img src="/vipsubscribe/image/vip_order.png">'
|
|
|
+ +'</div>'
|
|
|
+ +'<div class="media-info">'
|
|
|
+ +'<p class="item-ifo ellipsis">区域:'+ region_vip+'</p>'
|
|
|
+ +'<p class="item-ifo ellipsis">行业:'+ industry_vip +'</p>'
|
|
|
+ +'<p class="item-ifo ellipsis">订阅周期:'+effectiveduration_vip+'</p>'
|
|
|
+ +'</div>'
|
|
|
+ +'</a>'
|
|
|
+ +'<div class="price">'
|
|
|
+ +'<strong class="current">¥'+orderMoney_vip+'</strong>'
|
|
|
+'</div>'
|
|
|
- +'<div class="card-content">'
|
|
|
- +'<a eid='+orderCode_vip+' class="media" isvipOrder="true">'
|
|
|
- +'<div class="media-img">'
|
|
|
- +'<img src="/vipsubscribe/image/vip_order.png">'
|
|
|
- +'</div>'
|
|
|
- +'<div class="media-info">'
|
|
|
- +'<p class="item-ifo ellipsis">区域:'+ region_vip+'</p>'
|
|
|
- +'<p class="item-ifo ellipsis">行业:'+ industry_vip +'行业</p>'
|
|
|
- +'<p class="item-ifo ellipsis">订阅周期:'+effectiveduration_vip+'</p>'
|
|
|
- +'<p class="item-ifo ellipsis">有效日期:'+effectivetime_vip+'</p>'
|
|
|
+ +'</div>'
|
|
|
+ +iconHtml
|
|
|
+ +'</div>'
|
|
|
+ }else{
|
|
|
+ //有效时间
|
|
|
+ var starttime_vip= obj.vip_starttime+"";
|
|
|
+ var endtime_vip= obj.vip_endtime+"";
|
|
|
+ starttime_vip= starttime_vip.split(" ")[0].replace(/-/g,".")
|
|
|
+ endtime_vip= endtime_vip.split(" ")[0].replace(/-/g,".")
|
|
|
+ var effectivetime_vip =starttime_vip+"-"+endtime_vip;
|
|
|
+ //已完成
|
|
|
+ listhtml+='<div class="card">'
|
|
|
+ +'<div class="card-header">'
|
|
|
+ +'<span class="time" style="color:#888888">'+createTime_vip+'</span>'
|
|
|
+ +orderHtml
|
|
|
+ +'</div>'
|
|
|
+ +'<div class="card-content">'
|
|
|
+ +'<a eid='+orderCode_vip+' class="media" isvipOrder="true">'
|
|
|
+ +'<div class="media-img">'
|
|
|
+ +'<img src="/vipsubscribe/image/vip_order.png">'
|
|
|
+ +'</div>'
|
|
|
+ +'<div class="media-info">'
|
|
|
+ +'<p class="item-ifo ellipsis">区域:'+ region_vip+'</p>'
|
|
|
+ +'<p class="item-ifo ellipsis">行业:'+ industry_vip +'</p>'
|
|
|
+ +'<p class="item-ifo ellipsis">订阅周期:'+effectiveduration_vip+'</p>'
|
|
|
+ +'<p class="item-ifo ellipsis">有效日期:'+effectivetime_vip+'</p>'
|
|
|
+ +'</div>'
|
|
|
+ +'</a>'
|
|
|
+ +'<div class="price">'
|
|
|
+ +'<strong class="current">¥'+orderMoney_vip+'</strong>'
|
|
|
+'</div>'
|
|
|
- +'</a>'
|
|
|
- +'<div class="price">'
|
|
|
- +'<strong class="current">¥'+orderMoney_vip+'</strong>'
|
|
|
+'</div>'
|
|
|
- +'</div>'
|
|
|
- +iconHtml
|
|
|
- +'</div>'
|
|
|
- }
|
|
|
- } //else if ..end
|
|
|
- }
|
|
|
+ +iconHtml
|
|
|
+ +'</div>'
|
|
|
+ }
|
|
|
+ } //else if ..end
|
|
|
+ } //for ..end
|
|
|
|
|
|
appendList($(listhtml));
|
|
|
}
|