|
@@ -1,14 +1,20 @@
|
|
|
const api = 'https://game.84game.cn/sdk' // 请求地址
|
|
|
let payParam = ''; appId=""; // 支付参数
|
|
|
let wechatPayId = "";
|
|
|
+let query = {}
|
|
|
|
|
|
// 关闭
|
|
|
const closeHandle = () => {
|
|
|
console.log('关闭')
|
|
|
- document.addEventListener('WeixinJSBridgeReady', () => {
|
|
|
+ if (query.isGame) {
|
|
|
+ history.go(-2);
|
|
|
+ } else {
|
|
|
+ document.addEventListener('WeixinJSBridgeReady', () => {
|
|
|
+ WeixinJSBridge.call('closeWindow');
|
|
|
+ }, false);
|
|
|
WeixinJSBridge.call('closeWindow');
|
|
|
- }, false);
|
|
|
- WeixinJSBridge.call('closeWindow');
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 支付
|
|
@@ -30,6 +36,9 @@ const onBridgeReady = () => {
|
|
|
// closeHandle()
|
|
|
// window.location.href = window.location.origin + "/html/wechatPay/paySucc.html";
|
|
|
document.getElementById('succ').style.display = 'block'
|
|
|
+ if (query.isGame) {
|
|
|
+ document.querySelector('.back').innerText = '返回游戏'
|
|
|
+ }
|
|
|
} else if (res.err_msg == "get_brand_wcpay_request:fail") {
|
|
|
document.getElementById('tip').style.display = 'block'
|
|
|
document.getElementsByClassName('tipTitle')[0].innerHTML = '该订单已失效,请回复“2”或游戏内重新下单获取最新支付订单';
|
|
@@ -52,6 +61,11 @@ window.onload = () => {
|
|
|
let arr = s.split('=')
|
|
|
obj[arr[0]] = arr[1]
|
|
|
})
|
|
|
+ query = obj
|
|
|
+ if (obj.isGame) {
|
|
|
+ document.querySelector('.back').innerText = '返回游戏'
|
|
|
+ document.querySelector('.backNoPay').style.display = 'block'
|
|
|
+ }
|
|
|
document.getElementById('money').innerHTML = (obj.amount || '8') + '元'
|
|
|
document.getElementById('title').innerHTML = decodeURIComponent(obj.description) || '购买8元档充值'
|
|
|
document.getElementById('orderNo').innerHTML = '订单号:' + (obj.orderId || '2023010711541555400125675')
|