浏览代码

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

wangshan 5 年之前
父节点
当前提交
f2c414782d

+ 9 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/choose_area_upgrade.html

@@ -13,7 +13,8 @@
     <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" href="/jyapp/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="/jyapp/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}4">
-	{{include "/common/weixin.html"}}
+	<link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
+	<link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
 </head>
 <style type="text/css">
 	body,html {
@@ -21,6 +22,11 @@
 	}
 </style>
 <body>
+	<div class="app-layout-header">
+        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+        区域选择
+    </div>
+    <div class="app-layout-content-b">
     <div id="choose_area" >
         <div class="result">
             <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
@@ -387,10 +393,12 @@
             <a href="javascript:;">Z</a>
         </div>
     </div>
+    </div>
     <script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
     <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="/jyapp/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
     <script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
+    <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script>
     	//已购买
     	var buystr = "";

+ 9 - 2
src/jfw/modules/app/src/web/templates/vipsubscribe/choose_industry_upgrade.html

@@ -11,8 +11,8 @@
         <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
         <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
         <link rel="stylesheet" href="/jyapp/vipsubscribe/css/choose_industry.css?v={{Msg "seo" "version"}}3">
-        {{include "/common/weixin.html"}}
-        
+		<link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
+	    <link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
     </head>
     <style type="text/css">
     	body,html {
@@ -20,6 +20,11 @@
 		}
     </style>
     <body>
+    	<div class="app-layout-header">
+	        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+	        行业选择
+	    </div>
+	    <div class="app-layout-content-b">
         <main class="choose_industry main">
             <div class="result">
                 <span class="label">已新增:</span>
@@ -247,10 +252,12 @@
                 </div>
             </div>
         </main>
+        </div>
         <script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></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"}}"></script>
+        <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
         <script>
            //
            // 点击导航跳转

+ 12 - 8
src/jfw/modules/app/src/web/templates/vipsubscribe/renew_notice.html

@@ -9,7 +9,8 @@
 		<link rel="stylesheet" href="/jyapp/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
 		<link rel="stylesheet" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
 		<link rel="stylesheet" href="/jyapp/vipsubscribe/css/vip_service_expire.css?v={{Msg "seo" "version"}}1">
-		{{include "/common/weixin.html"}}
+		<link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
+    	<link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
 	</head>
 	<style type="text/css">
 		body,html {
@@ -17,6 +18,11 @@
 		}
 	</style>
 	<body>
+		<div class="app-layout-header">
+	        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+	        VIP订阅
+	    </div>
+	    <div class="app-layout-content-b">
 		<div class="vip_service_expire layout_top-bottom">
 			<div class="service_expire_tip layou_top">
                 <div class="tip_title_box">
@@ -50,11 +56,13 @@
                 <button style="display: none;" class="renew_service" onclick="window.location.href='/jyapp/vipsubscribe/renewPayPage'">续费</button>
                 <button style="display: none;" class="free_service" onclick="window.location.href='/jyapp/swordfish/historypush'">使用免费订阅</button>
             </div>
+		</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"}}"></script>
+		<script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
 		<script type="text/javascript">
 			//
 			var orderId = {{.T.orderId}};
@@ -189,13 +197,9 @@
 					    	$(".date-span").text(dateHtml);
 					    }
 					    if(exprie === "will"){
-					    	let a = (endstime/1000) - (86400 * 3)
-					    	let b = nowTime/1000
-					    	if(b > a){
-					    		$(".renew_service").show();
-						    	$("#exprie").text("VIP订阅服务即将到期,请及时续费")
-						    	$(".recommend_title").text("以下区域、行业的订阅推送即将停止,为了不影响您的使用,请立即续费!")
-					    	}
+				    		$(".renew_service").show();
+					    	$("#exprie").text("VIP订阅服务即将到期,请及时续费")
+					    	$(".recommend_title").text("以下区域、行业的订阅推送即将停止,为了不影响您的使用,请立即续费!")
 					    }else{
 					    	$(".renew_service").show();
 					    	$(".free_service").show();

+ 102 - 109
src/jfw/modules/app/src/web/templates/vipsubscribe/renew_pay.html

@@ -14,7 +14,8 @@
     <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" href="/jyapp/vipsubscribe/css/vip_update.css?v={{Msg "seo" "version"}}5">
-	{{include "/common/weixin.html"}}
+	<link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
 </head>
 <style type="text/css">
 	body,html {
@@ -25,12 +26,17 @@
 	}
 	.vip_update .fixed-bottom-box, .vip_renew .fixed-bottom-box {
 	    width: 100%;
-	    position: fixed;
+	    position: static;
 	    bottom: 0;
 	    left: 0;
 	}
 </style>
 <body class="no-touch">
+	<div class="app-layout-header">
+        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+        VIP订阅续费
+    </div>
+    <div class="app-layout-content-b">
     <div class="vip_renew">
         <div class="choose_condition">
              <!-- 正常点击vip首页续费进入显示下列提示 -->
@@ -185,7 +191,7 @@
                                 <p><img src="/jyapp/vipsubscribe/image/weixin.png">微信支付</p>
                             </div>
                             <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked />
+                                <input type="radio" class="weui-check paytypes" name="way" value="微信支付" id="wx" checked />
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
@@ -194,7 +200,7 @@
                                 <p><img src="/jyapp/vipsubscribe/image/zhifubao.png">支付宝支付</p>
                             </div>
                             <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb" />
+                                <input type="radio" class="weui-check paytypes" name="way" value="支付宝支付" id="zfb" />
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
@@ -203,73 +209,12 @@
             </div>
         </div>
     </div>
+    </div>
     <script src="/vipsubscribe/js/jquery-2.1.4.js"></script>
     <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}4"></script>
     <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="https://res.wx.qq.com/open/libs/weuijs/1.1.4/weui.min.js?v={{Msg "seo" "version"}}"></script>
