<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta content="telephone=no" name="format-detection"> <meta name="wap-font-scale" content="no"> <script src="fsize.js"></script> <script src="jquery-3.1.1.min.js"></script> <link rel="stylesheet" href="base.css"> <link rel="stylesheet" href="fireflyPay.css?v='2018060681'"> <link rel="stylesheet" href="layer.css"> <title></title> <style> .p-w { background-color: #11101A; } .gash-for-ul { margin: 0 auto; width: 10rem; } .gash-for-ul li { height: 1.45rem; line-height: 1.45rem; color: #00F8DC; background: #11101A; margin-bottom: 0.05rem; border: 0.04rem solid transparent; } .p-active { border: 0.04rem solid #1cebd1 !important; } .gash-for-ul li img { width: 0.5rem; vertical-align: middle; margin-top: -0.1rem; margin-left: 0.5rem; } .gash-for-ul li span { margin-left: 0.3rem; font-size: 0.45rem; } .gash-for-ul li button { height: 0.73rem; line-height: 0.75rem; width: 2.2rem; background: linear-gradient(to right, #00f088, #00a0e9); border-radius: 2rem; color: #fff; float: right; margin-top: 0.35rem; margin-right: 0.46rem; font-size: 0.4rem; } .gash-rid { visibility: hidden; } .login-tips { color: #00a0e9; background-color: #11101A; margin-top: 1rem; } .paypal { background-color: #11101A; } .login-btn { margin-top: .5rem; } </style> </head> <body> <div class="p-w alipay"> <ul class="gash-for-ul clearfix"> </ul> <p class="login-tips"></p> </div> </body> <script src="jquery-3.1.1.min.js"></script> <script src="payLangchange.js?v=202007081530"></script> <script src="layer-v3.1.0/layer/layer.js"></script> <script> $('title').text(langList[langType].paytitle); $('.login-tips').text(langList[langType].ques); var bbb = location.href; var data = url_get_params(bbb) sessionStorage.lang = data.lang; sessionStorage.uid = data.uid; sessionStorage.pay = data.pay; sessionStorage.payStatus = data.payStatus; sessionStorage.cidStr = data.cidStr || 'web_gw'; sessionStorage.osStr = data.osStr || 'h5'; function url_get_params(url_path) { var url = url_path; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(url.indexOf("?") + 1); strs = str.split("&"); for (var i = 0; i < strs.length; i++) { theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]); } } return theRequest; } var btnOk = false; $.ajax({ url: $ip + "/setting/getRecharge.html", type: "post", data: { 'cid': "web_gw", 'os': "h5", lang: sessionStorage.lang, 'vest': 0, 'paytype': sessionStorage.pay }, error: function (msg) { console.log('请求出错'); }, success: function (msg) { var data = JSON.parse(msg); var html = []; for (var i = 0; i < data.data.length; i++) { html += '<li>' html += '<img src="../img/zuan.png"><span>' + data.data[i].diamond + '</span>' html += '<button>' + data.data[i].price[0].currency + '<i style="font-style:normal">' + data.data[i].price[0].price + '</i></button>'; html += '<span class="gash-rid">' + data.data[i].rid + '</span>'; html += '</li>' } $(".gash-for-ul").html(html); $(".gash-for-ul li").on("click", function () { rid = $(this).find('.gash-rid').text(); console.log(rid); money = $(this).find('button i').text(); console.log(money); btnOk = true; // var html=[]; // html+='<div><button class="next-btn btn" id="next-go">确认</button></div>'; // $(".paypalh").html(html); // $(".next-btn").attr("id","next-go"); // $('.next-btn').attr("disabled",false); if (btnOk == true) { if (sessionStorage.pay == "PAYPALPAY") { $.ajax({ url: $ip + "/pay/getPayPreid.html", type: "post", data: { 'cid': "web_gw", 'os': "h5", lang: sessionStorage.lang, 'uid': sessionStorage.uid, 'product': "橙钻充值", 'country': "86", 'rid': rid, 'payType': sessionStorage.pay, 'payTypeSub': "NAVITE", 'amount': money * 100, 'extend': "0", }, success: function (msg) { var data = JSON.parse(msg); // $.cookie('oid',data.orderId,{expires:1}); sessionStorage.oid = data.orderId; key = data.payInfo.key; var html1 = []; html1 += "<div style=' text-align: center;margin-top: 1.7rem;' class='paypalpay'>"; html1 += "<div id=paypal-button-container></div>"; html1 += "</div>"; $(".paypal").html(html1); paypal.Button.render({ env: 'production', // sandbox | production // PayPal Client IDs - replace with your own // Create a PayPal app: https://developer.paypal.com/developer/applications/create client: { production: key, // production: '<insert production client id>' }, style: { color: 'gold', size: 'large', shape: 'rect', locale: 'zh_US', }, // Show the buyer a 'Pay Now' button in the checkout flow commit: true, // payment() is called when the button is clicked payment: function (data, actions) { // Make a call to the REST api to create the payment return actions.payment.create({ payment: { transactions: [ { amount: { total: money, currency: 'USD' }, custom: sessionStorage.oid, } ] } }); }, // onAuthorize() is called when the buyer approves the payment onAuthorize: function (data, actions) { // Make a call to the REST api to execute the payment return actions.payment.execute().then(function () { setInterval(function () { window.location.href = 'payend.html'; }, 100) }); } }, '#paypal-button-container'); } }) } else if (sessionStorage.pay == "ALIPAY") { $.ajax({ url: $ip + "/pay/getPayPreid.html", type: "post", data: { 'cid': "web_gw", 'os': "h5", lang: sessionStorage.lang, 'uid': sessionStorage.uid, 'product': "橙钻充值", 'country': "86", 'rid': rid, 'payType': sessionStorage.pay, 'payTypeSub': "H5", 'amount': money * 100, 'extend': "https://www.yabolive.tv/phonepay/payend.html", }, success: function (msg) { console.log(msg); var data = JSON.parse(msg); // $.cookie('oid',data.orderId,{expires:1}); sessionStorage.oid = data.orderId; var html = []; console.log(data); html += data.payInfo.h5 $(".alipay").html(html); } }) } else if (sessionStorage.pay == "WECHATPAY") { var extend = 'https://www.yabolive.tv/phonepay/payend.html'; if (sessionStorage.payStatus == 1) { extend = 'https://www.yabolive.tv/phonepay/payend.html?payStatus=' + sessionStorage.payStatus; } $.ajax({ url: $ip + "/pay/getPayPreid.html", type: "post", data: { 'cid': sessionStorage.cidStr, 'os': sessionStorage.osStr, lang: sessionStorage.lang, 'uid': sessionStorage.uid, 'product': langList[langType].visatitle, 'country': "86", 'rid': rid, 'payType': sessionStorage.pay, 'payTypeSub': "MWEB", 'amount': money * 100, 'extend': extend, }, success: function (msg) { var data = JSON.parse(msg); // $.cookie('oid',data.orderId,{expires:1}); sessionStorage.oid = data.orderId; var url = data.payInfo.mweb_url; window.location.href = url; } }) } else if (sessionStorage.pay == 'MOLPAY') { $.ajax({ url: "https://webserver.yabolive.net/pay/getPayPreid.html", type: "post", data: { 'cid': "web_gw", 'os': "h5", lang: sessionStorage.lang, "uid": sessionStorage.uid, "product": "橙钻货币充值", "country": "86", "rid": rid, "lang": 2, "payType": sessionStorage.pay, "payTypeSub": "H5", "amount": money * 100, "extend": "0", "returnUrl": "http://www.firefly.live/phonepay/payend.html", }, success: function (msg) { var data = JSON.parse(msg); console.log(data); window.location.href = data.payInfo.url; } }) } } else { if (sessionStorage.lang == 2) layer.msg("請選擇充值金額"); else layer.msg("Please select Top-Up amount"); } }) } }) $(".gash-for-ul").on("click", function () { if (sessionStorage.pay == 'PAYPALPAY') { $(".paypal").html('<button class="login-btn">下一步</button>') $(".login-btn").unbind("click") $(".login-btn").on("click", function () { if (btnOk == true) { if (sessionStorage.pay == "PAYPALPAY") { $.ajax({ url: $ip + "/pay/getPayPreid.html", type: "post", data: { 'cid': "web_gw", 'os': "h5", lang: sessionStorage.lang, 'uid': sessionStorage.uid, 'product': "橙钻充值", 'country': "86", 'rid': rid, 'payType': sessionStorage.pay, 'payTypeSub': "NAVITE", 'amount': money * 100, 'extend': "0", }, success: function (msg) { var data = JSON.parse(msg); // $.cookie('oid',data.orderId,{expires:1}); sessionStorage.oid = data.orderId; key = data.payInfo.key; var html1 = []; html1 += "<div style=' text-align: center;margin-top: 1.7rem;' class='paypalpay'>"; html1 += "<div id=paypal-button-container></div>"; html1 += "</div>"; $(".paypal").html(html1); paypal.Button.render({ env: 'production', // sandbox | production // PayPal Client IDs - replace with your own // Create a PayPal app: https://developer.paypal.com/developer/applications/create client: { production: key, // production: '<insert production client id>' }, style: { color: 'gold', size: 'large', shape: 'rect', locale: 'zh_US', }, // Show the buyer a 'Pay Now' button in the checkout flow commit: true, // payment() is called when the button is clicked payment: function (data, actions) { // Make a call to the REST api to create the payment return actions.payment.create({ payment: { transactions: [ { amount: { total: money, currency: 'USD' }, custom: sessionStorage.oid, } ] } }); }, // onAuthorize() is called when the buyer approves the payment onAuthorize: function (data, actions) { // Make a call to the REST api to execute the payment return actions.payment.execute().then(function () { setInterval(function () { window.location.href = 'payend.html'; }, 100) }); } }, '#paypal-button-container'); } }) } } else { if (sessionStorage.lang == 2) layer.msg("請選擇充值金額"); else layer.msg("Please select Top-Up amount"); } }) } }) </script> </html>