dzduole 1 tháng trước cách đây
mục cha
commit
51f94bca77

+ 18 - 1
art/fgui/.objs/workspace.json

@@ -7,14 +7,31 @@
     "/"
   ],
   "libview.iconScale": 0,
-  "doc.openedDocs": [],
+  "doc.openedDocs": [
+    "ui://isxx5ak7hxtr3yt",
+    "ui://isxx5ak7m2h4v4de",
+    "ui://isxx5ak7m2h4v4d8",
+    "ui://isxx5ak7jaakv51j",
+    "ui://isxx5ak7uqohv4lk",
+    "ui://isxx5ak7di4vv4mm",
+    "ui://isxx5ak7i4k243h"
+  ],
   "test.device": "iPhone Xs Max",
   "canvasColor": 10066329,
   "auxline2": true,
+  "doc.activeDoc": "ui://isxx5ak7i4k243h",
   "libview.twoColumn": false,
   "libview.expandedNodes": [
     "isxx5ak7",
     "/",
+    "isxx5ak7",
+    "/UIMain/",
+    "isxx5ak7",
+    "/UIMain/component/",
+    "isxx5ak7",
+    "/_shareasset/",
+    "isxx5ak7",
+    "/windows/",
     "37nctnhw",
     "/"
   ],

+ 23 - 0
art/fgui/assets/game/UILevelProp/component/UILevelProp.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="1334,750" designImageLayer="1">
+  <displayList>
+    <graph id="n16_xs1r" name="n16" xy="0,0" size="1334,750" alpha="0.6" type="rect" lineSize="0" fillColor="#ff000000">
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <component id="n1_xs1r" name="myNode" src="xs1r482" fileName="UILevelProp/component/Component85.xml" xy="217,71" pivot="0.5,0.5">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </component>
+    <component id="n15_xs1r" name="closeBtn" src="xs1r483" fileName="UILevelProp/component/Component86.xml" xy="1123,96">
+      <relation target="n1_xs1r" sidePair="left-left,top-top"/>
+    </component>
+    <component id="n17_trk9" name="moneyNode" src="wehi3ug" fileName="UIMoney/UIMoney.xml" xy="217,15" controller="c1,13">
+      <relation target="n1_xs1r" sidePair="center-center"/>
+      <relation target="" sidePair="top-top"/>
+    </component>
+  </displayList>
+  <transition name="t1">
+    <item time="0" type="Alpha" target="n16_xs1r" tween="true" startValue="0" endValue="0.6" duration="12"/>
+    <item time="0" type="Alpha" target="n1_xs1r" tween="true" startValue="0" endValue="1" duration="12"/>
+    <item time="0" type="XY" target="n1_xs1r" tween="true" startValue="217,38" endValue="217,92" duration="12"/>
+  </transition>
+</component>

BIN
art/fgui/assets/game/UIRepentProp/asset/234_2025.png


+ 193 - 8
client/laya/bin/js/bundle.js

@@ -6054,11 +6054,165 @@
     }
     UIModeSelection.uiName = "UIModeSelection";
 
