Procházet zdrojové kódy

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

薛鸿潇 před 5 roky
rodič
revize
09c1a4b265

+ 4 - 18
assets/resources/module/forceUpdate/prefab/DownLoadUI.prefab

@@ -27,11 +27,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 82
+        "__id__": 81
       }
     ],
     "_prefab": {
-      "__id__": 83
+      "__id__": 82
     },
     "_opacity": 255,
     "_color": {
@@ -228,13 +228,9 @@
       }
     ],
     "_active": true,
-    "_components": [
-      {
-        "__id__": 80
-      }
-    ],
+    "_components": [],
     "_prefab": {
-      "__id__": 81
+      "__id__": 80
     },
     "_opacity": 255,
     "_color": {
@@ -2995,16 +2991,6 @@
     "sync": false
   },
   {
-    "__type__": "c303cMObORMP73Of1/g1ZVg",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 6
-    },
-    "_enabled": true,
-    "_id": ""
-  },
-  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 1 - 1
assets/script/before/GamePlay.ts

@@ -185,7 +185,7 @@ export default class GamePlay extends cc.Component {
             this.cellItemDic[0][3] && this.cellItemDic[0][3].onClick();
             this.cellItemDic[0][4] && this.cellItemDic[0][4].onClick();
         }
-        else if (data == "1_6") {//再点击一次增加大量进度哦
+        else if (data == "1_7") {//再点击一次增加大量进度哦
             this.cellItemDic[1][1] && this.cellItemDic[1][1].onClick();
             this.cellItemDic[1][2] && this.cellItemDic[1][2].onClick();
         }

+ 7 - 5
assets/script/game/module/moreGame/MoreGameNormalItem.ts

@@ -30,7 +30,6 @@ export default class MoreGameNormalItem extends cc.Component {
     @property(cc.Node)
     spRed: cc.Node = null;
 
-    private bData = null;
     private data = null
 
     /**
@@ -42,8 +41,11 @@ export default class MoreGameNormalItem extends cc.Component {
             return;
         }
 
-        this.bData = bData;
-        this.data = bData.item_data;
+        this.setInfo(bData.item_data)
+    }
+
+    setInfo(data) {
+        this.data = data;
         cc.loader.load(this.data.icon, (err, res) => {
             if (err) {
                 console.log('err:', err);
@@ -129,10 +131,10 @@ export default class MoreGameNormalItem extends cc.Component {
                 // LogUtil.logV("showDownloadProgress", "three")
                 this.progressLabel.string = ((info.progress / info.totalBytesReceives) * 100).toFixed(1) + "%"
             } else {
-                this.setItemData(this.bData)
+                this.setInfo(this.data)
             }
         } else {
-            this.setItemData(this.bData)
+            this.setInfo(this.data)
         }
     }
 }

+ 4 - 4
assets/script/mk/system/JsbSystem.ts

@@ -1,5 +1,3 @@
-import { StorageKey } from "../../game/data/StorageData";
-
 /**
  * Jsb管理类(与安卓Java类或者IOS交互)
  * @description
@@ -43,7 +41,8 @@ export default class JsbSystem {
      * @param parameters      参数:是java方法需要传入的参数(可以多个,与methodSignature中()内的数量和类型一一对应)
      */
     public static callStaticMethod(path: string, methodName: string, methodSignature: string, ...parameters: any): any {
-        jsb.reflection.callStaticMethod(path, methodName, methodSignature, ...parameters);
+        let value = jsb.reflection.callStaticMethod(path, methodName, methodSignature, ...parameters);
+        return value;
     }
 
     /**
@@ -245,10 +244,11 @@ export default class JsbSystem {
      * @param start       如存在是否启动
      * @returns ifCan         
      */
-    static ifCanStartGame(packageName: string, start: boolean): boolean {
+    public static ifCanStartGame(packageName: string, start: boolean): boolean {
         let isCan = false;
         if (cc.sys.os == cc.sys.OS_ANDROID) {
             isCan = this.callStaticMethod(this._JSB_ANDROID_PATH, "isStartGame", "(Ljava/lang/String;Z)Z", packageName, start);
+            return isCan;
         }
         else if (cc.sys.os == cc.sys.OS_IOS) {
             isCan = this.callStaticMethod("GameConfig", "installApk:", "");

+ 3 - 3
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java

@@ -250,10 +250,10 @@ public class AppActivity extends Cocos2dxActivity {
 
     public boolean checkStartApp(String pkg, boolean start){
         PackageManager packageManager = getPackageManager();
-        Intent intent=new Intent();
+        Intent intent = new Intent();
         intent.setPackage(null); // 加上这句代码
-        intent =packageManager.getLaunchIntentForPackage(pkg);
-        if(intent==null){
+        intent = packageManager.getLaunchIntentForPackage(pkg);
+        if(intent == null){
             return false;
         }else{
             if(start){

+ 3 - 3
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/thirdSdk/ThirdSdkMgr.java

@@ -133,12 +133,12 @@ public class ThirdSdkMgr {
     //安装apk相关 ----------------------------------------------------------------------------------
     /** 安装apk*/
     public static void installApk(String fileName){
-        appActivity.installApk(fileName);
+        ThirdSdkMgr.appActivity.installApk(fileName);
     }
 
     /** 启动apk*/
-    public static boolean isStartGame(String pkg,boolean start){
-        boolean isExist =  appActivity.checkStartApp(pkg,start);
+    public static boolean isStartGame(String pkg, boolean start){
+        boolean isExist = ThirdSdkMgr.appActivity.checkStartApp(pkg, start);
         return isExist;
     }
 }

+ 22 - 11
build/jsb-link/js backups (useful for debugging)/main.index.js

@@ -10558,7 +10558,8 @@ return jsb.fileUtils.getWritablePath();
 };
 t.callStaticMethod = function(t, e, n) {
 for (var i, a = [], r = 3; r < arguments.length; r++) a[r - 3] = arguments[r];
-(i = jsb.reflection).callStaticMethod.apply(i, o([ t, e, n ], a));
+var c = (i = jsb.reflection).callStaticMethod.apply(i, o([ t, e, n ], a));
+return c;
 };
 t.backTest = function() {};
 t.updateDeviceInfo = function(t) {
@@ -10632,7 +10633,12 @@ cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "
 };
 t.ifCanStartGame = function(t, e) {
 var n = !1;
-cc.sys.os == cc.sys.OS_ANDROID ? n = this.callStaticMethod(this._JSB_ANDROID_PATH, "isStartGame", "(Ljava/lang/String;Z)Z", t, e) : cc.sys.os == cc.sys.OS_IOS && (n = this.callStaticMethod("GameConfig", "installApk:", ""));
+if (cc.sys.os == cc.sys.OS_ANDROID) {
+n = this.callStaticMethod(this._JSB_ANDROID_PATH, "isStartGame", "(Ljava/lang/String;Z)Z", t, e);
+console.log("aaaaaaaaaaa >>> ", n);
+return n;
+}
+cc.sys.os == cc.sys.OS_IOS && (n = this.callStaticMethod("GameConfig", "installApk:", ""));
 return n;
 };
 t.setTAEventRegister = function() {
@@ -12798,17 +12804,21 @@ e.btnOpen = null;
 e.labName = null;
 e.labDes = null;
 e.spRed = null;
-e.bData = null;
 e.data = null;
 e.cool = !1;
 return e;
 }
 e.prototype.setItemData = function(t) {
 return r(this, void 0, void 0, function() {
-var e = this;
 return c(this, function() {
-this.bData = t;
-this.data = t.item_data;
+this.setInfo(t.item_data);
+return [ 2 ];
+});
+});
+};
+e.prototype.setInfo = function(t) {
+var e = this;
+this.data = t;
 cc.loader.load(this.data.icon, function(t, n) {
 if (t) console.log("err:", t); else if (cc.isValid(e.iconNode)) {
 var o = n;
@@ -12818,7 +12828,10 @@ e.iconNode.spriteFrame = new cc.SpriteFrame(o);
 this.labName.string = this.data.title;
 this.labDes.string = this.data.introduction;
 this.spRed.active = !1;
-if (1 == this.data.appType) if (s.default.ifCanStartGame(this.data.packageName, !1)) {
+if (1 == this.data.appType) {
+console.log("aaaaaa  this.data.packageName  ", this.data.packageName);
+console.log("aaaaaa  ", s.default.ifCanStartGame(this.data.packageName, !1));
+if (s.default.ifCanStartGame(this.data.packageName, !1)) {
 this.btnDown.active = !1;
 this.btnOpen.active = !0;
 } else if (s.default.isFileExist(this.data.nebulaAppId + ".apk")) {
@@ -12830,13 +12843,11 @@ this.btnOpen.active = !1;
 null != gData.moreGame.getTaskInfo(this.data.nebulaAppId) ? this.schedule(function() {
 e.showDownloadProgress();
 }, .5) : this.progressLabel.string = "下载";
+}
 } else if (2 == this.data.appType) {
 this.btnDown.active = !1;
 this.btnOpen.active = !0;
 }
-return [ 2 ];
-});
-});
 };
 e.prototype.creatorDownLoadTask = function() {
 var t = this;
@@ -12853,7 +12864,7 @@ t.showDownloadProgress();
 };
 e.prototype.showDownloadProgress = function() {
 var t = gData.moreGame.getTaskInfo(this.data.nebulaAppId);
-null != t && t.progress >= 0 ? this.progressLabel.string = (t.progress / t.totalBytesReceives * 100).toFixed(1) + "%" : this.setItemData(this.bData);
+null != t && t.progress >= 0 ? this.progressLabel.string = (t.progress / t.totalBytesReceives * 100).toFixed(1) + "%" : this.setInfo(this.data);
 };
 a([ p(cc.Sprite) ], e.prototype, "iconNode", void 0);
 a([ p(cc.Label) ], e.prototype, "progressLabel", void 0);