wangkaiyue 6 年之前
父節點
當前提交
a1a12657cc

+ 1 - 1
src/jfw/front/dataExport.go

@@ -217,7 +217,7 @@ func (d *DataExport) QueryOrder() error {
 		}
 	}
 	for _, v := range *list {
-		if v["pay_way"] == "微信" && util.IntAll(v["order_status"]) == 0 {
+		if v["pay_way"] == "wx_pc" && util.IntAll(v["order_status"]) == 0 {
 			r, _ := qr.Encode(util.ObjToString(v["code_url"]), qr.M)
 			pngdat := r.PNG()
 			v["code_url"] = base64.StdEncoding.EncodeToString(pngdat)

+ 1 - 0
src/jfw/front/datareport.go

@@ -53,6 +53,7 @@ func (d *DataReport) ToDataReport() error {
 
 func (d *DataReport) PaySuccess() {
 	d.T["email"] = d.GetString("email")
+	d.T["title"] = d.GetString("title")
 	d.Render("/weixin/datareport/dataReport_success.html", &d.T)
 }
 

+ 1 - 1
src/jfw/jyutil/sessionkeep.go

@@ -131,7 +131,7 @@ func (sk *SessionKeep) Do(w http.ResponseWriter, r *http.Request) bool {
 				session.Set("referer", r.RequestURI)
 				http.Redirect(w, r, "/notin/page", 302)
 				return false
-			} else if strings.HasPrefix(rqu, "/weixin/pay") || strings.HasPrefix(rqu, "/front/dataReport") {
+			} else if strings.HasPrefix(rqu, "/front/dataReport") {
 				if rqu == "/front/dataReport/payCallback" {
 					return true
 				}

+ 2 - 2
src/jfw/modules/app/src/app/front/datareport.go

@@ -230,7 +230,7 @@ func DataReportCalBakAfter(order_money, cash_fee int, out_trade_no, transaction_
 	if orderdata != nil {
 		pay_way := "wx_app"
 		if openid == "" {
-			pay_way = "wx_ali"
+			pay_way = "ali_app"
 		}
 		order_status := util.IntAll((*orderdata)["order_status"])
 		if order_status == 0 {
@@ -263,7 +263,6 @@ func DataReportCalBakAfter(order_money, cash_fee int, out_trade_no, transaction_
 		newPayData := map[string]interface{}{
 			"transaction_id": transaction_id,
 			"out_trade_no":   out_trade_no,
-			"user_openid":    openid,
 			"create_time":    util.FormatDate(&now, util.Date_Full_Layout),
 			"total_fee":      order_money,
 			"cash_fee":       cash_fee,
@@ -274,6 +273,7 @@ func DataReportCalBakAfter(order_money, cash_fee int, out_trade_no, transaction_
 				log.Printf("支付数据插入失败%+v\n", newPayData)
 			}
 		} else {
+			newPayData["user_openid"] = openid
 			if public.Mysql.Insert("weixin_pay", newPayData) == 0 {
 				log.Printf("支付数据插入失败%+v\n", newPayData)
 				return false

+ 1 - 1
src/jfw/modules/app/src/web/staticres/jyapp/datareport/css/dataReport_info.css

@@ -83,7 +83,7 @@
   color: #888;
 }
 #pay_order .main .form .fixed-bottom-box {
-  position: absolute;
+  position: fixed;
   bottom: 0;
   left: 0;
   right: 0;

+ 20 - 11
src/jfw/modules/app/src/web/templates/datareport/dataReport_info.html

@@ -21,7 +21,7 @@
                         <div class="form-control name">
                             <label for="">姓名</label>
                             <div class="input">
-                                <input type="text" id="name" placeholder="输入姓名" value={{.T.name}}>
+                                <input type="text" id="name" placeholder="输入姓名" maxlength=50 value={{.T.name}}>
                             </div>
                         </div>
                     </div>
@@ -29,7 +29,7 @@
                         <div class="form-control tel">
                             <label for="">手机号</label>
                             <div class="input">
-                                <input type="text" id="phone" placeholder="输入手机号" value={{.T.phone}}>
+                                <input type="text" id="phone" placeholder="输入手机号" maxlength=11 value={{.T.phone}}>
                             </div>
                         </div>
                     </div>
@@ -45,7 +45,7 @@
                         <div class="form-control company">
                             <label for="">公司名称</label>
                             <div class="input">
-                                <input type="email" id="company" placeholder="输入公司名称" value={{.T.company}}>
+                                <input type="email" id="company" placeholder="输入公司名称" maxlength=100 value={{.T.company}}>
                             </div>
                         </div>
                     </div>
@@ -126,6 +126,7 @@
             var canpay=true
             $(function() {
                 checkInput();
+                             
                 $('#choose_way').click(function() {
                     // slideUp 消失
                     // slideDown 显示
@@ -173,14 +174,14 @@
                     }
                 })
                 $('.form-control.name input').on('blur', function () {
-                    if (!s_name) {
-                        showToast('姓名不能为空')
+                    if (s_name.length>50||s_name.length<2) {
+                        showToast('请输入有效的姓名')
                     }
                 })
   
                 $('.form-control.company input').on('blur', function () {
-                    if (!s_company) {
-                        showToast('公司名称不能为空')
+                    if (s_company.length>100||s_company.length<2) {
+                        showToast('请输入有效的公司名称')
                     }
                 })
                  $('.form-item input').on('input propertychange',function(){
@@ -194,7 +195,7 @@
                   s_company=$("#company").val();
                   s_phone=$("#phone").val();
                   s_email=$("#email").val();
-                  if(s_name&&reg_tel.test(s_phone)&&reg_email.test(s_email)&&s_company){
+                  if(s_name.length>1&&s_name.length<50&&reg_tel.test(s_phone)&&reg_email.test(s_email)&&s_company.length>1&&s_company.length<100){
                     btn.prop('disabled', false)
                   }else{
                     btn.prop('disabled', true)  
@@ -205,6 +206,11 @@
                   if(!canpay){
                     return
                   }
+                  if(!mySysIsIos()){ //android 不能回调支付是否取消
+                    setTimeout(function(){
+                      canpay=true
+                    },1000)
+                  }
                   canpay=false
                   $.post("/jyapp/dataReport/toAppPay", {
                       "s_name": s_name,
@@ -229,6 +235,7 @@
                         showToast(r.showErr)
                         canpay=true
                       }
+                     
                   })
               })
               //查询是否支付完成
@@ -243,13 +250,12 @@
                       location.replace("/jyapp/dataReport/paySuccess?email="+s_email); 
                     }
                   })
-                  if(canpay){
+                  if(canpay&&mySysIsIos()){
                     clearInterval(interval);
                   }
                 },2000)
               }
-              //支付客户端回调
-              
+    
             })
             
             function payCallBack(status){
@@ -265,6 +271,9 @@
                   break;
                 }
             }
+            function mySysIsIos(){
+            	return !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+            }
         </script>
     </body>
 </html>

+ 17 - 6
src/jfw/modules/app/src/web/templates/me/notice.html

@@ -80,20 +80,31 @@
 						if(link == ""){
 							return
 						}
-						if($(this).attr("data-category").indexOf("message")>-1){
+            var type=$(this).attr("data-category")
+						if(type.indexOf("message")>-1||type.indexOf("Message")>-1){
 							//修改此消息为已读  catagory->message==>message_r
-							if($(this).attr("data-category")=="message"){
+							if(type=="message"||type=="titleMessage"){
 								//调用接口修改打开数
 								JyObj.openActivityPage(link,"C",$(this).attr("data-userid"))
+                $(this).attr("data-category",type+"_r");
 							}
-							$(this).attr("data-category","message_r");
+							
 							link = link.split('==')[0];
 							if(link.indexOf("/jyapp/free/message")>-1){
 								window.location.href = link;
 							}else{
-								JyObj.openExternalLink(link,"消息通知");
+                var title="消息通知"
+                if(type=="titleMessage"||type=="titleMessage_r"){
+                  
+                  var MsgTitle=$(this).find(".noticeListRight>div>div").html();
+                  if(MsgTitle){
+                    title=MsgTitle
+                  }
+                }
+								JyObj.openExternalLink(link,title);
 							}
 						}else{
+              alert(2)
 							window.location.href = link;
 						}
 					});
@@ -113,7 +124,7 @@
 				}
 				html += '<li class="clearfix" data-userid="'+userId+'" data-category="'+list[i].category+'" data-id="'+list[i].id+'" data-link="'+link+'">'
 							+'<div class="noticeListLeft">'
-				if(list[i].category.indexOf("message")>-1){
+				if(list[i].category.indexOf("message")>-1||list[i].category.indexOf("Message")>-1){
 					if(list[i].content!=""){
 						html+='<img src="'+list[i].content+'"/>'
 					}else{
@@ -125,7 +136,7 @@
 				html += '</div>'
 							+'<div class="noticeListRight">'
 							+'<div>'
-				if(list[i].category.indexOf("message")>-1){
+				if(list[i].category.indexOf("message")>-1||list[i].category.indexOf("Message")>-1){
 					html +='<div style="padding-right:10px;">'+list[i].title+'</div>'
 				}else{
 					html +='<div><span>'+list[i].title+'</span></div>'

+ 0 - 7
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -62,13 +62,6 @@
 					<div>搜索企业的所有中标项目信息</div>
 				</a>
 			</li>
-      <li>
-      <!--<a onclick="JyObj.openExternalLink('/jyapp/dataReport/toPayPage/1','111')">-->
-				<a href="/jyapp/dataReport/toPayPage/1">
-					<div>厕所革命</div>
-					<div>付费购买《厕所革命》招标文档</div>
-				</a>
-			</li>
 		</ul>
 	</section>
 </section>

+ 9 - 14
src/jfw/pay/dataExportPay.go

@@ -60,7 +60,7 @@ func (p *DataExportPayAction) SacnPay_WaitPay() error {
 			log.Println("二维码已失效,重新生成预订单!", openid)
 			surplus_second = 0
 			now := time.Now()
-			if pay_way == "微信" {
+			if pay_way == "wx_pc" {
 				tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openid, "", orderMoney)
 				if ret != nil {
 					if public.Mysql.Update("dataexport_order", map[string]interface{}{
@@ -75,7 +75,7 @@ func (p *DataExportPayAction) SacnPay_WaitPay() error {
 						codeUrl = util.ObjToString((*ret)["codeurl"])
 					}
 				}
-			} else if pay_way == "支付宝" {
+			} else if pay_way == "ali_pc" {
 				payOutTime := now.Add(time.Hour * 2)
 				if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(orderMoney), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
 					if public.Mysql.Update("dataexport_order", map[string]interface{}{
@@ -95,7 +95,7 @@ func (p *DataExportPayAction) SacnPay_WaitPay() error {
 		}
 		return surplus_second, orderMoney, codeUrl, pay_way
 	}()
-	if pay_way == "微信" {
+	if pay_way == "wx_pc" {
 		r, _ := qr.Encode(qrcode, qr.M)
 		pngdat := r.PNG()
 		qrcode = base64.StdEncoding.EncodeToString(pngdat)
@@ -128,11 +128,6 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
 	}
 	user_mail_status := util.ObjToString(p.GetSession("DataExportVerifyEmail_val")) != ""
 	pay_way := p.GetString("pay_way")
-	if pay_way == "weixin" {
-		pay_way = "微信"
-	} else if pay_way == "alipay" {
-		pay_way = "支付宝"
-	}
 	user_mail, _ := p.GetSession("DataExportVerifyEmail_val").(string)
 	user_phone, _ := p.GetSession("DataExportVerifyPhone").(string)
 	if user_phone != "" {
@@ -275,7 +270,7 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
 	}
 	if isPass {
 		//创建微信预支付订单
-		if pay_way == "微信" {
+		if pay_way == "wx_pc" {
 			tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openId, "", order_money)
 			log.Println("支付交易单", openId, ret)
 			if ret != nil && (*ret)["status"] == "1" {
@@ -315,7 +310,7 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
 			} else {
 				log.Println("生成微信预支付交易单失败", ret)
 			}
-		} else if pay_way == "支付宝" {
+		} else if pay_way == "ali_pc" {
 			now := time.Now()
 			payOutTime := now.Add(time.Hour * 2)
 			if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(order_money), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
@@ -412,7 +407,7 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
 		codeUrl := ""
 		now := time.Now()
 		prepay_time = util.FormatDate(&now, util.Date_Full_Layout)
-		if pay_way == "微信" {
+		if pay_way == "wx_pc" {
 			tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openid, "", orderMoney)
 			if ret != nil {
 				if public.Mysql.Update("dataexport_order", map[string]interface{}{
@@ -431,7 +426,7 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
 					return "", "创建微信订单出错", false
 				}
 			}
-		} else if pay_way == "支付宝" {
+		} else if pay_way == "ali_pc" {
 			payOutTime := now.Add(time.Hour * 2)
 			if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(orderMoney), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
 				if public.Mysql.Update("dataexport_order", map[string]interface{}{
@@ -472,10 +467,10 @@ func CloseDataExportOrder(payWay, tradeno, prepayTime string) (status bool) {
 		}
 	}
 	log.Printf("%s取消订单,订单号%s\n", payWay, tradeno)
-	if payWay == "支付宝" {
+	if payWay == "ali_pc" {
 		status = Alipay.CloseOrder(tradeno)
 	}
-	if payWay == "微信" {
+	if payWay == "wx_pc" {
 		status = public.WxStruct.CloseOrder(config.Sysconfig["weixinrpc"].(string), tradeno)
 	}
 	if !status {

+ 5 - 5
src/web/templates/pc/createOrderPage.html

@@ -157,7 +157,7 @@
 	var finishEmailVerity=false;
 	var readClause=false;
 	var dataType=1;
-  var pay_way="weixin";
+  var pay_way="wx_pc";
 	var finishPhoneVerity=false;
 	
 	var email_lastInput={{.T.email}}
@@ -384,18 +384,18 @@
     if(sessionStorage.getItem("order_payway"+{{.T._id}})!=null){
       pay_way=sessionStorage.getItem("order_payway"+{{.T._id}})  
     }
-    if(pay_way=="weixin"){
+    if(pay_way=="wx_pc"){
       $(".payway .wx").addClass("active");
-    }else if(pay_way=="alipay"){
+    }else if(pay_way=="ali_pc"){
       $(".payway .alipay").addClass("active");
     }
     //支付方式切换
     $(".payway>div").on("click",function(){
       $(this).addClass("active").siblings().removeClass("active");
       if($(this).hasClass("wx")){
-        pay_way="weixin"
+        pay_way="wx_pc"
       }else if($(this).hasClass("alipay")){
-        pay_way="alipay"
+        pay_way="ali_pc"
       }
     })
     

+ 3 - 3
src/web/templates/pc/myOrder.html

@@ -540,9 +540,9 @@
 				if ($(this).hasClass("underline")) {
 					return
 				}
-				payway = "微信"
+				payway = "wx_pc"
 				if ($(this).text() == "支付宝") {
-					payway = "支付宝"
+					payway = "ali_pc"
 				}
 				$.post("/dataexport/getOrderPayMsg", {
 					payway: payway,
@@ -569,7 +569,7 @@
         
 				$("#myModal .price").text("¥" + price);
 				interval_t = parseInt(t / 1000);
-				if (payway == "微信") {
+				if (payway == "wx_pc") {
 					$("#myModal .active:eq(0)").addClass("underline").parent('li').siblings().children().removeClass("underline");
 					$("#myModal .qr_code").html("<img src='data:image/png;base64," + code + "'>");
 					$("#paywaytip").text("使用手机微信扫描二维码支付");

+ 11 - 5
src/web/templates/pc/waitpay.html

@@ -131,24 +131,30 @@
             <div class="center clearfix">
                 <div class="fl">
 					<div style="position:relative;width: 300px;height: 300px;user-select: none;">
-            {{if eq .T.pay_way "微信"}}
+            {{if eq .T.pay_way "wx_pc"}}
 						  {{if .T.qrcode}}<img src="data:image/png;base64,{{.T.qrcode}}" style="width: 330px;position:relative;left:-15px;top:-15px;">{{end}}
             {{end}}
-            {{if eq .T.pay_way "支付宝"}}
+            {{if eq .T.pay_way "ali_pc"}}
               <iframe src={{.T.qrcode}} style="width: 330px;height:330px;border:none;padding-left: 25px;padding-top: 25px;">
               </iframe>
             {{end}}
 						<a style="border-radius:3px;position:absolute;left: 0;top:0px;border: 1px solid #ccc;width: 300px;height:300px;"></a>
 					</div>
                     <div style="text-align:left;font-size: 16px; color: #1d1d1d;padding-left: 30px;margin-top: 30px;">
-						<img src="{{Msg "seo" "cdn"}}/dataExport/image/wx_cm.jpg" style="vertical-align: middle;margin-right:10px;position: relative;top: -2px;"><span>使用手机{{.T.pay_way}}扫描二维码支付</span>
+						<img src="{{Msg "seo" "cdn"}}/dataExport/image/wx_cm.jpg" style="vertical-align: middle;margin-right:10px;position: relative;top: -2px;">
+            {{if eq .T.pay_way "wx_pc"}}
+            <span>使用手机微信扫描二维码支付</span>
+            {{end}}
+            {{if eq .T.pay_way "ali_pc"}}
+            <span>使用手机支付宝扫描二维码支付</span>
+            {{end}}
 					</div>
                 </div>
                 <div class="fr">
-                {{if eq .T.pay_way "微信"}}
+                {{if eq .T.pay_way "wx_pc"}}
                     <img src="{{Msg "seo" "cdn"}}/dataExport/image/phone_wx.png" alt="">
                 {{end}}
-                {{if eq .T.pay_way "支付宝"}}
+                {{if eq .T.pay_way "ali_pc"}}
                      <img src="{{Msg "seo" "cdn"}}/dataExport/image/phone_zfb.png" alt="">
                 {{end}}
                 </div>

+ 11 - 10
src/web/templates/weixin/datareport/dataReport_info.html

@@ -21,7 +21,7 @@
                         <div class="form-control name">
                             <label for="">姓名</label>
                             <div class="input">
-                                <input type="text" id="name" placeholder="输入姓名" value={{.T.name}}>
+                                <input type="text" id="name" placeholder="输入姓名" maxlength=50 value={{.T.name}}>
                             </div>
                         </div>
                     </div>
@@ -29,7 +29,7 @@
                         <div class="form-control tel">
                             <label for="">手机号</label>
                             <div class="input">
-                                <input type="text" id="phone" placeholder="输入手机号" value={{.T.phone}}>
+                                <input type="text" id="phone" placeholder="输入手机号" maxlength=11 value={{.T.phone}}>
                             </div>
                         </div>
                     </div>
@@ -45,7 +45,7 @@
                         <div class="form-control company">
                             <label for="">公司名称</label>
                             <div class="input">
-                                <input type="email" id="company" placeholder="输入公司名称" value={{.T.company}}>
+                                <input type="email" id="company" placeholder="输入公司名称" maxlength=100 value={{.T.company}}>
                             </div>
                         </div>
                     </div>
@@ -152,14 +152,14 @@
                 })
                 
                 $('.form-control.name input').on('blur', function () {
-                    if (!s_name) {
-                        showToast('姓名不能为空')
+                    if (s_name.length>50||s_name.length<2) {
+                        showToast('请输入有效的姓名')
                     }
                 })
   
                 $('.form-control.company input').on('blur', function () {
-                    if (!s_company) {
-                        showToast('公司名称不能为空')
+                    if (s_company.length>100||s_company.length<2) {
+                        showToast('请输入有效的公司名称')
                     }
                 })
                  $('.form-item input').on('input propertychange',function(){
@@ -173,7 +173,7 @@
                   s_company=$("#company").val();
                   s_phone=$("#phone").val();
                   s_email=$("#email").val();
-                  if(s_name&&reg_tel.test(s_phone)&&reg_email.test(s_email)&&s_company){
+                   if(s_name.length>1&&s_name.length<50&&reg_tel.test(s_phone)&&reg_email.test(s_email)&&s_company.length>1&&s_company.length<100){
                     btn.prop('disabled', false)
                   }else{
                     btn.prop('disabled', true)  
@@ -184,6 +184,7 @@
                   if(!canpay){
                     return
                   }
+                  canpay=false
                   $.post("/front/dataReport/toWxjsPay", {
                       "s_name": s_name,
                       "s_phone": s_phone,
@@ -208,7 +209,7 @@
                 interval=setInterval(function() {
                   $.post("/front/dataReport/isPaySuccess",{"payOrderId":orderid},function(r){
                     if(r.success){
-                      window.location.href = "/front/dataReport/paySuccess?email="+s_email;
+                      window.location.href = "/front/dataReport/paySuccess?email="+s_email+"&title="+{{.T.title}};
                     }
                   })
                   if(canpay){
@@ -228,7 +229,7 @@
         					},
         					function(r){
         				    if(r.err_msg == "get_brand_wcpay_request:ok"){
-        							window.location.replace("/front/dataReport/paySuccess");
+        							//window.location.replace("/front/dataReport/paySuccess?email="+s_email);
         						}else if(r.err_msg == "get_brand_wcpay_request:cancel"){
         							//取消支付 可以再次支付
         							canpay=true;

+ 1 - 1
src/web/templates/weixin/datareport/dataReport_success.html

@@ -2,7 +2,7 @@
 <html lang="zh-CN">
     <head>
         <meta charset="utf-8">
-        <title>支付成功</title>
+        <title>{{.T.title}}</title>
         <meta name="viewport" content="initial-scale=1, maximum-scale=1">
         <meta name="apple-mobile-web-app-capable" content="yes">
         <meta name="apple-mobile-web-app-status-bar-style" content="black">

+ 0 - 6
src/web/templates/weixin/search/mainSearch.html

@@ -88,12 +88,6 @@
 					<div>更多精彩,下载剑鱼标讯APP</div>
 				</a>
 			</li>
-      <li>
-				<a href="/weixin/pay/dataReport?reportId=1">
-					<div>厕所革命</div>
-					<div>付费购买《厕所革命》招标文档</div>
-				</a>
-			</li>
 		</ul>
 	</section>
 </section>