+    class GlobalManager {
+        constructor() {
+        }
+        registerMethod(name, method) {
+            console.log('zh: 注册全局方法', name);
+            this[name] = method;
+        }
+        callMethod(name, ...args) {
+            console.log('zh: 调用全局方法', name);
+            if (this[name]) {
+                return this[name](...args);
+            }
+            else {
+                console.error(`zh: 全局方法 Method ${name} not found`);
+            }
+        }
+    }
+    GlobalManager.instance = new GlobalManager();
+
+    class JSBridgeUtils {
+        constructor() { }
+        static get instance() {
+            if (!this._instance) {
+                this._instance = new JSBridgeUtils();
+            }
+            return this._instance;
+        }
+        initBridge() {
+            if (!Laya.Browser.onAndroid) {
+                console.log('zh:非android dev');
+                return;
+            }
+            let cfg = window['conchConfig'];
+            if (cfg) {
+                var os = cfg.getOS();
+                if (os == "Conch-android") {
+                    this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
+                    if (this.bridge) {
+                        return true;
+                    }
+                    else {
+                        return false;
+                    }
+                }
+                else {
+                    return false;
+                }
+            }
+            else {
+                return false;
+            }
+        }
+        testAd1() {
+            if (!Laya.Browser.onAndroid) {
+                console.log('zh:非android dev');
+                return;
+            }
+            if (!this.initBridge()) {
+                return;
+            }
+            let rs = this.bridge.call("testString", "hello");
+            console.log('zh:testString rs=' + rs);
+        }
+        testAdCallBack() {
+            if (!this.initBridge()) {
+                return;
+            }
+            console.log("zh:testAdCallBack start");
+            const defaultObj = { code: 200, msg: "req update Ui" };
+            const reqObj = { code: 300, msg: "hello java ui" };
+            this.bridge.callWithBack((rsStr) => {
+                const rsObj = JSON.parse(rsStr);
+                console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
+            }, "testAsyncCallback", JSON.stringify(reqObj));
+        }
+        showInternAd(mark) {
+            if (!Laya.Browser.onAndroid) {
+                console.log('zh:非android dev');
+                return;
+            }
+            if (!this.initBridge()) {
+                return;
+            }
+            let rs = this.bridge.call("showInternAd", mark);
+            console.log('zh:showInternAd rs= ' + rs + '   ,mark=' + mark);
+            try {
+                const result = JSON.parse(rs);
+                if (result.code === 200) {
+                    console.log("zh:广告显示成功");
+                }
+                else {
+                    console.warn("zh:广告显示失败:", result.msg);
+                }
+            }
+            catch (e) {
+                console.error("zh:解析桥接返回值失败:", e);
+            }
+        }
+        showRewardAd(mark) {
+            if (!Laya.Browser.onAndroid) {
+                console.log('zh:非android dev');
+                return false;
+            }
+            if (!this.initBridge()) {
+                return false;
+            }
+            let rs = this.bridge.call("showRewardAd", mark);
+            console.log('zh:showRewardAd rs= ' + rs + '   ,mark=' + mark);
+            try {
+                const result = JSON.parse(rs);
+                if (result.code === 200) {
+                    console.log("zh:广告显示成功");
+                    return true;
+                }
+                else {
+                    console.warn("zh:广告显示失败:", result.msg);
+                    return false;
+                }
+            }
+            catch (e) {
+                console.error("zh:解析桥接返回值失败:", e);
+                return false;
+            }
+        }
+        nativeCallJs(msg) {
+            console.log("zh:nativeCallJs received data: 1111", msg);
+            if (msg === 'Ad1') {
+                GlobalManager.instance.callMethod('Ad1');
+                console.log("zh: Ad1 奖励发送成功");
+            }
+            else if (msg === 'Ad2') {
+                GlobalManager.instance.callMethod('Ad2');
+                console.log("zh: Ad2 奖励发送成功");
+            }
+            else if (msg === 'Ad3') {
+                GlobalManager.instance.callMethod('Ad3');
+                console.log("zh: Ad3 奖励发送成功");
+            }
+            else if (msg === 'Ad4') {
+                GlobalManager.instance.callMethod('Ad4');
+                console.log("zh: Ad4 奖励发送成功");
+            }
+            else if (msg === 'Ad5') {
+                console.log("zh: Ad5 奖励发送成功");
+                GlobalManager.instance.callMethod('Ad5');
+            }
+        }
+    }
+
     class UIMain extends UIBase {
         constructor() {
             super();
             this.firstEnter = true;
         }
+        nativeCallJs(msg) {
+            let t = msg;
+            console.log("zh:ts 奖励开始发放-", t);
+            GlobalManager.instance.callMethod(msg);
+        }
         onConstructor() {
             this.ui = ui_UIMain.createInstance();
             this.contentPane = this.ui;
@@ -6083,6 +6237,7 @@
             this.onGetUserInfo();
             this.ui.n83.visible = false;
             Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
+            window['nativeCallJs'] = this.nativeCallJs.bind(this);
         }
         changeSecretary(curUse) {
             let name = cfgTable.secretaryshopData[curUse + 1].spine;
@@ -6238,9 +6393,15 @@
         }
         startGlobal() {
             xGame.uiMgr.Show(UIMsg, "Coming Soon");
+            JSBridgeUtils.instance.showInternAd('全球');
         }
         startWeekly() {
             xGame.uiMgr.Show(UIMsg, "Coming Soon");
+            GlobalManager.instance.registerMethod('zhouSaiMonth', this.zhouSaiMonth);
+            JSBridgeUtils.instance.showRewardAd('zhouSaiMonth');
+        }
+        zhouSaiMonth() {
+            console.log('zh:  zhouSaiMonth 被调用');
         }
         startPlaceBall() {
             xGame.uiMgr.Show(UILevelDisplay);
@@ -10245,12 +10406,18 @@
                 this.checkFree();
             }
             else {
-                Moyu.sendDataEvent("turntable");
-                Moyu.showVideoAd(() => {
-                    this.beginDraw();
-                }, EAdType.draw);
+                GlobalManager.instance.registerMethod('qjff_chouJiang', this.qjff_chouJiang);
+                if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
+                }
+                else {
+                    console.log('zh:AD 失败,直接发放奖励');
+                    this.qjff_chouJiang;
+                }
             }
         }
