<!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> body,.p-w{ background-color: #FFEFF4; } .gash-for-ul { margin: 0 auto; width: 10rem; } .gash-for-ul li { height: 1.45rem; line-height: 1.45rem; color: #ff768d; background: #FFEFF4; margin-bottom: 0; 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-for-ul li button { background-image: linear-gradient( #ff768d, #ff768d), linear-gradient( #ffffff, #ffffff); } .gash-rid { visibility: hidden; } .login-tips{ color:#ff768d; margin-top: 1rem; } .paypal{ background-color: #11101A; } .login-btn{ margin-top: .5rem; } </style> </head> <body > <div class="p-w alipay"> <!--<div>--> <!--<p class="apple-top">優惠充值</p>--> <!--</div>--> <ul class="gash-for-ul clearfix"> <img src="loading.png" alt=""> </ul> <p class="login-tips L-Cn">如果出現儲值問題,請聯繫客服</p> <p class="login-tips L-En" >Any question, please contact online services</p> </div> </body> <script src="jquery-3.1.1.min.js"></script> <script src="globalizationJq.js"></script> <script src="layer-v3.1.0/layer/layer.js"></script> <script> if(sessionStorage.lang==1)$("title").text("Top-Up Cherry") else $("title").text("櫻花儲值") var $ip="https://webserver.yabolive.net"; //var $ip='http://ceshi.yabolive.tv/web' var bbb = location.href; var data = url_get_params(bbb) sessionStorage.lang = data.lang; sessionStorage.uid = data.uid; sessionStorage.pay = data.pay; 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="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"){ $.ajax({ url:$ip+"/pay/getPayPreid.html", type:"post", data:{ 'cid':sessionStorage.cidStr, 'os':sessionStorage.osStr, lang:sessionStorage.lang, 'uid':sessionStorage.uid, 'product':"橙钻充值", 'country':"86", 'rid':rid, 'payType':sessionStorage.pay, 'payTypeSub':"MWEB", 'amount':money*100, 'extend':"https://www.yabolive.tv/phonepay/payend.html", }, 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>