-    <script type="text/javascript">
-    	//
-    	try{
-			var signature = {{.T.signature}};
-			var isConfigSuccess = true;
-			var id = {{.T._id}}
-			if(signature && signature.length == 4){
-			  	wx.config({
-			  	    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-			  	    appId: signature[0], // 必填,公众号的唯一标识
-			  	    timestamp:signature[1], // 必填,生成签名的时间戳
-			  	    nonceStr: signature[2], // 必填,生成签名的随机串
-			  	    signature: signature[3],// 必填,签名,见附录1
-			  	    jsApiList: ['chooseWXPay','hideAllNonBaseMenuItem'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-			  	});
-			  	wx.ready(function(){
-			  		if(!isConfigSuccess){
-			  			return;
-			  		}
-			  		wx.hideAllNonBaseMenuItem();
-			    });
-			  	wx.error(function(res){
-			  	    //config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
-			  		//alert(res);
-			  		isConfigSuccess = false;
-			  	});
-			}
-			//调用微信支付接口
-  			function onBridgeReady(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("/jyapp/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-						},500)
-					}	
-//					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-////	                	alert("开发环境【支付跳转完成】")
-//		                try{
-////		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-////		                    window.location.reload();
-//		                }catch(e){
-//		                  alert(e)
-//		                }
-//	  				}else{
-//	                	weui.toast("系统异常,请稍微再试",{
-//	                  		duration: 2000,
-//	                  		className: 'custom-toast',
-//	                	});
-//	  				}
-  				});
-  			}   
-		}catch(e){
-		  console.log(e)
-		}
-    </script>
+    <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script>
     	$(function () {    
 			var isPageHide = false;   
@@ -292,6 +237,16 @@
 
         // 选择订阅周期
         $('.select_cycle > a').click(function () {
+        	if((nowUpgrade)>=36){
+            	var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowUpgrade}个月`
+		        weui.toast(overtimeWarning, {
+		            duration: 3000,
+		            className: 'custom-toast',
+		            callback: function() {
+		            }
+		        })
+		        return
+            }
             $('#time_cycle').show(200);
         })
         // 选择支付方式
@@ -366,6 +321,16 @@
                 currentNum = currentNum <= data.numboxMin ? data.numboxMin : currentNum - data
                     .numboxStep;
             }
+            if((currentNum+nowUpgrade)>36){
+            	var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowUpgrade}个月`
+		        weui.toast(overtimeWarning, {
+		            duration: 3000,
+		            className: 'custom-toast',
+		            callback: function() {
+		            }
+		        })
+		        return
+            }
             if (currentNum >= 10) {
             	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”更划算哦~");
                 $('.profit_tips').show();
@@ -406,8 +371,17 @@
 
        /* -------- 控制年份number_box的事件  点击1年 2年 3年触发的事件------- */
         $('#number_box_year').on('click', 'span', function (e) {
-            console.log(e.target.dataset.id)
             let id = e.target.dataset.id;
+            if((id*12+nowUpgrade)>36){
+            	var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowUpgrade}个月`
+		        weui.toast(overtimeWarning, {
+		            duration: 3000,
+		            className: 'custom-toast',
+		            callback: function() {
+		            }
+		        })
+		        return
+            }
             $('.profit_tips').hide()
             $('#number_box_month').removeClass('active');
             $(this).addClass('active').siblings().removeClass('active')
@@ -543,9 +517,12 @@
 	    	}else if(payType === "alipy"){
 	    		payHtml = "支付宝支付";
 	    	}
-	    	$('input:radio[name="way"]').val(payHtml);
-	    	$('input:radio[name="way"]').prop("checked", true);
-	    	$("#payType").text(payHtml);
+	    	$(".paytypes").each(function(){
+	    		if($(this).attr("value") === payHtml){
+	    			$(this).prop("checked", true);
+	    		}
+	    	});
+	    	$(".weixin_pay").text(payHtml);
 	    }
         
         //
@@ -629,14 +606,10 @@
 			    	$(".item_validity .label_for").text(dateHtml);
 			    }
 			    if(starts !== "" && ends !== ""){
-			    	let end = new Date(ends*1000).toLocaleDateString();
-			    	let endtime = end.split("/");
-			    	let endYear = Number(endtime[0]);
-			    	let endMonth = Number(endtime[1]);
-			    	let start = new Date(starts*1000).toLocaleDateString();
-			    	let starttime = start.split("/");
-			    	let startYear = Number(starttime[0]);
-			    	let startMonth = Number(starttime[1]);
+			    	let endYear = new Date(ends*1000).getFullYear();
+			    	let endMonth = new Date(ends*1000).getMonth()+1;
+			    	let startYear = new Date(starts*1000).getFullYear();
+			    	let startMonth = new Date(starts*1000).getMonth()+1;
 			    	let year = "";
 			    	let month = "";
 			    	if(endYear > startYear){
@@ -684,17 +657,13 @@
 		    }
         }, false);
         //
-        var nowDate = new Date(startTime).toLocaleDateString();
-		nowDate = nowDate.split("/");
-		var nowMonth = Number(nowDate[1]);
-		var nowYear = Number(nowDate[0]);
-		var nowDay = Number(nowDate[2]);
+		var nowMonth = new Date(startTime).getMonth()+1;
+		var nowYear = new Date(startTime).getFullYear();
+		var nowDay = new Date(startTime).getDate();
 		//
-		var endDate = new Date(endTime).toLocaleDateString();
-		endDate = endDate.split("/");
-		var endMonth = Number(endDate[1]);
-		var endYear = Number(endDate[0]);
-		var endDay = Number(endDate[2]);
+		var endMonth = new Date(endTime).getMonth()+1;
+		var endYear = new Date(endTime).getFullYear();
+		var endDay = new Date(endTime).getDate();
 		var nowUpgrade = 0;
 		if(endYear === nowYear){
 			if(endMonth === nowMonth){
@@ -773,7 +742,6 @@
 	    }
 	    //
 	    $(".save_renew").on("click", function(){
-	    	console.log(nowUpgrade)
 //	    	let times = $('.choose_item.select_cycle .info').attr('placeholder');
 	    	let times = $('.choose_item.select_cycle .info').val();
 	        if (times.match("月") !== null){
@@ -781,35 +749,43 @@
 	        }else if (times.match("年") !== null){
 	        	times = 12 * Number(times.replace("年",""));
 	        }
-	    	// 当续费时间 + 当前已经买的时间超过36个月,给出提醒
-	    	if(times > 36-nowUpgrade){
-	    		var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowUpgrade}个月`
-		        weui.toast(overtimeWarning, {
-		            duration: 3000,
-		            className: 'custom-toast',
-		            callback: function() {
-		   
-		            }
-		        })
-		        return
-	    	}
+	    	//
+	    	let payTypes = sessionStorage.payTypes;
+            let payType = "";
+            if(payTypes === "wx"){
+            	payType = "wx_app";
+            }else if(payTypes === "alipy"){
+            	payType = "alipy_app";
+            }
 	        $(".save_renew").attr("disabled","disabled");
 	    	var param = {
 	    		"area": JSON.stringify(area),
 	    		"industry": buyerclass.toString(),
 	    		"time": $('.choose_item.select_cycle .info').val(),
-	    		"payWay":"wx_js",
+	    		"payWay":payType,
 	    		"pay_source": "Renew",
 	    		"endtime": ends,
 	    	}
 	    	console.log(param)
-	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
-                if(r.success){
+	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder", param, function (r) {
+                if (r.success) {
+                    //唤起app支付
+                    try {
+                        if (pay_way == "wx_app") {
+                            JyObj.wxPay(r.data.res);
+                        } else {
+                            JyObj.aliPay(r.data.res)
+                        }
+                        //校验是否支付完成
+                        checkpay(r.data.code);
+                    } catch (e) {
+                        alert(e)
+                    }
                     clearSessionStorage();
-                    onBridgeReady(JSON.parse(r.data.res),r.data.code);
+                } else {
+                    $(".save_renew").removeAttr("disabled")
                 }
-                $(".save_renew").removeAttr("disabled");
-            })
+            });
 	    });
 	    
 	    //