+        qjff_chouJiang() {
+            this.beginDraw();
+        }
         beginDraw() {
             this.ui.myNode.flashNode.c1.selectedIndex = 0;
             this.ui.drawBtn.touchable = false;
@@ -19668,12 +19835,18 @@
                 this.checkFree();
             }
             else {
-                Moyu.sendDataEvent("turntable");
-                Moyu.showVideoAd(() => {
-                    this.beginDraw();
-                }, EAdType.draw);
+                GlobalManager.instance.registerMethod('qjff_chouJiang', this.qjff_chouJiang);
+                if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
+                }
+                else {
+                    console.log('zh:AD 失败,直接发放奖励');
+                    this.qjff_chouJiang;
+                }
             }
         }
+        qjff_chouJiang() {
+            this.beginDraw();
+        }
         beginDraw() {
             this.ui.myNode.flashNode.c1.selectedIndex = 0;
             this.ui.drawBtn.touchable = false;
@@ -20481,6 +20654,11 @@
             super();
             this.firstEnter = true;
         }
+        nativeCallJs(msg) {
+            let t = msg;
+            console.log("zh:ts 奖励开始发放-", t);
+            GlobalManager.instance.callMethod(msg);
+        }
         onConstructor() {
             this.ui = ui_UIMain.createInstance();
             this.contentPane = this.ui;
@@ -20505,6 +20683,7 @@
             this.onGetUserInfo();
             this.ui.n83.visible = false;
             Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
+            window['nativeCallJs'] = this.nativeCallJs.bind(this);
         }
         changeSecretary(curUse) {
             let name = cfgTable.secretaryshopData[curUse + 1].spine;
@@ -20660,9 +20839,15 @@
         }
         startGlobal() {
             xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
+            JSBridgeUtils.instance.showInternAd('全球');
         }
         startWeekly() {
             xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
+            GlobalManager.instance.registerMethod('zhouSaiMonth', this.zhouSaiMonth);
+            JSBridgeUtils.instance.showRewardAd('zhouSaiMonth');
+        }
+        zhouSaiMonth() {
+            console.log('zh:  zhouSaiMonth 被调用');
         }
         startPlaceBall() {
             xGame.uiMgr.Show(UILevelDisplay$1);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
client/laya/bin/js/bundle.js.map


+ 2 - 1
client/laya/bin/js/cfgTable.js

@@ -294,7 +294,8 @@ cfgTable.emotionData={
         id:8,
         icon:'yxz_bqb8',
         spine:'xiaolian',
-    },
+    }
+    
 }
 //modeselect表数据
 cfgTable.modeselectData={

BIN
client/laya/bin/spine/kuxiao.png


+ 83 - 0
client/laya/bin/spine/nvmishu.atlas

@@ -0,0 +1,83 @@
+
+nvmishu.png
+size: 2048,1024
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+biyan_you
+  rotate: false
+  xy: 1356, 641
+  size: 43, 33
+  orig: 43, 33
+  offset: 0, 0
+  index: -1
+biyan_zuo
+  rotate: false
+  xy: 567, 315
+  size: 52, 32
+  orig: 52, 32
+  offset: 0, 0
+  index: -1
+qiugan
+  rotate: false
+  xy: 567, 349
+  size: 466, 660
+  orig: 466, 660
+  offset: 0, 0
+  index: -1
+renwu
+  rotate: false
+  xy: 2, 282
+  size: 563, 727
+  orig: 563, 727
+  offset: 0, 0
+  index: -1
+toufa01
+  rotate: false
+  xy: 1356, 676
+  size: 121, 333
+  orig: 121, 333
+  offset: 0, 0
+  index: -1
+toufa02
+  rotate: false
+  xy: 1479, 784
+  size: 139, 225
+  orig: 139, 225
+  offset: 0, 0
+  index: -1
+toufa03
+  rotate: true
+  xy: 2, 127
+  size: 153, 411
+  orig: 153, 411
+  offset: 0, 0
+  index: -1
+toufa04
+  rotate: false
+  xy: 1035, 375
+  size: 319, 634
+  orig: 319, 634
+  offset: 0, 0
+  index: -1
+xingxing1
+  rotate: false
+  xy: 415, 212
+  size: 68, 68
+  orig: 68, 68
+  offset: 0, 0
+  index: -1
+xingxing2
+  rotate: false
+  xy: 2, 2
+  size: 120, 123
+  orig: 120, 123
+  offset: 0, 0
+  index: -1
+xingxing3
+  rotate: false
+  xy: 2, 2
+  size: 120, 123
+  orig: 120, 123
+  offset: 0, 0
+  index: -1

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
client/laya/bin/spine/nvmishu.json


BIN
client/laya/bin/spine/nvmishu.sk


+ 25 - 4
client/laya/src/ui/UIDraw.ts

@@ -6,6 +6,9 @@ import ui_UIDraw from "../fgui/res/game/ui_UIDraw";
 import PlatMgr from "../game/PlatMgr";
 import { xGame } from "../xGame";
 import MoneyNode from "./item/MoneyNode";
+import GlobalManager from "../utils/GlobalManager";
+import JSBridgeUtils from "../utils/JSBridgeUtils"; // 根据你的目录结构调整路径
+
 export default class UIDraw extends UIBase {
     public ui: ui_UIDraw;
     //
@@ -116,12 +119,30 @@ export default class UIDraw extends UIBase {
             this.checkFree();
         }
         else {
-            Moyu.sendDataEvent("turntable");
-            Moyu.showVideoAd(() => {
-                this.beginDraw();
-            }, EAdType.draw)
+            GlobalManager.instance.registerMethod('qjff_chouJiang', this.qjff_chouJiang);
+            if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
+
+            } else {
+                console.log('zh:AD 失败,直接发放奖励')
+                this.qjff_chouJiang
+            }
+            // Moyu.sendDataEvent("turntable");
+            // Moyu.showVideoAd(() => {
+            //     this.beginDraw();
+            // }, EAdType.draw)
         }
     }
+
+    qjff_chouJiang() {
+
+        this.beginDraw();
+    }
+
+
+
+
+
+
     beginDraw() {
         this.ui.myNode.flashNode.c1.selectedIndex = 0;
         this.ui.drawBtn.touchable = false;

+ 44 - 4
client/laya/src/ui/UIMain.ts

@@ -21,6 +21,9 @@ import UISign from "./UISign";
 import UISkill from "./UISkill";
 import UIMsg from "./UIMsg";
 import UIModeSelection from "./UIModeSelection";
+import GlobalManager from "../utils/GlobalManager";
+import JSBridgeUtils from "../utils/JSBridgeUtils"; // 根据你的目录结构调整路径
+
 
 export default class UIMain extends UIBase {
     public ui: ui_UIMain;
@@ -28,6 +31,25 @@ export default class UIMain extends UIBase {
     public settingNode: SettingNode;
     public moneyNode: MoneyNode;
     public firstEnter = true;
+
+    nativeCallJs(msg: string) {
+         let t  =msg;
+         console.log("zh:ts 奖励开始发放-", t);
+         GlobalManager.instance.callMethod(msg)
+        // if (msg === 'Ad1') {
+        //     GlobalManager.instance.callMethod(msg)
+        //     console.log("lichao: Ad1 奖励发送成功");
+        // } else if (msg === 'Ad2') {
+        //     console.log("lichao: Ad2 奖励发送成功");
+        // } else if (msg === 'Ad3') {
+        //     console.log("lichao: Ad3 奖励发送成功");
+        // } else if (msg === 'Ad4') {
+        //     console.log("lichao: Ad4 奖励发送成功");
+        // } else if (msg === 'Ad5') {
+        // } 
+    }
+
+
     public constructor() {
         super();
     }
@@ -60,6 +82,8 @@ export default class UIMain extends UIBase {
         this.ui.n83.visible = false;
         //万宁台球
         Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
+
+         window['nativeCallJs'] = this.nativeCallJs.bind(this);
     }
     changeSecretary(curUse) {
         let name = cfgTable.secretaryshopData[curUse + 1].spine;
@@ -100,7 +124,7 @@ export default class UIMain extends UIBase {
         this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
         this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
         this.addUIClick(this.ui.shopBtn, this.openShopView);
-     
+
         //
         this.addUIClick(this.ui.signBtn, this.openSignView);
         this.addUIClick(this.ui.drawBtn, this.openDrawView);
@@ -178,13 +202,13 @@ export default class UIMain extends UIBase {
         let xx = this.ui.secretary.width / 2;
         let yy = this.ui.secretary.height;
 
-      //  xx = Laya.stage.width / 2;
-      //  yy = Laya.stage.height;
+        //  xx = Laya.stage.width / 2;
+        //  yy = Laya.stage.height;
         let scale = xGame.common.getSecretaryScale();
         let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
         console.log("zh:playSecretaryIdle", data);
         //xGame.common.secretary.play(data, 1, true, parent);  这是老的秘书
-         
+
         xGame.common.secretary.play(data, 0, true, parent);
     }
     startGame(type: GameMode) {
@@ -244,14 +268,25 @@ export default class UIMain extends UIBase {
     startGlobal() {
         xGame.uiMgr.Show(UIMsg, "Coming Soon")
         //xGame.uiMgr.Show(UITry);
+       JSBridgeUtils.instance.showInternAd('全球');
     }
     startWeekly() {
         //xGame.uiMgr.Show(UIBox);
         xGame.uiMgr.Show(UIMsg, "Coming Soon")
+
+         //测试AD
+         GlobalManager.instance.registerMethod('zhouSaiMonth',this.zhouSaiMonth);
+         JSBridgeUtils.instance.showRewardAd('zhouSaiMonth');
+    }
+
+    zhouSaiMonth(){
+        console.log('zh:  zhouSaiMonth 被调用')
     }
     startPlaceBall() {
         xGame.uiMgr.Show(UILevelDisplay);
         //xGame.uiMgr.Show(UIMsg, "敬请期待~")
+
+        
     }
     public hide(): void {
         super.hide();
@@ -337,5 +372,10 @@ export default class UIMain extends UIBase {
         xGame.uiMgr.Show(UIRanking);
         Moyu.sendDataEvent("rankingList");
     }
+
+
+
+
+
 }
 UIMain.uiName = "UIMain";

+ 24 - 0
client/laya/src/utils/GlobalManager.ts

@@ -0,0 +1,24 @@
+// GlobalManager.ts
+//const { ccclass, property } = cc._decorator;
+
+class GlobalManager {
+    public static instance: GlobalManager = new GlobalManager();
+
+    private constructor() { }
+
+    public registerMethod(name: string, method: Function) {
+        console.log('zh: 注册全局方法', name)
+        this[name] = method;
+    }
+
+    public callMethod(name: string, ...args: any[]) {
+        console.log('zh: 调用全局方法', name)
+        if (this[name]) {
+            return this[name](...args);
+        } else {
+            console.error(`zh: 全局方法 Method ${name} not found`);
+        }
+    }
+}
+
+export default GlobalManager;

+ 166 - 0
client/laya/src/utils/JSBridgeUtils.ts

@@ -0,0 +1,166 @@
+// JSBridgeUtils.ts
+/**
+ * 封装与 Android 原生交互的桥接逻辑。
+ * 
+ * 示例
+ * import JSBridgeUtils from "../utils/JSBridgeUtils"; 
+ * JSBridgeUtils.instance.testAd1();
+ * 本方法目前仅供laya 台球项目使用
+ * 
+ * 
+ */
+import GlobalManager from "./GlobalManager";
+export default class JSBridgeUtils {
+    private static _instance: JSBridgeUtils;
+    private bridge: any;
+    //****不可变********* */
+    public static get instance(): JSBridgeUtils {
+        if (!this._instance) {
+            this._instance = new JSBridgeUtils();
+        }
+        return this._instance;
+    }
+
+    private constructor() { }
+
+    public initBridge(): boolean {
+        if (!Laya.Browser.onAndroid) {
+            console.log('zh:非android dev')
+            return;
+        }
+        //console.log("zh:initBridge");
+        let cfg = window['conchConfig'];
+        if (cfg) {
+            var os = cfg.getOS();
+            if (os == "Conch-android") // 多android平台需要手动配置
+            {
+                this.bridge = window['PlatformClass'].createClass("demo.JSBridge"); // 创建脚本代理
+                if (this.bridge) {
+                    //  console.log("zh:initBridge ok");
+                    return true;
+                } else {
+                    return false;
+                }
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    public testAd1(): void {
+        if (!Laya.Browser.onAndroid) {
+            console.log('zh:非android dev')
+            return;
+        }
+        if (!this.initBridge()) {
+            return;
+        }
+        let rs = this.bridge.call("testString", "hello");
+        console.log('zh:testString rs=' + rs);
+    }
+
+    public testAdCallBack(): void {
+        if (!this.initBridge()) {
+            return;
+        }
+        console.log("zh:testAdCallBack start");
+        const defaultObj = { code: 200, msg: "req update Ui" };
+        const reqObj = { code: 300, msg: "hello java ui" };
+
+        this.bridge.callWithBack((rsStr: string) => {
+            const rsObj = JSON.parse(rsStr);
+            console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
+        }, "testAsyncCallback", JSON.stringify(reqObj));
+    }
+    //************* */
+    public showInternAd(mark): void {
+        if (!Laya.Browser.onAndroid) {
+            console.log('zh:非android dev')
+            return;
+        }
+        if (!this.initBridge()) {
+            return;
+        }
+        let rs = this.bridge.call("showInternAd", mark);
+        console.log('zh:showInternAd rs= ' + rs + '   ,mark=' + mark);
+        try {
+            const result = JSON.parse(rs);
+            if (result.code === 200) {
+                console.log("zh:广告显示成功");
+                // 执行广告展示后的逻辑,例如记录日志、更新UI等
+            } else {
+                console.warn("zh:广告显示失败:", result.msg);
+                // 可以弹出提示、上报错误、尝试重试等
+            }
+        } catch (e) {
+            console.error("zh:解析桥接返回值失败:", e);
+        }
+
+    }
+
+
+    public showRewardAd(mark): boolean {
+        if (!Laya.Browser.onAndroid) {
+            console.log('zh:非android dev')
+            return false;
+        }
+        if (!this.initBridge()) {
+            return false;
+        }
+        let rs = this.bridge.call("showRewardAd", mark);
+        console.log('zh:showRewardAd rs= ' + rs + '   ,mark=' + mark);
+        try {
+            const result = JSON.parse(rs);
+            if (result.code === 200) {
+                console.log("zh:广告显示成功");
+                // 执行广告展示后的逻辑,例如记录日志、更新UI等
+                return true;
+            } else {
+                console.warn("zh:广告显示失败:", result.msg);
+                // 可以弹出提示、上报错误、尝试重试等
+                return false;
+            }
+        } catch (e) {
+            console.error("zh:解析桥接返回值失败:", e);
+            return false;
+        }
+    }
+
+
+
+    
+     nativeCallJs(msg: string) {
+        console.log("zh:nativeCallJs received data: 1111", msg);
+        if (msg === 'Ad1') {
+            GlobalManager.instance.callMethod('Ad1')
+            console.log("zh: Ad1 奖励发送成功");
+        } else if (msg === 'Ad2') {
+            GlobalManager.instance.callMethod('Ad2')
+            console.log("zh: Ad2 奖励发送成功");
+        } else if (msg === 'Ad3') {
+            GlobalManager.instance.callMethod('Ad3')
+            console.log("zh: Ad3 奖励发送成功");
+        } else if (msg === 'Ad4') {
+            GlobalManager.instance.callMethod('Ad4')
+            console.log("zh: Ad4 奖励发送成功");
+        } else if (msg === 'Ad5') {
+            console.log("zh: Ad5 奖励发送成功");
+            GlobalManager.instance.callMethod('Ad5')
+            
+        }
+    }
+
+
+
+}
+
+
+// //尝试使用Android/Java执行JS脚本
+// // 定义 nativeCallJs 函数并挂载到全局 window 对象
+// // nativeCallJs(data: string) {
+// //      console.log("zh:nativeCallJs received data:", data);
+// //      alert("zh:nativeCallJs: " +data);
+// // };
+

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác