123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="referrer" content="origin" />
- <meta
- name="viewport"
- content="width=device-width, viewport-fit=cover, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
- />
- <meta
- http-equiv="Cache-Control"
- content="no-cache, no-store, must-revalidate"
- />
- <title>支付完成</title>
- <script
- type="text/javascript"
- charset="UTF-8"
- src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"
- ></script>
- <!-- <script
- type="text/javascript"
- src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"
- ></script> -->
- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
- <style>
- body {
- font-family: PingFang SC, "Helvetica Neue", Arial, sans-serif;
- }
- .order_box {
- text-align: center;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- }
- .order_box .bussiness_avt img {
- width: 68px;
- height: 78px;
- }
- .b_name {
- font-size: 20px;
- font-weight: bold;
- color: #333333;
- margin-top: 6px;
- }
- .notice {
- padding: 10px 0;
- font-size: 12px;
- color: #999;
- }
- .btns {
- display: flex;
- align-items: center;
- justify-content: center;
- width:70%;
- margin: 10px auto 0;
- height: 40px;
- line-height: 40px;
- background: linear-gradient(93deg, #f97c55 0%, #f44545 100%);
- border-radius: 39px;
- color:#fff;
- }
- </style>
- </head>
- <body>
- <div class="order_box">
- <div class="bussiness_avt">
- <img
- id="b_avt"
- src="https://s3.ax1x.com/2020/12/17/r8VTKK.png"
- alt=""
- />
- </div>
- <div class="b_name" id="b_name">大卫博士健康内裤</div>
- <div class="notice">感谢您购买大卫博士健康内裤,祝您身体健康!</div>
- <div class="btns" id="button">查看订单详情</div>
- </div>
- <script>
- $(document).ready(function () {
- // var vConsole = new VConsole(); //初始化console
- // console.log(window.location.href, "页面链接");
- // console.log(window.location.search, "链接参数");
- var initData = {
- //初始化小票信息
- action: "onIframeReady",
- displayStyle: "SHOW_CUSTOM_PAGE",
- }; //display可以展示官方的,也可以展示自定义的
- var initPostData = JSON.stringify(initData);
- parent.postMessage(initPostData, "https://payapp.weixin.qq.com"); //父页面的交互 这一行很重要
- //获取参数
- var sub_mch_id = getQueryString("sub_mch_id"); //特约商户号
- var out_trade_no = getQueryString("out_trade_no"); //商户订单号
- var check_code = getQueryString("check_code"); //md5 校验码
- let data = {
- check_code,
- out_trade_no,
- sub_mch_id,
- };
- $.ajax({
- url: "https://weidian.jiuweiyun.cn/api/order/get_pay_result", //正式
- type: "get",
- data: data,
- dataType: "json",
- success: (res) => {
- if (res.code == 200) {
- // console.log(res, "获取订单信息");
- let home = "";
- let info = "";
- let order_no = "";
-
- if (out_trade_no) {
- let index = out_trade_no.lastIndexOf("\_");
- order_no = out_trade_no.substring(
- index + 1,
- out_trade_no.length
- );
- }
- console.log(out_trade_no,'out_trade_no')
- console.log(order_no,'order_no')
- if (res.data.is_help == 1) {
- //代理端
- info =
- "http://api.app.jiuweiyun.cn/api/gzh#/pages/order-info/order-info?order_no=" +
- order_no+'&from='+1;
- // console.log(info,'info')
- } else {
- //用户端
- info =
- "https://weidian.jiuweiyun.cn/web/user#/pages/order-info/order-info?order_no=" +
- order_no;
- }
- //点击跳转到订单管理
- document.getElementById("button").onclick = function () {
- let mchData = {
- action: "jumpOut",
- jumpOutUrl: info,
- };
- let postData = JSON.stringify(mchData);
- parent.postMessage(postData, "https://payapp.weixin.qq.com");
- };
- } else {
- // console.log(11111);
- }
- },
- error: (err) => {
- // console.log(err, "错误信息");
- $("#button").hide();
- },
- });
- //获取返回页面参数
- function getQueryString(name) {
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == name) {
- return pair[1];
- }
- }
- return null;
- }
- });
- </script>
- </body>
- </html>
|