Tree 1 сар өмнө
parent
commit
1feb5bb546

+ 9 - 0
README.md

@@ -0,0 +1,9 @@
+https://你的落地域名/index.html?pxid=123456789012345&fbclid={{fbclid}}&ad_id={{ad.id}}&adset_id={{adset.id}}&campaign_id={{campaign.id}}
+
+	•	页面会用 pxid 初始化 Pixel
+	•	点击按钮时:
+	•	上报 Lead
+	•	跳到:
+https://www.usslot777.com/?c=104&pxid=...&fbclid=...&ad_id=...&adset_id=...&campaign_id=...&pixel=pxid
+
+如果你想再加一些事件(比如 LandingView 后 3 秒自动上报一个 ViewContent,或者你后面接注册 / 充值页面的 Pixel 方案),我可以在这个基础上继续帮你扩展。

+ 5 - 1
app/Http/Controllers/Admin/RechargeController.php

@@ -873,7 +873,11 @@ class RechargeController extends Controller
                 1 => 'cashapp',
                 2 => 'paypal',
                 4 => 'applepay',
-                8 => 'googlepay'
+                8 => 'googlepay',
+                64 => 'usdt-trc20',
+                128 => 'usdt-erc20',
+                256 => 'usdc-trc20',
+                512 => 'usdc-erc20'
             ];
             
             foreach ($payMethodsMap as $value => $name) {

+ 1 - 1
app/Http/Controllers/Game/LoginController.php

@@ -1310,7 +1310,7 @@ class LoginController extends Controller
 //            $guser['password'] = $password;
 //        }
 
-
+        Util::WriteLog('register_params',$request);
         return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));//->withCookie($this->setLoginCookie($guser['sign']));
     }
 

+ 11 - 1
app/Http/Controllers/Game/PayRechargeController.php

@@ -11,6 +11,7 @@ use App\Http\helper\NumConfig;
 use App\Models\Order;
 use App\Services\OrderServices;
 use App\Utility\SetNXLock;
+use App\Util;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Redis;
@@ -85,7 +86,7 @@ class PayRechargeController extends Controller
 
 
 
-        $gear=\GuzzleHttp\json_encode($names);
+        $gear = Util::filterGearByDevice(\GuzzleHttp\json_encode($names));
         foreach ($list as &$val) {
             $val->favorable_price = $val->favorable_price + $val->give;
             $val->gear = $gear;
@@ -136,6 +137,9 @@ class PayRechargeController extends Controller
                 if ($val->money == $giftConfig->recommend) {
                     $val->recommend = 1;
                 }
+                if (!empty($val->gear)) {
+                    $val->gear = Util::filterGearByDevice($val->gear);
+                }
             }
             
             // ========== 处理倒计时逻辑(仅未购买时) ==========
@@ -654,6 +658,9 @@ class PayRechargeController extends Controller
             if ($val->money == $firstPayGift->recommend) {
                 $val->recommend = 1;
             }
+            if (!empty($val->gear)) {
+                $val->gear = Util::filterGearByDevice($val->gear);
+            }
         }
 
         return apiReturnSuc([
@@ -737,6 +744,9 @@ class PayRechargeController extends Controller
                 $gear->gift_id = $gift->gift_id;
                 $gear->total_bonus = $gift->total_bonus;
                 $gear->bonus = $gift->total_bonus - 100;
+                if (!empty($gear->gear)) {
+                    $gear->gear = Util::filterGearByDevice($gear->gear);
+                }
                 $result[] = $gear;
             }
         }

+ 6 - 0
app/Http/Controllers/Game/RechargeController.php

@@ -35,6 +35,12 @@ class RechargeController
             ->select('id','money','favorable_price','give','recommend','gear')
             ->orderBy('money', 'asc')->where('status', 1)->get();
 
+        foreach ($list as $item) {
+            if (!empty($item->gear)) {
+                $item->gear = Util::filterGearByDevice($item->gear);
+            }
+        }
+
         return apiReturnSuc(['list'=>$list,'bonus_show'=>false]);
     }
 

+ 10 - 2
app/Http/logic/admin/RechargeLogic.php

@@ -134,7 +134,11 @@ class RechargeLogic extends BaseApiLogic
             'cashapp' => 'CashApp',
             'paypal' => 'PayPal',
             'applepay' => 'ApplePay',