@@ -820,7 +796,24 @@
 	    	sessionStorage.removeItem("renew_finally_price");
 	    	sessionStorage.removeItem("buyChecks");
 	    }
-	    
+	    //
+	    //校验是否支付
+	    var interval;
+	
+	    function checkpay(orderid) {
+	        if (interval) {
+	            clearInterval(interval);
+	        }
+	        interval = setInterval(function () {
+	            $.post("/jypay/isPaySuccess", {code: orderid}, function (r) {
+	                if (r.success) {
+	                    clearInterval(interval);
+	                    clearSessionStorage();
+	                    window.location.replace("/jyapp/vipsubscribe/toPaySuccessPage?orderCode=" + orderid);
+	                }
+	            });
+	        }, 2000)
+	    }
 	    //
 	    function checkObj(obj) {
 		    //检验数组

+ 75 - 100
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_upgrade.html

@@ -15,7 +15,8 @@
     <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" href="/jyapp/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="/jyapp/vipsubscribe/css/vip_update.css?v={{Msg "seo" "version"}}4">
-	{{include "/common/weixin.html"}}
+	<link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
 </head>
 <style type="text/css">
 	body,html {
@@ -26,18 +27,23 @@
 	}
 	.vip_update .fixed-bottom-box, .vip_renew .fixed-bottom-box {
 	    width: 100%;
-	    position: fixed;
+	    position: static;
 	    bottom: 0;
 	    left: 0;
 	}
 </style>
 <body class="no-touch">
+	<div class="app-layout-header">
+        <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+        VIP订阅升级
+    </div>
+    <div class="app-layout-content-b">
     <div class="vip_update">
         <div class="choose_condition">
             <p class="update_tip">提示:订阅升级可在已购买的服务基础上,增加区域、行业、以及延长订阅周期!</p>
             <ul class="chooseList">
                 <li class="choose_item">
-                    <a href="/jyapp/front/vipsubscribe/toChooseAreaUpgrade">
+                    <a href="/jyapp/vipsubscribe/toChooseAreaUpgrade">
                         <span class="label">区域</span>
                         <input type="text" id="area" value="" onfocus="this.blur();" placeholder="选择全国、省份、地市" class="info">
                         <i class="iconfont icon-arrow"></i>
@@ -45,7 +51,7 @@
                     <p class="add_tips area-list" style="display: none;">已新增 1 个省级区域、4 个地市</p>
                 </li>
                 <li class="choose_item">
-                    <a href="/jyapp/front/vipsubscribe/toChooseIndustryUpgrade">
+                    <a href="/jyapp/vipsubscribe/toChooseIndustryUpgrade">
                         <span class="label">行业</span>
                         <input type="text" id="buyerclass" onfocus="this.blur();" value="" placeholder="选择采购单位行业" class="info">
                         <i class="iconfont icon-arrow"></i>
@@ -282,7 +288,7 @@
                                 <p><img src="/jyapp/vipsubscribe/image/weixin.png">微信支付</p>
                             </div>
                             <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked />
+                                <input type="radio" class="weui-check paytypes" name="way" value="微信支付" id="wx" checked />
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
@@ -291,7 +297,7 @@
                                 <p><img src="/jyapp/vipsubscribe/image/zhifubao.png">支付宝支付</p>
                             </div>
                             <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb" />
+                                <input type="radio" class="weui-check paytypes" name="way" value="支付宝支付" id="zfb" />
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
@@ -300,75 +306,12 @@
             </div>
         </div>
     </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 type="text/javascript">
-    	//
-    	try{
-			var signature = {{.T.signature}};
-			var isConfigSuccess = true;
-			var id = {{.T._id}}
-			if(signature && signature.length == 4){
-			  	wx.config({
-			  	    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-			  	    appId: signature[0], // 必填,公众号的唯一标识
-			  	    timestamp:signature[1], // 必填,生成签名的时间戳
-			  	    nonceStr: signature[2], // 必填,生成签名的随机串
-			  	    signature: signature[3],// 必填,签名,见附录1
-			  	    jsApiList: ['chooseWXPay','hideAllNonBaseMenuItem'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-			  	});
-			  	wx.ready(function(){
-			  		if(!isConfigSuccess){
-			  			return;
-			  		}
-			  		wx.hideAllNonBaseMenuItem();
-			    });
-			  	wx.error(function(res){
-			  	    //config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
-			  		//alert(res);
-			  		isConfigSuccess = false;
-			  	});
-			}
-			//调用微信支付接口
-  			function onBridgeReady(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"){
-				    	//
-                    	clearSessionStorage();
-						setTimeout(function(){
-							window.location.replace("/jyapp/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-						},500)
-					}
-//					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-////	                	alert("开发环境【支付跳转完成】")
-//		                try{
-////		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-////		                	window.location.reload();
-//		                }catch(e){
-//		                  alert(e)
-//		                }
-//	  				}else{
-//	                	weui.toast("系统异常,请稍微再试",{
-//	                  		duration: 2000,
-//	                  		className: 'custom-toast',
-//	                	});
-//	  				}
-  				});
-  			}   
-		}catch(e){
-		  console.log(e)
-		}
-    </script>
+    <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script>
         $(function () {    
 			var isPageHide = false;   
@@ -444,10 +387,8 @@
          // 选择生效日期
         $('.choose_effect_date > a').click(function () {
             $('#effective_date').show(200);
-            var nowDates = new Date().toLocaleDateString();
-			nowDates = nowDates.split("/");
-			var nowMonths = Number(nowDates[1]);
-			var nowYears = Number(nowDates[0]);
+			var nowMonths = new Date().getMonth()+1;
+			var nowYears = new Date().getFullYear();
 			var as = nowMonths +1;
 			if(as > 12){
 				as = as-12;
@@ -839,9 +780,12 @@
 	    	}else if(payType === "alipy"){
 	    		payHtml = "支付宝支付";
 	    	}
-	    	$('input:radio[name="way"]').val(payHtml);
-	    	$('input:radio[name="way"]').prop("checked", true);
-	    	$("#payType").text(payHtml);
+	    	$(".paytypes").each(function(){
+	    		if($(this).attr("value") === payHtml){
+	    			$(this).prop("checked", true);
+	    		}
+	    	});
+	    	$(".weixin_pay").text(payHtml);
 	    }
 
 		if(sessionStorage.upgrade_cyclecount!==undefined&&sessionStorage.upgrade_cycleunit!==undefined){
@@ -952,17 +896,13 @@
         	$(".save_upgrade").attr('disabled','disabled');
 	    	var nowUpgrade = "";
 			//
-			var nowDate = new Date(startTime).toLocaleDateString();
-			nowDate = nowDate.split("/");
-			var nowMonth = Number(nowDate[1]);
-			var nowYear = Number(nowDate[0]);
-			var nowDay = Number(nowDate[2]);
+			var nowMonth = new Date(startTime).getMonth()+1;
+			var nowYear = new Date(startTime).getFullYear();
+			var nowDay = new Date(startTime).getDate();
 			//
-			var endDate = new Date(endTime).toLocaleDateString();
-			endDate = endDate.split("/");
-			var endMonth = Number(endDate[1]);
-			var endYear = Number(endDate[0]);
-			var endDay = Number(endDate[2]);
+			var endMonth = new Date(endTime).getMonth()+1;
+			var endYear = new Date(endTime).getFullYear();
+			var endDay = new Date(endTime).getDate();
 			var oldPrice = "";
 			var price = "";
 			var effect = "";
@@ -1235,13 +1175,11 @@
         	let effective = $("#effect_date_name").text();
         	var effect = "now";
         	if(effective !== "立即生效,需支付当月费用差价"){
-        		let nowDate = new Date().toLocaleDateString();
-				nowDate = nowDate.split("/");
-				let nowMonth = Number(nowDate[1]);
-				let nowYear = Number(nowDate[0]);
+				let nowMonth = new Date().getMonth()+1;
+				let nowYear = new Date().getFullYear();
 				let a = nowMonth +1
         		if(a > 12){
-        			a = nowMonth-12;
+        			a = a-12;
         			nowYear = nowYear +1;
         		}
         		let b = nowYear+"/"+a+"/1";
@@ -1266,25 +1204,46 @@
             if(renew_time !== "不延长"){
             	times = $('.choose_item.lengthen .info').text();
             }
+            //
+            let payTypes = sessionStorage.payType;
+            let payType = "";
+            if(payTypes === "wx"){
+            	payType = "wx_app";
+            }else if(payTypes === "alipy"){
+            	payType = "alipy_app";
+            }
             //
 	    	var param = {
 	    		"area": JSON.stringify(areas),
 	    		"industry": industrys.join(","),
 	    		"areas": JSON.stringify(areaarr),
 	    		"industryarr": industryarr.join(","),
-	    		"payWay": "wx_js",
+	    		"payWay": payType,
 	    		"effect": effect,
 	    		"pay_source" : "Upgrade",
 	    		"time": times,
 	    		"nowUp": Number(nowRenew),
 	    	}
 	    	console.log(param)
-	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
-                if(r.success){
-                    onBridgeReady(JSON.parse(r.data.res),r.data.code);
+	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder", param, function (r) {
+                if (r.success) {
+                    //唤起app支付
+                    try {
+                        if (pay_way == "wx_app") {
+                            JyObj.wxPay(r.data.res);
+                        } else {
+                            JyObj.aliPay(r.data.res)
+                        }
+                        //校验是否支付完成
+                        checkpay(r.data.code);
+                    } catch (e) {
+                        alert(e)
+                    }
+                    clearSessionStorage();
+                } else {
+                    $(".save_upgrade").removeAttr("disabled")
                 }
-                $(".save_upgrade").removeAttr("disabled");
-            })
+            });
 	    });
 	    
 	    //
@@ -1298,8 +1257,24 @@
 	    	sessionStorage.removeItem("effectiveDate");
 	    	sessionStorage.removeItem("buyCheck");
 	    }
-	    
 	    //
+	    //校验是否支付
+	    var interval;
+	
+	    function checkpay(orderid) {
+	        if (interval) {
+	            clearInterval(interval);
+	        }
+	        interval = setInterval(function () {
+	            $.post("/jypay/isPaySuccess", {code: orderid}, function (r) {
+	                if (r.success) {
+	                    clearInterval(interval);
+	                    clearSessionStorage();
+	                    window.location.replace("/jyapp/vipsubscribe/toPaySuccessPage?orderCode=" + orderid);
+	                }
+	            });
+	        }, 2000)
+	    }
 	    //
 	    function checkObj(obj) {
 		    //检验数组

+ 4 - 4
src/jfw/modules/pushsubscribe/src/match/job/matchjob.go

@@ -203,7 +203,7 @@ func (m *MatchJob) ToMatch(batchIndex int, matcher Matcher, datas *[]map[string]
 				"vipstatus":     user.VipStatus,
 			})
 			if len(saveBatch) == BulkSize {
-				mongodb.SaveBulk(Pushspace_project, saveBatch...)
+				mongodb.SaveBulk(Pushspace_temp, saveBatch...)
 				saveBatch = []map[string]interface{}{}
 			}
 		}(u, i)
