Преглед изворни кода

桌面icon替换
互推列表新接口
互推插屏点击获取红包币

kaka пре 5 година
родитељ
комит
2dd67c2d04

+ 0 - 12
assets/resources/module/hotUpdate.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "27ca9321-290b-4769-b0e6-bd95cdf80996",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 0 - 12
assets/resources/module/hotUpdate/perfab.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "e45f4d0f-7aa3-4f6e-a64f-6b9bcde71855",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 1 - 0
assets/script/game/data/GameData.ts

@@ -85,6 +85,7 @@ export class GameData {
     }
 
     private initConfigs(data) {
+        // console.log('config  ', data);
         this.configs = data;
         this.funOpenData = this.configs.ServerConfig.Functionswitch.split(",");
     }

+ 24 - 6
assets/script/game/data/module/MoreGameData.ts

@@ -79,9 +79,14 @@ export class MoreGameData extends Data {
 
     async sendRecommendList() {
         if (this._moreGameList == null || this._moreGameList == undefined) {
-            let data = {};
-            let response = await mk.http.sendData('/fission/recommendList', data);
-
+            let data = {
+                //是否支持小游戏 1:支持,0:不支持
+                isSupportMiniGames: 1
+            };
+            let response = await mk.http.sendData('/fission/recommend-info', data);
+            // let response = await mk.http.sendData('/fission/recommendList', data);
+
+            // console.log('recommend-info  ', response)
             if (response.errcode != 0) {
                 return;
             }
@@ -96,9 +101,9 @@ export class MoreGameData extends Data {
     }
 
     /**上报 */
-    sendAppDownloadLog(downLoadAppId: string) {
+    async sendAppDownloadLog(downLoadAppId: string) {
         let data = { "downloadAppId": downLoadAppId };
-        let response = mk.http.sendRequest('/fission/appDownloadLog', 'POST', JSON.stringify(data));
+        let response = await mk.http.sendData('/fission/appDownloadLog', data);
     }
 
     /**
@@ -191,10 +196,23 @@ export class MoreGameData extends Data {
 
     /** 弹出互推红包弹窗 */
     popMoreGamePopNode() {
-        if (Math.random() <= gData.gameData.configs.globalCfg.popMoreGame) {
+        if (Math.random() <= gData.gameData.configs.ServerConfig.popMoreGame) {
             mk.ui.openPanel('module/moreGame/moreGamePopNode');
         }
     }
+
+    /** 点击互推插屏获取红包币 */
+    async popNodeGetRedBag() {
+        let data = {};
+        let response = await mk.http.sendData('saveDailyRedMoney', data);
+        if (response.errcode != 0) {
+            return;
+        }
+
+        let rewardData = [{ rewardType: 1, rewardNum: response.data.redMoneyAddition }]
+        gData.reward.data = rewardData;
+        mk.ui.openPanel('module/reward/reward')
+    }
 }
 
 /** 下载任务 */

+ 0 - 12
assets/script/game/module/hotUpdate.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "6ab0dcf5-b307-420f-ab3a-88befa72e960",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 34 - 22
assets/script/game/module/moreGame/MoreGameNormalItem.ts

@@ -55,28 +55,34 @@ export default class MoreGameNormalItem extends cc.Component {
         this.labDes.string = this.data.introduction
         this.spRed.active = false
 
-        if (JsbSystem.ifCanStartGame(this.data.packageName, false)) {
-            this.btnDown.active = false
-            this.btnOpen.active = true
-        } else {
-            if (JsbSystem.isFileExist(this.data.nebulaAppId + ".apk")) {
+        if (this.data.appType == 1) {
+            if (JsbSystem.ifCanStartGame(this.data.packageName, false)) {
                 this.btnDown.active = false
                 this.btnOpen.active = true
             } else {
-                this.btnDown.active = true
-                this.btnOpen.active = false
-                // this.spRed.active = true
-
-                let info = gData.moreGame.getTaskInfo(this.data.nebulaAppId)
-                if (info != null) {
-                    this.schedule(() => {
-                        this.showDownloadProgress()
-                    }, 0.5)
+                if (JsbSystem.isFileExist(this.data.nebulaAppId + ".apk")) {
+                    this.btnDown.active = false
+                    this.btnOpen.active = true
                 } else {
-                    this.progressLabel.string = "下载"
+                    this.btnDown.active = true
+                    this.btnOpen.active = false
+                    // this.spRed.active = true
+
+                    let info = gData.moreGame.getTaskInfo(this.data.nebulaAppId)
+                    if (info != null) {
+                        this.schedule(() => {
+                            this.showDownloadProgress()
+                        }, 0.5)
+                    } else {
+                        this.progressLabel.string = "下载"
+                    }
                 }
             }
         }
+        else if (this.data.appType == 2) {
+            this.btnDown.active = false
+            this.btnOpen.active = true
+        }
     }
 
     cool = false
@@ -91,13 +97,19 @@ export default class MoreGameNormalItem extends cc.Component {
             this.cool = false
         }, 3)
 
-        let result = gData.moreGame.createNewTask(this.data)
-        if (result != null) {
-            this.schedule(() => {
-                this.showDownloadProgress()
-            }, 0.5)
-        } else {
-            this.progressLabel.string = ""
+        if (this.data.appType == 1) {
+            let result = gData.moreGame.createNewTask(this.data)
+            if (result != null) {
+                this.schedule(() => {
+                    this.showDownloadProgress()
+                }, 0.5)
+            } else {
+                this.progressLabel.string = ""
+            }
+        }
+        else if (this.data.appType == 2) {
+            cc.sys.openURL(this.data.recommendLink);
+            // JsbSystem.sendEvent('hutuiEventLaunch_' + this.data.nebulaAppId, "互推启动" + this.data.title, 'hutuiEventLaunch')
         }
     }
 

+ 2 - 7
assets/script/game/module/moreGame/MoreGamePopNode.ts

@@ -63,15 +63,10 @@ export default class MoreGamePopNode extends cc.Component {
 
         this.cool = true
 
-        if (!JsbSystem.ifCanStartGame(this.data.packageName, true)) {
+        if (cc.sys.isNative && !JsbSystem.ifCanStartGame(this.data.packageName, true)) {
             gData.moreGame.createNewTask(this.data)
         }
-    }
 
-    onClosePanel() {
-        // mk.audio.playEffect('getGold');
-        mk.tip.pop('红包币+300');
-        //     GameM.commonData.updateRedMoney(300, RecordTYPE.online)
-        mk.fly.PlayCoinAnim(RewardType.pigRmb, 20, cc.v2(0, -300));
+        gData.moreGame.popNodeGetRedBag();
     }
 }

+ 13 - 3
assets/script/mk/system/AdSystem.ts

@@ -149,7 +149,10 @@ export default class AdSystem {
         if (!this.ifShowAd) {
             return;
         }
-        this.adSdk.showBannerAd();
+
+        if (gData.gameData.adShowConfig && gData.gameData.adShowConfig.is_show_banner == 1) {
+            this.adSdk.showBannerAd();
+        }
     }
 
     /**
@@ -160,6 +163,7 @@ export default class AdSystem {
         if (!this.ifShowAd) {
             return;
         }
+
         this.adSdk.showInter();
     }
 
@@ -167,9 +171,15 @@ export default class AdSystem {
      * 根据几率检测弹出插屏
      */
     public checkShowInterByChance() {
-        let random = Math.random();
-        if (random < 0.5) {
+        if (!gData.gameData.adShowConfig) {
+            return;
+        }
+
+        if (Math.random() <= gData.gameData.adShowConfig.insert_probability) {
             this.showInterAd(0);
         }
+        else {
+            gData.moreGame.popMoreGamePopNode();
+        }
     }
 }

BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-hdpi/ic_launcher.png


BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-ldpi/ic_launcher.png


BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-mdpi/ic_launcher.png


BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-xhdpi/ic_launcher.png


BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-xxhdpi/ic_launcher.png


BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-xxxhdpi/ic_launcher.png


+ 1 - 1
packages-hot-update/cfg.json

@@ -1,7 +1,7 @@
 {
     "version": "1.0.2",
     "serverRootDir": "https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/EasyEliminateTest/baseRemote/",
-    "resourceRootDir": "D:\\App\\mk_framework\\build\\jsb-link",
+    "resourceRootDir": "D:\\mokaszProjects\\mk_framework\\build\\jsb-link",
     "genManifestDir": "",
     "hotAddressArray": [
         "http://",