-            'googlepay' => 'GooglePay'
+            'googlepay' => 'GooglePay',
+            'usdt-trc20' => 'USDT-TRC20',
+            'usdt-erc20' => 'USDT-ERC20',
+            'usdc-trc20' => 'USDC-TRC20',
+            'usdc-erc20' => 'USDC-ERC20'
         ];
         
         foreach ($list as &$value) {
@@ -266,7 +270,11 @@ class RechargeLogic extends BaseApiLogic
             1 => 'cashapp',
             2 => 'paypal',
             4 => 'applepay',
-            8 => 'googlepay'
+            8 => 'googlepay',
+            64 => 'usdt-trc20',
+            128 => 'usdt-erc20',
+            256 => 'usdc-trc20',
+            512 => 'usdc-erc20'
         ];
         
         foreach ($payMethodsMap as $value => $name) {

+ 63 - 0
app/Util.php

@@ -421,6 +421,69 @@ class Util {
         return 'android';
     }
 
+    /**
+     * 根据当前设备类型过滤充值档位的支付方式
+     * Android:隐藏 ApplePay (value/type == 4)
+     * iOS:隐藏 GooglePay (value/type == 8)
+     *
+     * @param string|array $gear
+     * @return string|array
+     */
+    public static function filterGearByDevice($gear)
+    {
+        $isString = false;
+        if (is_string($gear)) {
+            $decoded = json_decode($gear, true);
+            if (json_last_error() !== JSON_ERROR_NONE) {
+                return $gear;
+            }
+            $gearArray = $decoded;
+            $isString = true;
+        } elseif (is_array($gear)) {
+            $gearArray = $gear;
+        } else {
+            return $gear;
+        }
+
+        if (!is_array($gearArray)) {
+            return $gear;
+        }
+
+        $deviceType = self::getDeviceType();
+
+        $filtered = array_filter($gearArray, function ($item) use ($deviceType) {
+            $status = $item['status'] ?? 1;
+            if ($status != 1) {
+                return true;
+            }
+
+            $value = null;
+            if (isset($item['value'])) {
+                $value = (int)$item['value'];
+            } elseif (isset($item['type'])) {
+                $value = (int)$item['type'];
+            }
+
+            if ($value === null) {
+                return true;
+            }
+
+            if ($deviceType === 'android' && $value === 4) {
+                return false;
+            }
+
+            if ($deviceType === 'ios' && $value === 8) {
+                return false;
+            }
+
+            return true;
+        });
+
+        $filtered = array_values($filtered);
+
+        return $isString ? json_encode($filtered, JSON_UNESCAPED_UNICODE) : $filtered;
+    }
+
     public static function jsonp( $data, $callback = 'callback' ) {
         @header( 'Content-Type: application/json' );
         @header( "Expires:-1" );

+ 174 - 0
public/h5.html

@@ -0,0 +1,174 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="utf-8" />
+    <title>USSlot77 - Get Free Bonus</title>
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
+
+    <style>
+        * {
+            box-sizing: border-box;
+            margin: 0;
+            padding: 0;
+        }
+
+        html, body {
+            width: 100%;
+            height: 100%;
+            background: #000;
+            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+            Helvetica, Arial, sans-serif;
+        }
+
+        body {
+            display: flex;
+            justify-content: center;
+            align-items: stretch;
+        }
+
+        /* Main canvas area (designed for 720x1280) */
+        .stage {
+            position: relative;
+            width: 100%;
+            max-width: 720px;
+            height: 100vh;
+            max-height: 1280px;
+            overflow: hidden;
+            background: #000 url("https://usslots-s3.s3.us-east-1.amazonaws.com/h5-images/bg_01.png") no-repeat top center;
+            background-size: cover;
+            cursor: pointer; /* Entire page is clickable */
+        }
+
+        /* Top green banner */
+        .top-bar {
+            position: absolute;
+            top: 0;
+            left: 50%;
+            transform: translateX(-50%);
+            width: 100%;
+            max-width: 720px;
+            height: auto;
+            z-index: 5;
+            pointer-events: none; /* Click is handled by .stage */
+        }
+
+        /* Popup mask (not closable) */
+        .popup-mask {
+            position: absolute;
+            inset: 0;
+            background: rgba(0, 0, 0, 0.65);
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            z-index: 10;
+        }
+
+        /* Popup image container */
+        .popup {
+            position: relative;
+            width: 78%;
+            max-width: 563px;
+        }
+
+        .popup__img {
+            width: 100%;
+            display: block;
+        }
+    </style>
+
+    <!-- Parse URL parameters and extract pxid -->
+    <script>
+        (function () {
+            function parseQuery(qs) {
+                var res = {};
+                if (!qs) return res;
+                if (qs.charAt(0) === "?") qs = qs.substring(1);
+                var arr = qs.split("&");
+                for (var i = 0; i < arr.length; i++) {
+                    if (!arr[i]) continue;
+                    var kv = arr[i].split("=");
+                    var k = decodeURIComponent(kv[0] || "");
+                    var v = decodeURIComponent(kv[1] || "");
+                    if (k) res[k] = v;
+                }
+                return res;
+            }
+
+            var query = parseQuery(window.location.search);
+
+            // Pixel ID is fully controlled by incoming pxid
+            window.PIXEL_ID_DEFAULT = query.pxid || "";
+            window.QUERY_PARAMS = query;
+        })();
+    </script>
+
+    <!-- Facebook Pixel (uses pxid dynamically) -->
+    <script>
+        !function(f,b,e,v,n,t,s)
+        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
+            n.callMethod.apply(n,arguments):n.queue.push(arguments)};
+            if(!f._fbq)n=f.fbq;n.push=n;n.loaded=!0;n.version='2.0';
+            n.queue=[];t=b.createElement(e);t.async=!0;
+            t.src=v;s=b.getElementsByTagName(e)[0];
+            s.parentNode.insertBefore(t,s)}(window, document,'script',
+            'https://connect.facebook.net/en_US/fbevents.js');
+
+        // Initialize Pixel with pxid
+        fbq('init', window.PIXEL_ID_DEFAULT);
+        fbq('track', 'PageView');
+        fbq('trackCustom', 'LandingView');
+    </script>
+</head>
+<body>
+<div class="stage" id="stageRoot">
+    <!-- Top banner image -->
+    <img src="https://usslots-s3.s3.us-east-1.amazonaws.com/h5-images/top_01.png" alt="Top Bar" class="top-bar" />
+
+    <!-- Popup always shown (not closable) -->
+    <div class="popup-mask" id="bonusPopup">
+        <div class="popup">
+            <img src="https://usslots-s3.s3.us-east-1.amazonaws.com/h5-images/pop_01.png" alt="Popup" class="popup__img" />
+        </div>
+    </div>
+</div>
+
+<script>
+    // Handle click → report Lead → redirect
+    function goToUsslot() {
+
+        // Report exactly one Lead event
+        try {
+            fbq('track', 'Lead', {
+                source: 'page_click',
+                pixel_id: window.PIXEL_ID_DEFAULT || '',
+                event_id: 'click_' + Date.now()
+            });
+        } catch (e) {}
+
+        // Forward ALL URL parameters + pixel=pxid
+        var params = new URLSearchParams(window.location.search || "");
+
+        // pixel must equal pxid
+        if (window.PIXEL_ID_DEFAULT) {
+            params.set('pixel', window.PIXEL_ID_DEFAULT);
+        }
+
+        // c parameter is taken from the landing page URL (no hardcoding)
+        var finalUrl = 'https://www.usslot777.com/';
+        var queryStr = params.toString();
+        if (queryStr) finalUrl += '?' + queryStr;
+
+        window.location.href = finalUrl;
+    }
+
+    // Entire page click → redirect
+    (function () {
+        var stage = document.getElementById('stageRoot');
+        stage.addEventListener('click', function () {
+            goToUsslot();
+        }, false);
+    })();
+</script>
+</body>
+</html>