@@ -277,7 +277,7 @@ func (m *MatchJob) ToRelationProject(projectUser *sync.Map) {
 							"infoid":     _id,
 							"userid":     user.Id,
 							"maxid":      list_last_infoid,
-							"toptypes":   user.O_vipjy.TopTypes,
+							"subtypes":   user.O_vipjy.SubTypes,
 							"createtime": time.Now().Unix(),
 						},
 					},
@@ -322,7 +322,7 @@ func (m *MatchJob) LoadBidding(lastId, newId string, lastTime int64) *[]map[stri
 		c_query["_id"] = idQuery
 	}
 	//c_query = map[string]interface{}{
-	//"_id": bson.ObjectIdHex("5da4c4dfa5cb26b9b7ffdc5d"),
+	//"_id": bson.ObjectIdHex("5da6c3bda5cb26b9b7da1ffe"),
 	//}
 	logger.Info("开始加载", Bidding, "数据", c_query)
 	var res []map[string]interface{}
@@ -571,7 +571,7 @@ func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *string) (int, *VipU
 						if s_v == "" {
 							continue
 						}
-						user.O_vipjy.TopTypes = append(user.O_vipjy.TopTypes, s_v)
+						user.O_vipjy.SubTypes = append(user.O_vipjy.SubTypes, s_v)
 						vipUser.Add(s_v, user, &vipUser.InfoTypeUsers)
 					}
 				}

+ 2 - 2
src/jfw/modules/pushsubscribe/src/match/matcher/vipmatch.go

@@ -41,7 +41,7 @@ func (v *VipUser) Match(info *map[string]interface{}) (*map[*UserInfo]*MatchUser
 		area = ""
 	}
 	city, _ := (*info)["city"].(string)
-	toptype, _ := (*info)["toptype"].(string)
+	subtype, _ := (*info)["subtype"].(string)
 	title, _ := (*info)["title"].(string)
 	title = strings.ToUpper(title)
 	//订阅词
