Переглянути джерело

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

wangshan 5 роки тому
батько
коміт
14e2ef6e3a

+ 3 - 0
src/jfw/front/vipsubscribe.go

@@ -152,6 +152,9 @@ func (s *Subscribepay) ToPurchasePage(flag string) {
 		} else {
 			s.T["orderType"] = 1
 		}
+		if s.GetString("orderCode") != "" {
+			s.T["again"] = 1 //再次购买
+		}
 		s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url()) //微信支付准备参数
 	}
 	s.Render("/weixin/vipsubscribe/vip_purchase.html")

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
src/jfw/modules/subscribepay/src/dataexport.json


+ 1 - 1
src/jfw/modules/subscribepay/src/service/commonAction.go

@@ -52,7 +52,7 @@ func (d *CommonAction) ApplyInvoice() error {
 		go func() {
 			orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
 				"order_code": order_code,
-			}, "id,filter,user_mail,user_phone,product_type,data_spec,filter_id,order_code,data_count,order_status,order_money,out_trade_no,applybill_type,applybill_company,applybill_taxnum,user_openid,create_time,pay_time,pay_way,pay_money,vip_starttime,vip_endtime", "")
+			}, "id,filter,user_mail,user_phone,product_type,data_spec,filter_id,order_code,data_count,order_status,order_money,out_trade_no,applybill_type,applybill_company,applybill_taxnum,user_openid,create_time,pay_time,pay_way,pay_money,vip_starttime,vip_endtime,user_id", "")
 			tt := time.Now()
 			pay_time := qutil.FormatDate(&tt, qutil.Date_Full_Layout)
 			entity.SendMailToBJFinance(orderdata, pay_time, "", 2, config.GmailAuth)

+ 16 - 0
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -29,6 +29,7 @@ type OrderListDetails struct {
 	setEmail            xweb.Mapper `xweb:"/orderListDetails/setEmail"`            //设置邮箱
 	checkMailCodeVerify xweb.Mapper `xweb:"/orderListDetails/checkMailCodeVerify"` //验证码
 	emailOperation      xweb.Mapper `xweb:"/orderListDetails/emailOperation"`      //查看邮箱
+	isVip               xweb.Mapper `xweb:"/orderListDetails/isVip"`
 }
 
 var (
@@ -344,6 +345,21 @@ func (o *OrderListDetails) EmailOperation() {
 	o.ServeJson(&o.T)
 }
 
+//查看是否是vip
+func (o *OrderListDetails) IsVip() {
+	//检测用户是否绑定邮箱
+	isV := false
+	res, err := util.MQFW.FindOne("user", bson.M{"_id": bson.ObjectIdHex(qutil.ObjToString(o.GetSession("userId")))})
+	if len(*res) > 0 && err {
+		if qutil.Int64All((*res)["i_vip_status"]) == 1 || qutil.Int64All((*res)["i_vip_status"]) == 2 {
+			isV = true
+		}
+	}
+	o.ServeJson(map[string]interface{}{
+		"isvip": isV,
+	})
+}
+
 func (o *OrderListDetails) SetRes(res []map[string]interface{}, queryM map[string]interface{}) {
 	//获取最后一次购买的vip订单
 	queryM["product_type"] = "VIP订阅"

+ 23 - 10
src/web/templates/weixin/dataExport/dataExport_toMyOrder.html

@@ -218,6 +218,15 @@
 				font-size: .3rem;
 				margin-left: 10.5em;
 			}
+			
+			.gopay_btn{
+				width: 2.18rem;
+			    height: .72rem;
+			    line-height: .73rem;
+			    text-align: center;
+			    border-radius: 0.05rem;
+			    font-size: .28rem;
+			}
 		</style>
 		<script>
 			var signature = {{.T.signature}};
@@ -902,6 +911,10 @@
 						    		}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;
@@ -917,15 +930,15 @@
 						    	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{
+						       	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删除  
@@ -960,7 +973,7 @@
 	                        	iconHtml=""
 	                        	iconHtml+='<div class="card-footer">'
 											+'<a  class="btn cancle" onclick="cancelOrder('+id_vip+',this)">取消订单</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>'
+											+'<a href="javascript:void(0)" onclick="goVipPay(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="已完成";

+ 47 - 30
src/web/templates/weixin/my.html

@@ -34,10 +34,6 @@
 				margin-left: 20px;
 				margin-right: 5px;
 			}
-			.myorderDiv{
-				font:16px/50px "微软雅黑" ;
-				background-color:#FFFFFF ;
-			}
 			.fl{
 				float: left;
 			}
@@ -63,11 +59,6 @@
 				margin-top: 10px;
 				border-top: 1px solid  #F5F4F9;
 			}
-			.vip{
-				margin-bottom: 10px;
-				font:16px/50px "微软雅黑" ;
-				background-color:#FFFFFF ;
-			}
 			.email{
 				border-top:0px #F5F4F9 solid;
 			}
@@ -91,14 +82,19 @@
 		<script>
 			initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
 			$(function(){
+				var nowTimestamp= (new Date()).valueOf();
 				var userId={{.T.userId}}
+				
 				$(".vip").on("click",function(){
-					if({{.T.isVip}}==true){
-						window.location.href="/front/vipsubscribe/toSetPage";	    //vip订阅入口  试用或正式vip
-					}else{
-						window.location.href="/front/vipsubscribe/introducePage";	//vip订阅入口  非vip
-					}
+					$.post("/subscribepay/orderListDetails/isVip?v="+nowTimestamp,{},function(data){
+						if (data.isvip){
+							window.location.href="/front/vipsubscribe/toSetPage";		//vip订阅入口  试用或正式vip
+						}else{
+							window.location.href="/front/vipsubscribe/introducePage";		//vip订阅入口  非vip
+						}
+					})
 		        })
+				
 		        $(".myorder").on("click",function(){
 		        	window.location.href="/weixin/pay/toMyWxOrder?v=01";
 		        })
@@ -114,8 +110,6 @@
 		        $(".aboutJy").on("click",function(){
 		    		window.location.href='/swordfish/about?flag=1&come=1';
 		        })
-				
-				var nowTimestamp= (new Date()).valueOf();
 				$.post("/subscribepay/orderListDetails/emailOperation?v="+nowTimestamp,{},function(r){
 					if (r.success){
 						$(".setEmail").html("未设置");
@@ -144,24 +138,47 @@
 
 	</head>
 	<body>
+	
+<!--布局css-->
+	<style>
+		.vip{
+			display:flex;
+			align-items: center;
+			justify-content: space-between;
+			margin-bottom: 10px;
+			font:16px/50px "微软雅黑" ;
+			background-color:#FFFFFF ;
+		}
+		.myorderDiv{
+			font:16px/50px "微软雅黑" ;
+			background-color:#FFFFFF ;
+			display:flex;
+			align-items: center;
+			justify-content: space-between;
+		}
+		.width_inlinblock{
+			width:87%;
+			display:inline-block;
+		}
+	</style>
 		<div id="" class="vip lineTop">
-			<img src="/images/wx/vip.svg"/>
-			<div style="width:87%;display:inline-block;">
-				VIP订阅
-				<i class="iconfont fr rightIcon">&#xe642;</i>
-			</div>
+				<img src="/images/wx/vip.svg"/>
+				<div class="width_inlinblock">
+					VIP订阅
+					<i class="iconfont fr rightIcon">&#xe642;</i>
+				</div>
 		</div>
 		
 		<div class="myorderDiv myorder">
-			<i class="iconfont myorderIcon myorder_margin">&#xe60f;</i>
-			<div style="width:87%;display:inline-block;" class="lineBottom">
-				我的订单
-				<i class="iconfont fr rightIcon">&#xe642;</i>
-			</div>
+				<i class="iconfont myorderIcon myorder_margin">&#xe60f;</i>
+				<div  class="lineBottom width_inlinblock">
+					我的订单
+					<i class="iconfont fr rightIcon">&#xe642;</i>
+				</div>
 		</div>
 		<div class="myorderDiv email">
 			<img src="/images/wx/email.svg"/>
-			<div style="width:87%;display:inline-block;">
+			<div class="width_inlinblock">
 				邮箱地址
 				<i class="iconfont fr rightIcon">&#xe642;</i>
 				<span class="setEmail"></span>
@@ -170,7 +187,7 @@
 		
 		<div class="myorderDiv  lineTop feedback" >
 			<i class="iconfont threeIcon" style="">&#xe613;</i>
-			<div style="width:87%;display:inline-block;" class="lineBottom">
+			<div class="lineBottom width_inlinblock">
 				<div style="display:inline-block;">
 					意见反馈
 				</div>
@@ -180,7 +197,7 @@
 		
 		<div class="myorderDiv  useHelp">
 			<i class="iconfont threeIcon ">&#xe60c;</i>
-			<div style="width:87%;display:inline-block;" class="lineBottom">
+			<div  class="lineBottom width_inlinblock">
 				<div style="display:inline-block;">
 					使用帮助
 				</div>
@@ -190,7 +207,7 @@
 		
 		<div class="myorderDiv  aboutJy">
 			<i class="iconfont threeIcon">&#xe601;</i>
-			<div style="width:87%;display:inline-block;">
+			<div class="width_inlinblock">
 				关于剑鱼标讯
 				<i class="iconfont fr rightIcon">&#xe642;</i>
 			</div>

+ 4 - 0
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -568,6 +568,10 @@
 			    			if(year === 0){
 			    				year = "";
 			    			}
+			    			if (month==12){
+		    					year=Number(year)+1;
+		    					month="";
+		    				}
 			    		}
 			    	}else if(endYear === startYear){
 		    			month = endMonth - startMonth;

+ 4 - 0
src/web/templates/weixin/vipsubscribe/vip_order_detail.html

@@ -282,6 +282,10 @@ try{
 	    		}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;

Деякі файли не було показано, через те що забагато файлів було змінено