+ 17 - 0
resources/views/admin/recharge/add.blade.php

@@ -42,6 +42,23 @@
                                         <input class="form-check-input" type="checkbox" name="pay_methods[]" id="googlepay" value="8">
                                         <label class="form-check-label" for="googlepay">GooglePay</label>
                                     </div>
+                                    <br><br>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-trc20" value="64">
+                                        <label class="form-check-label" for="usdt-trc20">USDT-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-erc20" value="128">
+                                        <label class="form-check-label" for="usdt-erc20">USDT-ERC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-trc20" value="256">
+                                        <label class="form-check-label" for="usdc-trc20">USDC-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-erc20" value="512">
+                                        <label class="form-check-label" for="usdc-erc20">USDC-ERC20</label>
+                                    </div>
                                 </div>
 
                                 <div class="form-group">

+ 17 - 0
resources/views/admin/recharge/update_config.blade.php

@@ -49,6 +49,23 @@
                                         <input class="form-check-input" type="checkbox" name="pay_methods[]" id="googlepay" value="8" {{ (($info->pay_methods ?? 0) & 8) ? 'checked' : '' }}>
                                         <label class="form-check-label" for="googlepay">GooglePay</label>
                                     </div>
+                                    <br><br>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-trc20" value="64" {{ (($info->pay_methods ?? 0) & 64) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdt-trc20">USDT-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-erc20" value="128" {{ (($info->pay_methods ?? 0) & 128) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdt-erc20">USDT-ERC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-trc20" value="256" {{ (($info->pay_methods ?? 0) & 256) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdc-trc20">USDC-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-erc20" value="512" {{ (($info->pay_methods ?? 0) & 512) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdc-erc20">USDC-ERC20</label>
+                                    </div>
                                 </div>
 
                                 <button type="button" onclick="commit({{$info->id}})" class="btn btn-sm btn-gradient-primary btn-icon-text">