@@ -92,7 +92,7 @@ func (v *VipUser) Match(info *map[string]interface{}) (*map[*UserInfo]*MatchUser
 		if k.O_vipjy.ProjectMatch == 1 {
 			projectUsers = append(projectUsers, k)
 		}
-		if !v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[toptype][k] {
+		if !v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[subtype][k] {
 			continue
 		}
 		users[k] = matchUser

+ 1 - 1
src/jfw/modules/pushsubscribe/src/public/entity.go

@@ -40,7 +40,7 @@ type O_jy struct {
 	Infotype map[string]map[string]bool //关键词-信息类型
 }
 type O_vipjy struct {
-	TopTypes     []string
+	SubTypes     []string
 	ProjectMatch int
 }
 

+ 8 - 8
src/jfw/modules/pushsubscribe/src/push/job/projectjob.go

@@ -80,11 +80,11 @@ func (p *ProjectPushJob) Execute() {
 						if !ok {
 							return
 						}
-						topTypes, _ := list[i]["toptypes"].([]interface{})
+						subtypes, _ := list[i]["subtypes"].([]interface{})
 						maxId, _ := list[i]["maxid"].(string)
-						userTopType := map[string]bool{}
-						for _, t := range topTypes {
-							userTopType[util.ObjToString(t)] = true
+						userSubtype := map[string]bool{}
+						for _, t := range subtypes {
+							userSubtype[util.ObjToString(t)] = true
 						}
 						//
 						project, _ := pi.(map[string]interface{})
@@ -100,8 +100,8 @@ func (p *ProjectPushJob) Execute() {
 							if unix-publishtime > Config.ProjectPublishTimeLimit { //发布时间7天之内
 								continue
 							}
-							topType, _ := plm["toptype"].(string)
-							if len(userTopType) > 0 && !userTopType[topType] {
+							subtype, _ := plm["subtype"].(string)
+							if len(userSubtype) > 0 && !userSubtype[subtype] {
 								continue
 							}
 							isExists, err := redis.Exists(Pushcache_2_a, PushInfoKey(userId, infoId))
@@ -140,7 +140,7 @@ func (p *ProjectPushJob) Execute() {
 						}
 					}
 					if len(updateProject) > 0 {
-						mongodb.NewUpdateBulk(Pushspace_project, updateProject...)
+						mongodb.NewUpdateBulk(Pushspace_project, true, true, updateProject...)
 					}
 					if len(updateProject) < BigBulkSize {
 						break
@@ -220,7 +220,7 @@ func (p *ProjectPushJob) loadPushspace_project(batchIndex int, startId *string)
 	it := sess.DB(DbName).C(Pushspace_project).Find(query).Select(map[string]interface{}{
 		"_id":       1,
 		"maxid":     1,
-		"toptypes":  1,
+		"subtypes":  1,
 		"userid":    1,
 		"projectid": 1,
 	}).Sort("-_id", "userid").Iter()

+ 149 - 63
src/web/templates/weixin/email/bind_email.html

@@ -3,7 +3,7 @@
 	<head>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		{{if .T.text_email}}
-		<title>修改邮箱</title>
+		<title>更换邮箱</title>
 		{{else}}
 		<title>我的邮箱</title>
 		{{end}}
		<meta name="Keywords" content="绑定邮箱"/>
		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxmyemail/css/reset.css?v={{Msg "seo" "version"}}">
		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxmyemail/css/common.css?v={{Msg "seo" "version"}}">
		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxmyemail/css/mine.css?v={{Msg "seo" "version"}}"/>        
@@ -12,7 +12,8 @@
 		{{include "/common/weixin.html"}}
 		<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
 	</head>
-	<body>
+	<body style="visibility:hidden">
+		<!--<body>-->
 		<style>
 			.code_true{
 				position: absolute;
@@ -27,34 +28,105 @@
 			.email_input,.code_input{
 				line-height: 20px !important;
 			}
+			body .loading_ {
+			    height: 100%;
+			    width: 100%;
+			    position: fixed;
+			    background: #382f3d;
+			    z-index: 999999999990;
+				opacity: .7;
+				    margin-top: 20px;
+			}
+			body .loading_ > p {
+			    position: absolute;
+			    left: 0;
+			    right: 0;
+			    top: 0;
+			    bottom: 0;
+			    margin: auto;
+			    height: 60px;
+			    width: 60px;
+			    text-align: center;
+			    line-height: 60px;
+			    font-size: 0.36rem;
+			    color: rgba(44, 183, 202, 0.8);
+			}
+			body .loading_ p span {
+			    position: absolute;
+			    display: block;
+			    height: 40px;
+			    width: 40px;
+			    margin: 10px;
+			    border-radius: 50%;
+			    -webkit-box-shadow: 0 2px 3px rgba(44, 183, 202, 0.8);
+			    animation: loading_ ease 1s infinite;
+			    left: 0;
+			    top: 0;
+			}
+			@keyframes loading_ {
+			  0% {
+			    transform: rotate(0deg); }
+			  100% {
+			    transform: rotate(360deg); } 
+			}
 		</style>
+		<!-- 加载数据-->
+		<div class="loading_">
+		    <p><span></span></p>
+		</div>
 		<div class="bind_email">
			<div class="input mgT26">
				<input type="email" placeholder="输入邮箱" name="" id="" value="" class="email_input" />
				<input type="text" placeholder="输入验证码" name="" id="" value="" class="code_input" />
				<button class="sendcode" >获取验证码</button>
 				<button class="code_true"><i class="icon iconfont email_check_ok" style="display: inline;"></i></button>
-				<!--<i class="icon iconfont email_check_ok" style="display: inline;color:#2cb7ca"></i>-->
			</div>
			<button type="button" disabled="disabled" class="common_btn btn" id="bindBtn">绑定</button>
			<div class="toast" style="display: none;">
				<div class="toast_content"></div>
			</div>
		</div>
		<script src="{{Msg "seo" "cdn"}}/wxmyemail/js//zepto.js?v={{Msg "seo" "version"}}"></script>
		<script src="{{Msg "seo" "cdn"}}/wxmyemail/js/public.js?v={{Msg "seo" "version"}}1"></script>
		<script>
			$(function(){
+				<!--<i class="icon iconfont email_check_ok" style="display: inline;color:#2cb7ca"></i>-->
			</div>
			<button type="button" disabled="disabled" class="common_btn btn" id="bindBtn">绑定</button>
			<div class="toast" style="display: none;">
				<div class="toast_content"></div>
			</div>
		</div>
		<script src="{{Msg "seo" "cdn"}}/wxmyemail/js//zepto.js?v={{Msg "seo" "version"}}"></script>
		<script src="{{Msg "seo" "cdn"}}/wxmyemail/js/public.js?v={{Msg "seo" "version"}}1"></script>
		<script>
+			$(function () {    
+				var isPageHide = false;   
+				window.addEventListener('pageshow', function () {      
+				    if (isPageHide) {
+		                location.reload();
+				    }    
+				});    
+				window.addEventListener('pagehide', function () {
+				    isPageHide = true;
+				});  
+			});
+			var param = getParam('name');
+			var orderCode=getParam("orderCode");
+			function initpage(){
+				$(".loading_").hide();
+				if(sessionStorage.getItem("1-1")=="1"){
+					sessionStorage.removeItem("1-1")
+					if((param=="change")||(param=="unbind")){
+						window.location.replace("/front/wxMyOrder/myEmail");
+					}else{
+						location.reload();
+					}
+				}else{
+					$("body").css({"visibility":""});
+				}
+			}
			$(function(){
+//				var initflag = true;
+//				$(window).bind("pageshow", function(event){
+//					initflag = false;
+//					if (initflag){
+//						initpage();
+//					}
+//				});
+//				if (initflag){
+//					initflag = false;
+//					initpage();
+//				}
+				$("body").css({"visibility":""});
+				$(".loading_").hide();
 				initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
				var emailVal,code;
 				var userId={{.T.userId}}
				var reg = /^[a-zA-Z0-9]+([._-]*[a-zA-Z0-9]*)*@[a-zA-Z0-9]+.[a-zA-Z0-9{2,5}$]/;
 				//判断是否是更改邮箱;
-				var param = getParam('name');
-				var orderCode=getParam("orderCode");
 				if (param=="change"){
-					$(".email_input").attr("placeholder",{{.T.text_email}})
+					$(".email_input").attr("placeholder","输入新邮箱");
 					$("#bindBtn").html("确定");
 				}else if(param == "unbind"){
 					sessionStorage.setItem("unbind_"+userId,"ok");
 					promptbox("解绑成功");
 				}
 				
-//				$(".email_input").bind('input propertychange',()=>{
-//					if((sessionStorage.getItem("send_myemail_"+userId)!=null)&&(sessionStorage.getItem("send_myemail_"+userId)!="")){
-//						if((sessionStorage.getItem("send_myemail_"+userId))!= $('.email_input').val()){
-//							$('.sendcode').prop("disabled","disabled");
-//						}else{
-//							sessionStorage.removeItem("send_myemail_"+userId);
-//							$('.sendcode').removeAttr("disabled");
-//						}
-//					}
-//				})
-				
 				//
				$('.sendcode').on('click',function(){
 					var that =this;
					emailVal = $('.email_input').val();
					let isEmail = reg.test(emailVal);//正则验证邮箱号
					if($.trim(emailVal) === ''){
 						promptbox('邮箱号不能为空');
					}else if(isEmail === false){
						promptbox('邮箱格式不正确');
					}else{
@@ -82,57 +154,69 @@
 						});
 
					}
				})
 				
-										//验证码校验
-						$('.code_input').bind('input propertychange',()=>{
-							var verity=$(".code_input").val();
-							var email=$(".email_input").val().replace(/\s*/g,"");
-							if(verity.length==6){
-								$.post("/subscribepay/orderListDetails/checkMailCodeVerify",{
-									"email":email,
-									"emailVerity":verity,
-								},function(data){
-									if(data.success){
-										$(".sendcode").css("display","none");
-										$(".code_true").show();
-										$(".code_input").prop("readonly","true");
-										$("#bindBtn").removeAttr("disabled");
-									}else{
-										$(".code_true").hide();
-										$("#bindBtn").attr("disabled","disabled");
-										promptbox("邮箱验证码错误");
-									}
-								});
-							}
-						}).on("blur",()=>{
-							var code_input_len=$(".code_input").val().length
-							if((code_input_len!=6)&&(code_input_len!=0)){
+				//验证码校验
+				$('.code_input').bind('input propertychange',()=>{
+					var verity=$(".code_input").val();
+					var email=$(".email_input").val().replace(/\s*/g,"");
+					if(verity.length==6){
+						$.post("/subscribepay/orderListDetails/checkMailCodeVerify",{
+							"email":email,
+							"emailVerity":verity,
+						},function(data){
+							if(data.success){
+								$(".sendcode").css("display","none");
+								$(".code_true").show();
+								$(".code_input").prop("readonly","true");
+								$(".email_input").prop("readonly",true);
+								$("#bindBtn").removeAttr("disabled");
+							}else{
 								$(".code_true").hide();
 								$("#bindBtn").attr("disabled","disabled");
 								promptbox("邮箱验证码错误");
 							}
 						});
-						
-						//绑定
-						$("#bindBtn").on("click",function(){
-							$.post("/subscribepay/orderListDetails/emailOperation",{
-								"operation":"binding",
-								"email":$(".email_input").val()
-								},function(data){
-								if(data.success){
-									if ($("#bindBtn").text()=="确定"){	//更改绑定
-										sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
-										window.location.replace("/front/wxMyOrder/setSuccess?name=changeEmail"); 
-									}else{
-										sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
-										if((param="invoice")&&(orderCode!=null)){
-											window.location.replace("/front/wxMyOrder/setSuccess?name=invoice&orderCode="+orderCode); 
-										}else{
-											window.location.replace("/front/wxMyOrder/setSuccess?name=bindEmail"); 
-										}
-									}
+					}
+				}).on("blur",()=>{
+					var code_input_len=$(".code_input").val().length
+					if((code_input_len!=6)&&(code_input_len!=0)){
+						$(".code_true").hide();
+						$("#bindBtn").attr("disabled","disabled");
+						promptbox("邮箱验证码错误");
+					}
+				});
+				
+				//绑定
+				$("#bindBtn").on("click",function(){
+					$.post("/subscribepay/orderListDetails/emailOperation",{
+						"operation":"binding",
+						"email":$(".email_input").val()
+						},function(data){
+						if(data.success){
+							if ($("#bindBtn").text()=="确定"){	//更改绑定
+								sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
+								sessionStorage.setItem("1-1","1")
+								window.location.replace("/front/wxMyOrder/setSuccess?name=changeEmail"); 
+								$("body").css({"visibility":"hidden"});
+								$(".loading_").show();
+								//window.location.href="/front/wxMyOrder/setSuccess?name=changeEmail";
+							}else{
+								sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
+								if((param="invoice")&&(orderCode!=null)){
+									$(".loading_").show();
+									$("body").css({"visibility":"hidden"});
+									window.location.replace("/front/wxMyOrder/setSuccess?name=invoice&orderCode="+orderCode); 
+									//Window.location.href="/front/wxMyOrder/setSuccess?name=invoice&orderCode="+orderCode;
+								}else{
+									$("body").css({"visibility":"hidden"});
+									$(".loading_").show();
+									sessionStorage.setItem("1-1","1")
+									window.location.replace("/front/wxMyOrder/setSuccess?name=bindEmail");  
+									//window.location.href="/front/wxMyOrder/setSuccess?name=bindEmail";
 								}
-							})
-						})
			})
+							}
+						}
+					})
+				})
			})
 			
 			//提示框
 			function promptbox(str){
@@ -141,7 +225,9 @@
 				setTimeout(() =>{
 					$('.toast').hide(400);
 				},1500)
-			}
		</script>
+			}
+			
+
		</script>
 		
 	{{include "/common/baiducc.html"}}
	</body>
 </html>

+ 12 - 2
src/web/templates/weixin/email/bind_success.html

@@ -25,8 +25,16 @@
 				//分享
 				initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
 				
+				
 				let param = getParam('name');//获取url传来的参数 判断显示成功的字幕
 				var orderCode=getParam("orderCode"); //开发票的订单
+				if(param!="invoice"){
+					//增加一条历史记录
+					history.pushState({},"","");
+					window.addEventListener('popstate', function(event){
+						window.location.replace('/front/wxMyOrder/myEmail');
+					});
+				}
 				var time = 3;
 				function countDown(){
 					if(time == 0){
@@ -34,7 +42,8 @@
 						if((param=="invoice")&&(orderCode!=null)){
 							window.location.replace('/weixin/pay/toOrderDetailPage?orderCode='+orderCode);
 						}else{
-							window.location.replace('/front/wxMyOrder/myEmail');
+							window.history.go(-1);
+							//window.location.replace('/front/wxMyOrder/myEmail');
 						}
 					}else{
 						$('.time').html('(' + time + ')');
@@ -68,7 +77,8 @@
 					if((param=="invoice")&&(orderCode!=null)){
 							window.location.replace('/weixin/pay/toOrderDetailPage?orderCode='+orderCode);
 						}else{
-							window.location.replace('/front/wxMyOrder/myEmail');
+							window.history.go(-1);
+							//window.location.replace('/front/wxMyOrder/myEmail');
 						}
 				})
 			})

+ 2 - 1
src/web/templates/weixin/email/unbind_email.html

@@ -17,7 +17,8 @@
 					});
 					$('#sure_choose').on('click',() =>{
 						//sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
-						window.location.replace("/front/wxMyOrder/myEmail?name=change");
+						//window.location.replace("/front/wxMyOrder/myEmail?name=change");
+						window.location.href="/front/wxMyOrder/myEmail?name=change";
 					});
 				})
 				

+ 14 - 0
src/web/templates/weixin/my.html

@@ -79,6 +79,18 @@
 		</style>
 		
 		<script>
+			$(function () {    
+				var isPageHide = false;   
+				window.addEventListener('pageshow', function () {      
+				    if (isPageHide) {
+		                location.reload();
+				    }    
+				});    
+				window.addEventListener('pagehide', function () {
+				    isPageHide = true;
+				});  
+			});
+		
 			initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
 			$(function(){
 				var nowTimestamp= (new Date()).valueOf();
@@ -133,6 +145,8 @@
 			        }
 			    }
 			}
+			
+
 		</script>
 
 	</head>

+ 1 - 1
src/web/templates/weixin/vipsubscribe/edit_subscribe.html

@@ -113,7 +113,7 @@
                 $(".edit_item.industry span").text(this.reqData.buyset.buyerclasscount + "个行业");
             }
             if (this.reqData.industry.length > 0) {
-                $(".edit_item.industry .item_bottom").text(this.reqData.industry.join("、"));
+                $(".edit_item.industry .item_bottom").text(SortArr(this.reqData.industry).join("、"));
             }
 
         },

+ 1 - 1
src/web/templates/weixin/vipsubscribe/edit_subscribe_success.html

@@ -16,7 +16,7 @@
         <div class="edit_success">
             <div><i class="icon iconfont success">&#xe612;</i></div>
             <p>修改成功</p>
-            <button class="public_btn" id="back">返回(<em class="time">5</em>)</button>
+            <button class="public_btn" id="back">返回(<em class="time">3</em>)</button>
         </div>
         <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
         <script>

+ 3 - 7
src/web/templates/weixin/vipsubscribe/renew_notice.html

@@ -192,13 +192,9 @@
 					    	$(".date-span").text(dateHtml);
 					    }
 					    if(exprie === "will"){
-					    	let a = (endstime/1000) - (86400 * 3)
-					    	let b = nowTime/1000
-					    	if(b > a){
-					    		$(".renew_service").show();
-						    	$("#exprie").text("VIP订阅服务即将到期,请及时续费")
-						    	$(".recommend_title").text("以下区域、行业的订阅推送即将停止,为了不影响您的使用,请立即续费!")
-					    	}
+				    		$(".renew_service").show();
+					    	$("#exprie").text("VIP订阅服务即将到期,请及时续费")
+					    	$(".recommend_title").text("以下区域、行业的订阅推送即将停止,为了不影响您的使用,请立即续费!")
 					    }else{
 					    	$(".renew_service").show();
 					    	$(".free_service").show();

+ 10 - 18
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -656,14 +656,10 @@
 			    	$(".item_validity .label_for").text(dateHtml);
 			    }
 			    if(starts !== "" && ends !== ""){
-			    	let end = new Date(ends*1000).toLocaleDateString();
-			    	let endtime = end.split("/");
-			    	let endYear = Number(endtime[0]);
-			    	let endMonth = Number(endtime[1]);
-			    	let start = new Date(starts*1000).toLocaleDateString();
-			    	let starttime = start.split("/");
-			    	let startYear = Number(starttime[0]);
-			    	let startMonth = Number(starttime[1]);
+			    	let endYear = new Date(ends*1000).getFullYear();
+			    	let endMonth = new Date(ends*1000).getMonth()+1;
+			    	let startYear = new Date(starts*1000).getFullYear();
+			    	let startMonth = new Date(starts*1000).getMonth()+1;
 			    	let year = "";
 			    	let month = "";
 			    	if(endYear > startYear){
@@ -711,17 +707,13 @@
 		    }
         }, false);
         //
-        var nowDate = new Date(startTime).toLocaleDateString();
-		nowDate = nowDate.split("/");
-		var nowMonth = Number(nowDate[1]);
-		var nowYear = Number(nowDate[0]);
-		var nowDay = Number(nowDate[2]);
+		var nowMonth = new Date(startTime).getMonth()+1;
+		var nowYear = new Date(startTime).getFullYear();
+		var nowDay = new Date(startTime).getDate();
 		//
-		var endDate = new Date(endTime).toLocaleDateString();
-		endDate = endDate.split("/");
-		var endMonth = Number(endDate[1]);
-		var endYear = Number(endDate[0]);
-		var endDay = Number(endDate[2]);
+		var endMonth = new Date(endTime).getMonth()+1;
+		var endYear = new Date(endTime).getFullYear();
+		var endDay = new Date(endTime).getDate();
 		var nowUpgrade = 0;
 		if(endYear === nowYear){
 			if(endMonth === nowMonth){

+ 1 - 1
src/web/templates/weixin/vipsubscribe/vip_order_detail.html

@@ -411,7 +411,7 @@ try{
       	if (r.data.order.order_status==0){
 	    	//倒计时 未购买
 			var create_time=r.data.order.create_time;
-			//create_time="2019-11-09 11:17:55";
+			create_time=create_time.replace(/-/g,'/')
 			var clock_end = +new Date(create_time) + 172800000;
 			setTimeFunc(clock_end); 
 			setInterval(function(){

+ 1 - 0
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -386,6 +386,7 @@
                             if (r.timeSelect!=undefined&&r.company!=undefined){
                            		purchase.timeSelect=[r.timeSelect,r.company];
                             }
+                            $(".weui-icon-checked").click();
                             sessionStorage.setItem("vipSubSelectArea", JSON.stringify(purchase.areaSelect));
                             sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
                             sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));

+ 12 - 20
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -448,10 +448,8 @@
          // 选择生效日期
         $('.choose_effect_date > a').click(function () {
             $('#effective_date').show(200);
-            var nowDates = new Date().toLocaleDateString();
-			nowDates = nowDates.split("/");
-			var nowMonths = Number(nowDates[1]);
-			var nowYears = Number(nowDates[0]);
+			var nowMonths = new Date().getMonth()+1;
+			var nowYears = new Date().getFullYear();
 			var as = nowMonths +1;
 			if(as > 12){
 				as = as-12;
@@ -975,17 +973,13 @@
         	$(".save_upgrade").attr('disabled','disabled');
 	    	var nowUpgrade = "";
 			//
-			var nowDate = new Date(startTime).toLocaleDateString();
-			nowDate = nowDate.split("/");
-			var nowMonth = Number(nowDate[1]);
-			var nowYear = Number(nowDate[0]);
-			var nowDay = Number(nowDate[2]);
+			var nowMonth = new Date(startTime).getMonth()+1;
+			var nowYear = new Date(startTime).getFullYear();
+			var nowDay = new Date(startTime).getDate();
 			//
-			var endDate = new Date(endTime).toLocaleDateString();
-			endDate = endDate.split("/");
-			var endMonth = Number(endDate[1]);
-			var endYear = Number(endDate[0]);
-			var endDay = Number(endDate[2]);
+			var endMonth = new Date(endTime).getMonth()+1;
+			var endYear = new Date(endTime).getFullYear();
+			var endDay = new Date(endTime).getDate();
 			var oldPrice = "";
 			var price = "";
 			var effect = "";
@@ -1258,13 +1252,11 @@
         	let effective = $("#effect_date_name").text();
         	var effect = "now";
         	if(effective !== "立即生效,需支付当月费用差价"){
-        		let nowDate = new Date().toLocaleDateString();
-				nowDate = nowDate.split("/");
-				let nowMonth = Number(nowDate[1]);
-				let nowYear = Number(nowDate[0]);
-				let a = nowMonth +1
+				let nowMonth = new Date().getMonth()+1;
+				let nowYear = new Date().getFullYear();
+				let a = nowMonth +1;
         		if(a > 12){
-        			a = nowMonth-12;
+        			a = a-12;
         			nowYear = nowYear +1;
         		}
         		let b = nowYear+"/"+a+"/1";

+ 98 - 0
src/web/templates/weixin/wxinfocontent_rec.html

@@ -406,6 +406,45 @@ pre {
 	left: 90%;
 	top: 20px;
 }
+
+.buyerclass{
+    background: #CFAD89;
+    padding: 1px 3px;
+    color: #fff;
+    border-radius: 3px;
+    margin-right: 3px;
+    float: left;
+}
+.timebefore_vip{
+	color: #888888;
+    font-size: 14px;
+	
+}
+.timebefore_vip i{
+	color: #7a7a7a;
+	font-size: 16px;
+	top: 3px;
+}
+.toolbar{
+	font-size: 13px;
+	margin:10px 10px 25px;
+}
+.toolbar i{
+	margin-right: 2px;
+}
+.toolbar .follow{
+	float: right;
+	color: #ffba00;
+	position: relative;
+	top: 2px;
+}
+.toolbar .follow_vip{
+	float: right;
+	color: #ffba00;
+}
+.toolbar .follow i,.toolbar .follow_vip i{
+	top: 2px;
+}
 </style>
 </head>
 <body>
@@ -427,6 +466,64 @@ pre {
 <div class="info">
 	<div class="title myfollow" id="title">{{.T.obj.title}}</div>
 	<div class="toolbar">
+	{{if .T.isVip}}
+	<!--VIP-->
+		<div class="type_label clearfix">
+			<script>var area="{{.T.obj.area}}"; if(area!="A" && area.replace(/\s+/g,"")!=""){document.write('<span class="area">'+area+'</span>');}</script>
+			<script>
+				var type = "";
+				if ({{.T.obj.subtype}} !=""){
+					type = {{.T.obj.subtype}};
+				}else if({{.T.obj.toptype}} !=""){
+					type = {{.T.obj.toptype}};
+				}else{
+					type = {{.T.obj.type}};
+					if(type == "bid"){
+						type = "中标";
+					}else if(type == "tender"){
+						type = "招标";
+					}else{
+						type = "";
+					}
+				}
+				if(type != ""){
+					document.write("<span class='type'>"+type+"</span>");
+				}
+	
+				var industry = {{.T.obj.industry}};
+				var subscopeclass = {{.T.obj.s_subscopeclass}};
+				//vip用户显示与普通用户不同
+				var buyerclass={{.T.obj.buyerclass}};
+				if(industry){
+	                document.write("<span class='industry'>"+industry+"</span>");
+				}else if(subscopeclass){
+					var suclass = subscopeclass.split(",")[0];
+					document.write("<span class='industry'>"+ suclass.split("_")[0]+"</span>");
+				}
+				if(buyerclass){
+					document.write("<span class='buyerclass'>"+ buyerclass+"</span>");
+				}
+				//项目匹配
+				projectMatch=getParam("projectMatch");
+				if (projectMatch){
+					document.write("<span class='projectMatch'>"+projectMatch+"</span>")
+				}
+				
+			</script>
+		</div>
+		<div class="time_label">
+			<script>
+				var l_publishtime = {{.T.obj.l_publishtime}};
+					if(l_publishtime != ""){
+						var tdf = timeDiff(new Date(Number(l_publishtime+"000")))
+						if(tdf != null){
+							document.write("<div class='timebefore_vip'><i class='glyphicon bofangjilu'></i>"+tdf+"</div>");
+						}
+					}
+			</script>
+		{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<div class="follow" style="top:-21px !important">{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</div>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
+		</div>
+	{{else}}<!--非VIP-->
 		<script>var area="{{.T.obj.area}}"; if(area!="A" && area.replace(/\s+/g,"")!=""){document.write('<span class="area">'+area+'</span>');}</script>
 		<script>
 			var type = "";
@@ -465,6 +562,7 @@ pre {
 			}
 		</script>
 		{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow">{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
+	{{end}}
 	</div>
 	
 	<div class="newuser hidden">