| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <%@ page language="java" pageEncoding="UTF-8"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
- <meta name="renderer" content="webkit">
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <meta name="applicable-device" content="mobile">
- <meta name="format-detection" content="telephone=no" />
- <meta http-equiv="title" content="" />
- <title>购买套餐</title>
- <meta name="description" content="" />
- <meta name="keywords" content="" />
- <link rel="stylesheet" href="/static/css/animate.min.css" type="text/css" media="all" />
- <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="all" />
- <link rel="stylesheet" href="/static/css/swiper-bundle.min.css" type="text/css" media="all" />
- <script language="javascript" type="text/javascript" src="/static/js/jquery-3.6.0.min.js"></script>
- <script language="javascript" type="text/javascript" src="/static/js/animate.min.js"></script>
- <script language="javascript" type="text/javascript" src="/static/js/main.js"></script>
- <script language="javascript" type="text/javascript" src="/static/js/swiper-bundle.min.js"></script>
- <style>
- .form-wallet{
- border-bottom: 1px solid #f0f0f0;
- }
- .form-wallet .form-item{
- border-bottom: none;
- }
- .wallet-money{
- display: none;
- width: 100%;
- padding: 2px 25px;
- height:65px;
- position: relative;
- }
- .wallet-money.show{
- display: block;
- }
- .wallet-container{
- display: block;
- width: 100%;
- min-height:45px;
- position: relative;
- list-style: none;
- overflow: hidden;
- z-index: 1;
- }
- .wallet-container .swiper-slide{
- display: block;
- width: 33.33%;
- height: 45px;
- position: relative;
- border-radius: 8px;
- overflow: hidden;
- background-color: #FFFFFF;
- border: 1px solid #e8e8e8;
- }
- .wallet-container .swiper-slide.cur{
- border: 1px solid #cb5f1f;
- }
- .wallet-container .swiper-slide img{
- display: block;
- width: 100%;
- max-height: auto;
- }
- .wallet-container .swiper-slide .sum{
- position: relative;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
- font-size: 14px;
- font-family: Arial;
- font-weight: bold;
- text-align: center;
- padding-top: 10px;
- }
- .wallet-container .swiper-slide .sum::after{
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- width: 100%;
- height: 10px;
- background-color: #dd170e;
- }
- .swiper-button-prev{
- left: 0;
- }
- .swiper-button-next{
- right: 0;
- }
- .swiper-button-prev,.swiper-button-next{
- top: 17px;
- margin-top: 0;
- width: 15px;
- height: 15px;
- opacity: 0.6;
- }
- .swiper-button-disabled{
- opacity: 0.2;
- }
- .swiper-button-next:after,.swiper-button-prev:after{
- color: #929292;
- font-size: 18px;
- }
- .swiper-button-next:hover:after,.swiper-button-prev:hover:after{
- color: #FF6600;
- }
- </style>
- </head>
- <body>
- <input name="amount" id="trxamt"/>
- <input type="hidden" value="${u}" id="u"/>
- <input type="button" class="btn" value="支付" />
- <div class="mask"></div>
- <script>
- $(document).ready(function() {
- $(".btn").click(function(e){
- var param = {};
- param['amt']=$("#trxamt").val();
- $.post($("#u").val(),param,function(res){
- $('.mask').hide();
- if(typeof(res) === 'string'){
- res = JSON.parse(res);
- if(res.pay_info !== undefined) {
- var payInfo = JSON.parse(res.pay_info);
- }
- //alert(res.pay_info);
- }
- if(res.status !== "200"){
- alert(res.msg);
- }else{
- var payInfo = JSON.parse(res.pay_info);
- WeixinJSBridge.invoke(
- 'getBrandWCPayRequest',{
- "appId" : payInfo.appId, //公众号名称,由商户传入
- "timeStamp": payInfo.timeStamp, //戳,自1970 年以来的秒数
- "nonceStr" : payInfo.nonceStr, //随机串
- "package" : payInfo.package,
- "signType" : payInfo.signType, //微信签名方式:
- "paySign" : payInfo.paySign //微信签名,
- },function(res){
- if(res.err_msg == "get_brand_wcpay_request:ok" ) {
- // 此处可以使用此方式判断前端返回,微信团队郑重提示:res.err_msg 将在用户支付成功后返回ok,但并不保证它绝对可靠。
- location.href = "/result.html";
- }
- }
- );
- }
- isRequesting = false;
- });
- });
- });
- </script>
- </body>
- </html>
|