Procházet zdrojové kódy

Merge branch 'master' of http://git.mokasz.com/zouyong/mk_framework

薛鸿潇 před 5 roky
rodič
revize
a8e09a3bad

+ 3 - 114
assets/resources/game/prefab/game.prefab

@@ -40,22 +40,19 @@
       },
       {
         "__id__": 105
-      },
-      {
-        "__id__": 173
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 176
+        "__id__": 173
       },
       {
-        "__id__": 177
+        "__id__": 174
       }
     ],
     "_prefab": {
-      "__id__": 178
+      "__id__": 175
     },
     "_opacity": 255,
     "_color": {
@@ -5723,114 +5720,6 @@
     "sync": true
   },
   {
-    "__type__": "cc.Node",
-    "_name": "New Label",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 174
-      }
-    ],
-    "_prefab": {
-      "__id__": 175
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 0,
-      "g": 0,
-      "b": 0,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 118.63,
-      "height": 50.4
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        130.817,
-        91.572,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Label",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 173
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_string": "111111",
-    "_N$string": "111111",
-    "_fontSize": 40,
-    "_lineHeight": 40,
-    "_enableWrapText": true,
-    "_N$file": null,
-    "_isSystemFontUsed": true,
-    "_spacingX": 0,
-    "_batchAsBitmap": false,
-    "_styleFlags": 0,
-    "_underlineHeight": 0,
-    "_N$horizontalAlign": 1,
-    "_N$verticalAlign": 1,
-    "_N$fontFamily": "Arial",
-    "_N$overflow": 0,
-    "_N$cacheMode": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
-    },
-    "fileId": "b4H9DpE2ZHbrPSMoC/ScjU",
-    "sync": false
-  },
-  {
     "__type__": "8760dQYasROwLaLe1idTS07",
     "_name": "",
     "_objFlags": 0,

+ 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(",");
     }

+ 5 - 0
assets/script/game/data/module/BlessingBagData.ts

@@ -111,6 +111,11 @@ export class BlessingBagData extends Data {
         this.isPlayAniUpdate = false;
         this.videoRbData = response.data.UserRedMoneyInfo;
 
+        const rewardNum = Math.round(gData.blessingBag.taskRbNum * 100);
+        gData.receiptNotice.receip_rmb = rewardNum;
+        gData.cashNormal.receip_total_rmb += gData.receiptNotice.receip_rmb;
+        mk.ui.openPanel('module/receiptNotice/receiptNotice');
+
         // if (response.data.code == 1) {
         //     AdM.onSendEvent('VideoCash_' + this.taskRbId, '视频红包第' + this.taskRbId + '档领取成功', 'VideoCash');
         // }

+ 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')
+    }
 }
 
 /** 下载任务 */

+ 3 - 1
assets/script/game/module/blessingBag/BlessingBag.ts

@@ -321,7 +321,9 @@ export default class BlessingBag extends cc.Component {
                 this.rbOpenBtn.active = true;
                 this.nodeRb.active = false;
 
-                gData.cashPro.openCashPro(cashProType.blessing_taskCash, gData.blessingBag.taskRbNum)
+                gData.blessingBag.HttpCashTask();
+                // gData.cashPro.openCashPro(cashProType.blessing_taskCash, gData.blessingBag.taskRbNum)
+
                 this.canOpen = true;
             }, 1000);
         }

+ 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ární
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-hdpi/ic_launcher.png


binární
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-ldpi/ic_launcher.png


binární
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-mdpi/ic_launcher.png


binární
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-xhdpi/ic_launcher.png


binární
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/mipmap-xxhdpi/ic_launcher.png


binární
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://",