|
@@ -244,7 +244,7 @@
|
|
|
});
|
|
|
}
|
|
|
//调用微信支付接口
|
|
|
- var payArr=new Array(); //用来存储已支付的index
|
|
|
+ var payArr=new Array(); //用来存储已支付的index
|
|
|
function onBridgeReady(res,e){
|
|
|
WeixinJSBridge.invoke('getBrandWCPayRequest',{
|
|
|
"appId": res["appId"],
|
|
@@ -269,14 +269,46 @@
|
|
|
},500)
|
|
|
}else if(r.err_msg == "get_brand_wcpay_request:cancel"){
|
|
|
//取消支付 可以再次支付
|
|
|
- canpay=true;
|
|
|
isReqing = false;
|
|
|
}else{
|
|
|
EasyAlert.show("系统异常,请稍微再试","",3000);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- //
|
|
|
+
|
|
|
+ //调用微信支付接口
|
|
|
+ function onBridgeReady_vip(res,ordercode){
|
|
|
+ WeixinJSBridge.invoke('getBrandWCPayRequest',{
|
|
|
+ "appId": res["appId"],
|
|
|
+ "timeStamp": res["timestamp"],
|
|
|
+ "nonceStr": res["nonceStr"],
|
|
|
+ "package": res["prepayId"],
|
|
|
+ "signType": res["signType"],
|
|
|
+ "paySign": res["sign"]
|
|
|
+ },
|
|
|
+ function(r){
|
|
|
+ if(r.err_msg == "get_brand_wcpay_request:ok"){
|
|
|
+ setTimeout(function(){
|
|
|
+ window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
|
|
|
+ },500)
|
|
|
+ }else if(r.err_msg == "get_brand_wcpay_request:cancel"){
|
|
|
+ //取消支付 可以再次支付
|
|
|
+ canpay=true;
|
|
|
+ alert("开发环境【支付跳转完成】")
|
|
|
+ try{
|
|
|
+ window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
|
|
|
+ }catch(e){
|
|
|
+ alert(e)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ weui.toast("系统异常,请稍微再试",{
|
|
|
+ duration: 2000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //移动端数据导出支付
|
|
|
var isReqing = false;
|
|
|
var gopayIndex = 0;
|
|
|
function goPay(e){
|
|
@@ -298,6 +330,20 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ //vip订单支付
|
|
|
+ var canpay=true;
|
|
|
+ function goVipPay(e){
|
|
|
+ var orderCode =$(e).attr("orderCode");
|
|
|
+ if(!canpay)return
|
|
|
+ canpay=false;
|
|
|
+ $.post("/subscribepay/vipsubscribe/orderToPay",{"orderCode":orderCode},function(r){
|
|
|
+ if(r.success){
|
|
|
+ onBridgeReady_vip(JSON.parse(r.data.res),orderCode);
|
|
|
+ }else{
|
|
|
+ canpay=true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
//提示框
|
|
|
var EasyAlert = {
|
|
|
timeout: null,
|
|
@@ -321,34 +367,7 @@
|
|
|
}
|
|
|
}
|
|
|
//
|
|
|
- function getOneMore(gopayIndex){
|
|
|
- $.post("/front/wxMyorder/getOneMore",{"pageNum":pageIndex,"tabType":typ},function(data){
|
|
|
- //更改缓存
|
|
|
- dataCache.splice(gopayIndex,1)
|
|
|
- if(data.res!=null){
|
|
|
- dataCache.push(data.res[0])
|
|
|
- hasNextPage=data.nextPage;
|
|
|
- }
|
|
|
- if(data.res!=""){
|
|
|
- var res = data.res[0]
|
|
|
- var oneMHtml = '<div class="card"><div class="card-header">'
|
|
|
- +'<span class="time" style="color:#888888">'+res.create_time+'</span>'
|
|
|
- +'<span class="status notpay">待付款</span></div>'
|
|
|
- +'<div class="card-content"><a eid="'+res.order_code+'" class="media">'
|
|
|
- +'<div class="media-img"><img src="/dataExport/image/historical_data.png"></div>'
|
|
|
- +'<div class="media-info">'
|
|
|
- +'<p class="item-ifo ellipsis">关键词:<span>'+res.filter_keys+' </span>'
|
|
|
- +'</p><p class="item-ifo ellipsis">数据量:'+res.data_count+'条</p>'
|
|
|
- +'<p class="item-ifo ellipsis">数据规格:'+res.data_spec+'</p>'
|
|
|
- +'<p class="item-ifo ellipsis">筛选日期:'+res.filter_publishtime+'</p></div></a>'
|
|
|
- +'<div class="price"><strong class="current">¥'+res.order_money+'</strong>'
|
|
|
- +'</div></div><div class="card-footer">'
|
|
|
- +'<a class="btn cancle" onclick="deleteOrder('+res.id+',this)">取消订单</a>'
|
|
|
- +'<a href="javascript:void(0)" onclick="goPay(this)" class="btn pay" filterid="'+res.filter_id+'" token="'+res.token+'" id="'+res.id+'">去支付</a></div></div>'
|
|
|
- appendList($(oneMHtml));
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -587,7 +606,7 @@
|
|
|
typ=$("ul .active").index();
|
|
|
$(".card_lists").empty();
|
|
|
$("body").scrollTop(0);
|
|
|
- queryOrder(index)
|
|
|
+ queryOrder(index);
|
|
|
})
|
|
|
})
|
|
|
|
|
@@ -630,48 +649,49 @@
|
|
|
nodataHtml+='<div style="color: #888;font-size: .32rem;text-align:center;">暂无数据</div></div>'
|
|
|
$(".card_lists").append(nodataHtml);
|
|
|
}
|
|
|
- })
|
|
|
- setTimeout(function(){
|
|
|
- //return 的是 暂无数据的情况noDataHtml
|
|
|
- if(!result){
|
|
|
- $(".dropload-down").hide()
|
|
|
- return
|
|
|
- }
|
|
|
- if(hasNextPage){
|
|
|
- wxflag = $(' .main').dropload({
|
|
|
- scrollArea : $(".main"),
|
|
|
- loadDownFn : function(me){
|
|
|
- $.post('/subscribepay/orderListDetails/myOrderPaging', {"pageNum": pageIndex,"type":typ},function(data){
|
|
|
- //没有数据
|
|
|
- if(data.res==null||data.res.length==0){
|
|
|
- noMoreData(me);
|
|
|
- }else{
|
|
|
- dataCache=dataCache.concat(data.res);
|
|
|
- pageIndex++;
|
|
|
- structureHtml(data.res);
|
|
|
- if(data.hasNextPage){
|
|
|
- // 每次数据插入,必须重置
|
|
|
- me.resetload();
|
|
|
- }else{
|
|
|
- noMoreData(me);
|
|
|
- }
|
|
|
+
|
|
|
+ setTimeout(function(){
|
|
|
+ //return 的是 暂无数据的情况noDataHtml
|
|
|
+ if(!result){
|
|
|
+ $(".dropload-down").hide()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(hasNextPage){
|
|
|
+ wxflag = $(' .main').dropload({
|
|
|
+ scrollArea : $(".main"),
|
|
|
+ loadDownFn : function(me){
|
|
|
+ $.post('/subscribepay/orderListDetails/myOrderPaging', {"pageNum": pageIndex,"type":typ},function(data){
|
|
|
+ //没有数据
|
|
|
+ if(data.res==null||data.res.length==0){
|
|
|
+ noMoreData(me);
|
|
|
+ }else{
|
|
|
+ dataCache=dataCache.concat(data.res);
|
|
|
+ pageIndex++;
|
|
|
+ structureHtml(data.res);
|
|
|
+ if(data.hasNextPage){
|
|
|
+ // 每次数据插入,必须重置
|
|
|
+ me.resetload();
|
|
|
+ }else{
|
|
|
+ noMoreData(me);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ wxflag = $('.main').dropload({
|
|
|
+ scrollArea : window,
|
|
|
+ loadDownFn : function(me){
|
|
|
+ if(wxflag == null){
|
|
|
+ wxflag = me;
|
|
|
}
|
|
|
- });
|
|
|
+ noMoreData(me);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ noMoreData(wxflag);
|
|
|
}
|
|
|
- });
|
|
|
- }else{
|
|
|
- wxflag = $('.main').dropload({
|
|
|
- scrollArea : window,
|
|
|
- loadDownFn : function(me){
|
|
|
- if(wxflag == null){
|
|
|
- wxflag = me;
|
|
|
- }
|
|
|
- noMoreData(me);
|
|
|
- }
|
|
|
- });
|
|
|
- noMoreData(wxflag);
|
|
|
- }
|
|
|
- },500)
|
|
|
+ },500)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function structureHtml(object){
|
|
@@ -817,16 +837,39 @@
|
|
|
var region_vip=""
|
|
|
var province_length=0;
|
|
|
var city_length=0;
|
|
|
- for( i in region_vipArr){
|
|
|
- if(region_vipArr[i].length==0){
|
|
|
- province_length++;
|
|
|
- }else{
|
|
|
- city_length+=region_vipArr[i].count;
|
|
|
+// for( i in region_vipArr){
|
|
|
+// var region_vipArr_i =region_vipArr[i];
|
|
|
+// if(region_vipArr_i.count==undefined){
|
|
|
+// province_length++;
|
|
|
+// }else{
|
|
|
+// city_length+=region_vipArr_i.count;
|
|
|
+// }
|
|
|
+// }
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- region_vip=province_length+"个省级区域、"+city_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.count; //数组
|
|
|
+ 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:天
|
|
|
//订阅周期
|
|
@@ -871,7 +914,7 @@
|
|
|
iconHtml=""
|
|
|
iconHtml+='<div class="card-footer">'
|
|
|
+'<a class="btn cancle" onclick="cancelOrder('+id_vip+',this)">取消订单</a>'
|
|
|
- +'<a href="javascript:void(0)" onclick="goPay(this)" class="btn pay" filterid="'+obj.filter_id+'" token="'+token_vip+'" id="'+id_vip+'">去支付</a>'
|
|
|
+ +'<a href="javascript:void(0)" onclick="goVipPay(this)" class="btn pay" filterid="'+obj.filter_id+'" token="'+token_vip+'" id="'+id_vip+'" orderCode='+orderCode_vip+'>去支付</a>'
|
|
|
+'</div>'
|
|
|
}else if(orderStatus_vip==1){
|
|
|
orderStatus_vip="已完成";
|
|
@@ -913,7 +956,7 @@
|
|
|
+'</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">行业:'+ industry_vip +'行业</p>'
|
|
|
+'<p class="item-ifo ellipsis">订阅周期:'+effectiveduration_vip+'</p>'
|
|
|
+'</div>'
|
|
|
+'</a>'
|