kaka před 4 roky
rodič
revize
3147cf48d7

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 538 - 283
assets/resources/module/login/login.prefab


+ 11 - 0
assets/script/before/map/MapMove.ts

@@ -13,6 +13,7 @@ export class MapMove extends cc.Component {
     private canvas: cc.Node = null;
     private startPoint: cc.Vec2;
 
+    private onScale = false;
     private tarScale = 1.5;
     start() {
         this.canvas = cc.find('Canvas');
@@ -22,6 +23,12 @@ export class MapMove extends cc.Component {
         this.node.setPosition(cc.v2(72, 348));
     }
 
+    onEnable() {
+        this.scheduleOnce(() => {
+            this.onScale = true;
+        }, 0.3)
+    }
+
     onDestroy() {
         this.node.off(cc.Node.EventType.TOUCH_START, this.onMapTouchBegin, this);
     }
@@ -77,6 +84,10 @@ export class MapMove extends cc.Component {
     }
 
     update() {
+        if (!this.onScale) {
+            return;
+        }
+
         let target = this.map.scale;
         if (target < this.tarScale) {
             target += 0.005;

+ 1 - 1
assets/script/game/game/Game.ts

@@ -72,7 +72,7 @@ export default class Game extends cc.Component {
         gData.gameData.gameStyle = this;
         this.span = gData.gameData.ProductionRecovery * 60 * 1000;
         gData.gameData.checkGradeUpUnLock();
-        this.loadMain();
+        // this.loadMain();
         this.registerCallBack();
     }
 

+ 4 - 8
assets/script/game/module/blessingBag/BlessingBag.ts

@@ -6,9 +6,7 @@
 import JsbSystem from "../../../mk/system/JsbSystem";
 import SetGray from "../../component/SetGray";
 import TableView from "../../component/TableView";
-import { AdFun } from "../../data/AdData";
-import { DataEventId, VideoAdType } from "../../data/GameData";
-import { cashProType } from "../../data/module/CashProData";
+import { VideoAdType } from "../../data/GameData";
 
 
 const { ccclass, property } = cc._decorator;
@@ -164,7 +162,7 @@ export default class BlessingBag extends cc.Component {
                 this.adrbArray.push(obj);
             }
             this.itemContent.emit('srollview-init', this.adrbArray);
-            this.scroll_view =  this.itemContent.getComponent(cc.ScrollView);
+            this.scroll_view = this.itemContent.getComponent(cc.ScrollView);
             this.scroll_view.vertical = false;
             cc.tween(this.node).delay(0.1).call(() => {
                 let allItem = this.tableview.getFrontPositionItemByCount(5);
@@ -260,7 +258,7 @@ export default class BlessingBag extends cc.Component {
             //mk.tip.pop('今日观看次数已用完');
             //}
         }
-    
+
         console.log("--->You Click AdProgressBtn  ", gData.blessingBag.videoRbData);
     }
 
@@ -321,8 +319,7 @@ export default class BlessingBag extends cc.Component {
         this.canOpen = false;
 
         if (this.rbPanelType == 1) {
-
-            gData.cashPro.openCashPro(cashProType.blessing_bigCash, gData.blessingBag.bigRbNum)
+            gData.cashPro.openCashPro(gData.blessingBag.bigRbNum)
         } else {
             //弹确认提现界面
             this.rbOpenBtn.active = false;
@@ -336,7 +333,6 @@ export default class BlessingBag extends cc.Component {
                 this.nodeRb.active = false;
 
                 gData.blessingBag.HttpCashTask();
-                // gData.cashPro.openCashPro(cashProType.blessing_taskCash, gData.blessingBag.taskRbNum)
 
                 this.canOpen = true;
             }, 1000);

+ 64 - 13
assets/script/game/module/login/Login.ts

@@ -19,6 +19,10 @@ export default class Login extends cc.Component {
     private lbl_server: cc.Label = null;
     @property({ displayName: '隐私协议', type: cc.Label })
     private lbl_privacy: cc.Label = null;
+    @property({ displayName: '加载部分', type: cc.Node })
+    private node_loadPart: cc.Node = null;
+    @property({ displayName: '登录按钮', type: cc.Node })
+    private node_btnLogin: cc.Node = null;
     /** 加载进度 */
     private process: number = 0;
 
@@ -33,13 +37,19 @@ export default class Login extends cc.Component {
 
     private hasCheckPrivacy = false;
 
+    private loadSceneState = false;
+
+    private coreGame = null;
+
     onLoad() {
         this.lbl_progress.node.active = false;
         this.node_load.active = true;
+        this.node_loadPart.active = true;
+        this.node_btnLogin.active = false;
         this.setProgress(0);
     }
 
-    start() {
+    async start() {
         if (mk.storage.getStorage("alifengkong") == 1) {
             return;
         }
@@ -52,7 +62,8 @@ export default class Login extends cc.Component {
             mk.aliRiskManager.init();
         }
 
-        mk.loader.preload('game/coregame/coregame', cc.Prefab);
+        // mk.loader.preload('game/coregame/coregame', cc.Prefab);
+        this.coreGame = await mk.loader.load('game/coregame/coregame', cc.Prefab);
     }
 
     update() {
@@ -108,22 +119,31 @@ export default class Login extends cc.Component {
             }
         }
 
-        if (this.process < 100) {
-            this.process += 2;
-            this.setProgress(this.process);
+        if (!this.loadSceneState) {
+            this.loadSceneState = true;
+            this.loadMain();
         }
+        // if (this.process < 100) {
+        //     this.process += 2;
+        //     this.setProgress(this.process);
+        // }
 
         if (gData.loginData.loadResCompelete) {
             if (mk.aliRiskManager.getRiskCode) {
                 mk.aliRiskManager.getRiskCode = false;
                 this.login();
             }
-            else if (gData.gameData.dataFinish) {//登录流程完毕
-                let node = cc.find('Canvas/主界面层');
-                mk.ui.openPanel("game/prefab/game", OpenActionType.closeOther, node);
-                console.log("===[Jsbsystem 显示开屏广告================================")
-                if (mk.ad.ifShowAd) {
-                    JsbSystem.showSplash();
+            else if (gData.gameData.dataFinish && this.coreGame) {//登录流程完毕
+                if (gData.loginData.isAuth || CC_DEBUG) {
+                    this.addToScene();
+                    console.log("===[Jsbsystem 显示开屏广告================================")
+                    if (mk.ad.ifShowAd) {
+                        JsbSystem.showSplash();
+                    }
+                }
+                else {
+                    this.node_loadPart.active = false;
+                    this.node_btnLogin.active = true;
                 }
 
                 gData.gameData.dataFinish = false;
@@ -134,6 +154,18 @@ export default class Login extends cc.Component {
         }
     }
 
+    private async loadMain() {
+        this.coreGame = await mk.loader.load('game/coregame/coregame', cc.Prefab, this.setProgress.bind(this));
+    }
+
+    private addToScene() {
+        let mainNode = cc.find('Canvas/主容器');
+        let node = cc.find('Canvas/主界面层');
+        mk.ui.openPanel("game/prefab/game", OpenActionType.closeOther, node);
+
+        mainNode.addChild(cc.instantiate(this.coreGame));
+    }
+
     private checkPrivacy() {
         if (mk.storage.getStorage("agreementTip") != 1) {
             mk.ui.openPanel("module/login/agreementTip");
@@ -145,8 +177,11 @@ export default class Login extends cc.Component {
 
     /** 设置进度 */
     private setProgress(current) {
-        this.bar.fillRange = current / 100;
-        this.lbl_progress.string = "加载中 " + current + "%";
+        let cur = current / 100;
+        if (cur > this.bar.fillRange) {
+            this.bar.fillRange = cur;
+            this.lbl_progress.string = "加载中 " + current + "%";
+        }
     }
 
     /** 获取设备信息后 */
@@ -269,5 +304,21 @@ export default class Login extends cc.Component {
             mk.ui.openPanel('module/certification/CertificationNode');
         }
     }
+
+    private cool = false;
+    clickLogin() {
+        mk.audio.playEffect('button');
+        if (this.cool) {
+            return;
+        }
+
+        this.cool = true;
+
+        this.scheduleOnce(() => {
+            this.cool = false;
+        }, 2)
+
+        JsbSystem.WxAuth();
+    }
 }
 

+ 5 - 2
assets/script/mk/utils/LoadResUtil.ts

@@ -45,12 +45,15 @@ export default class LoadResUtil {
      * @param  type   资源类型(cc.Asset)
      * @returns Promise
      */
-    public load<T extends cc.Asset>(paths: string | any, type: typeof cc.Asset): Promise<any> {
+    public load<T extends cc.Asset>(paths: string | any, type: typeof cc.Asset, callBack = null): Promise<any> {
         return new Promise<T>((resolve: (data: T) => void, reject) => {
             cc.resources.load(paths, type,
                 //onProgress
                 (finish: number, total: number, item: cc.AssetManager.RequestItem) => {
-
+                    if (callBack) {
+                        let per = finish / total;
+                        callBack(per * 100);
+                    }
                 },
                 //onComplete
                 (err: Error = null, data: T): void => {

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů