Files
g.hnyhua.cn/Mtxfw.VipSite/pay/wxpay.aspx
2026-02-07 15:48:27 +08:00

201 lines
6.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wxpay.aspx.cs" Inherits="Mtxfw.shop.wxpay" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="Cache-Control" content="no-transform " />
<link rel ="alternate" media ="handheld" href ="#" />
<link rel="Shortcut Icon" href="/favicon.ico">
<link href="/mobile/css/myShoppingCart.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Scripts/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
function iswxpayed() {
var BillNo = "<%=strBillNo %>";
if (BillNo != "") {
$.post("/Ajax.ashx", { action: "iswxpayed", BillNoe: escape(BillNo) }, function (data) {
if (data == "0") {
$("#showmsg").html("<font color=\"red\">您已完成支付,正在跳转中...</font>");
location.replace("/Member_Orders_List.aspx");
}
});
}
}
$(document).ready(function () {
<%if (IFApp == "0")
{ %>
var wxpay;
iswxpayed();
clearTimeout(wxpay);
wxpay = setInterval("iswxpayed()", 5000);
<%} %>
});
</script>
<style type="text/css">
a,a:visited{ text-decoration:none;}
header.main {
width:100%;
margin:0;
padding:0;
background:#fff;
position:relative;
float:left;
height:3em;
line-height:3em;
border-bottom:1px solid #efefef;
}
.logo {
margin:0;
font-size:1.4em;
text-align:center
}
header.main .logo {
font-family:"museo-sans","Museo Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight:300;
font-weight:700;
float:none;
width:100%;
margin:0 auto;
position:relative;
}
header.main a.menu-trigger,header.main a.menu-trigger:visited {
position:absolute;
top:0.5em;
left:1em;
padding:0;
display:block;
width:auto;
height:100%;
}
header.main a.menu-trigger img,header.main a.menu-trigger:visited img
{
width:1.3em;
height:1.3em;
}
header.main a.fanhui-trigger,header.main a.fanhui-trigger:visited {
position:absolute;
top:0;
left:2em;
padding:0;
font-size:1.2em;
display:block;
width:auto;
height:100%;
line-height:2.8em;
}
.ulbox{float:left;margin:0;width:100%;overflow:hidden;}
.ulbox ul{float:left;width:100%;margin:0; list-style-type:none;overflow:hidden;}
.ulbox ul li{float:left;width:100%; line-height:40px; text-align:center; padding:0;overflow:hidden; box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;}
a.paybutton,a.paybutton:visited
{
float:left;
display:block;
width:8em;
height:3em;
text-align:center;
background-color:#fff;
border:1px solid #dfdfdf;
overflow:hidden;
}
a.paybutton img,a.paybutton:visited img
{
margin-top:0.2em;
width:80%;
height:80%;
}
a.needMoney_Purple,a.needMoney_Purple:visited
{
margin:0 auto;
width:80%;
height:35px;
display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;
background-color:#ff4a00;
line-height:35px;
font-size:16px;
text-align:center;
color:#fff;
font-weight:bold;
cursor:pointer;
border:0;
-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;
}
a.needMoney_Purple.needMoney_Purpled,a.needMoney_Purple:visited.needMoney_Purpled:visited
{
background-color:#00c1f9;
}
</style>
</head>
<body id="activity-detail" style="max-width: 720px;margin:0px auto; position:relative;">
<form runat="server">
<%if (IFApp == "1")
{ %>
<input type="hidden" name="hidBillID" value="" id="hidBillID" runat="server" />
<script type="text/javascript">
// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.invoke('getBrandWCPayRequest', <%=wx_packageValue %>
, function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
location.replace("wxpayreturn_url.aspx?bill="+$("#hidBill").val());
}else{
$(".ulbox").show();
//alert(res.err_msg);
}
// 使用以上方式判断前端返回,微信团队郑重提示res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
//因此微信团队建议当收到ok返回时向商户后台询问是否收到交易成功的通知若收到通知前端展示交易成功的界面若此时未收到通知商户后台主动调用查询订单接口查询订单的当前状态并反馈给前端展示相应的界面。
});
//公众号支付
jQuery('a#getBrandWCPayRequest').click(function (e) {
//alert("<%=wx_packageValue %>");
$(".ulbox").hide();
WeixinJSBridge.invoke('getBrandWCPayRequest', <%=wx_packageValue %>
, function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
location.replace("wxpayreturn_url.aspx?bill=" + $("#hidBill").val());
} else {
$(".ulbox").show();
}
// 使用以上方式判断前端返回,微信团队郑重提示res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
//因此微信团队建议当收到ok返回时向商户后台询问是否收到交易成功的通知若收到通知前端展示交易成功的界面若此时未收到通知商户后台主动调用查询订单接口查询订单的当前状态并反馈给前端展示相应的界面。
});
});
}, false)
</script>
<div class="ulbox">
<ul>
<li>您需要支付¥<span style=" color:Red; font-size:16px; font-weight:bold;"><asp:Label ID="paybill" runat="server"></asp:Label></span>元</li>
<li style=" margin-top:1em;"><a href="javascript:location.reload();" class="needMoney_Purple">继续支付</a></li>
<li style=" margin-top:1em;"><a href="/Member_Orders_List.aspx" class="needMoney_Purple needMoney_Purpled">已完成付款</a></li>
</ul>
</div>
<%
}
else
{ %>
<div style="padding:2em;">正在跳转中,请稍候...</div>
<%} %>
</form>
</body>
</html>