zouyong 5 лет назад
Родитель
Сommit
b99f5d25c2

+ 1 - 0
assets/script/game/data/module/RedCodeData.ts

@@ -17,6 +17,7 @@ export default class RedCodeData extends Data {
     teachVideoType = 1;
 
     openRedCode(money, code) {
+        mk.ui.openPanel("module/redCode/redCode")
         this.money = money;
         this.code = code;
         this.init_data = true;

+ 4 - 0
assets/script/game/module/redCode/RedCode.ts

@@ -101,6 +101,10 @@ export default class RedCode extends cc.Component {
     }
 
     onClickClose() {
+        
+    }
+
+    onDisable(){
         mk.ad.destroyNativeAd();
     }
 }

+ 10 - 0
assets/script/mk/system/JsbSystem.ts

@@ -368,6 +368,16 @@ export default class JsbSystem {
         }
     }
 
+    /** 打开微信 */
+    public static openWx() {
+        if (cc.sys.os == cc.sys.OS_ANDROID) {
+            this.callStaticMethod(this._JSB_ANDROID_PATH, "openWx", "()V");
+        }
+        else if (cc.sys.os == cc.sys.OS_IOS) {
+            this.callStaticMethod("AppController", "openWx", "");
+        }
+    }
+
     /** 下载文件
      * @param url 下载地址
      * @param fileName 存储文件名称

+ 30 - 19
assets/script/mk/system/TipSystem.ts

@@ -7,23 +7,23 @@ const { ccclass, property } = cc._decorator;
  */
 export default class TipSystem extends cc.Component {
     @property({ type: cc.Integer, displayName: "飘动时间" })
-     tween_time: number = 1;
+    tween_time: number = 1;
     @property({ type: cc.Integer, displayName: "开始坐标x" })
-     src_x: number = 0;
+    src_x: number = 0;
     @property({ type: cc.Integer, displayName: "开始坐标y" })
-     src_y: number = 0;
+    src_y: number = 0;
     @property({ type: cc.Integer, displayName: "目标坐标x" })
-     tar_x: number = 0;
+    tar_x: number = 0;
     @property({ type: cc.Integer, displayName: "目标坐标y" })
-     tar_y: number = 200;
+    tar_y: number = 200;
     @property({ type: cc.Integer, displayName: "背景透明度" })
-     bg_opacity: number = 40;
+    bg_opacity: number = 40;
     @property({ displayName: "背景颜色" })
-     bg_color = new cc.Color(200, 200, 200);
+    bg_color = new cc.Color(200, 200, 200);
     @property({ displayName: "文本颜色" })
-     tip_color = new cc.Color(255, 255, 255);
+    tip_color = new cc.Color(255, 255, 255);
     @property({ type: cc.Integer, displayName: "文本字体" })
-     tip_size: number = 40;
+    tip_size: number = 40;
 
     onLoad() {
         mk.tip = this;
@@ -38,7 +38,7 @@ export default class TipSystem extends cc.Component {
      * @param str 
      * @param type 弹窗类型 0正常中间弹 1弹到最顶上
      */
-    public async pop(str: string,type:number=0) {
+    public async pop(str: string, type: number = 0) {
         let node = await mk.pool.getPrefab("game/prefab/tips");
         let node_bg = node.getChildByName("bg");
         let node_lbl = node.getChildByName("lbl");
@@ -54,17 +54,28 @@ export default class TipSystem extends cc.Component {
         node.parent = this.node;
         node.x = this.src_x;
         node.y = this.src_y;
-        if(type == 1){
-            this.tween_time = 2;
+        if (type == 0) {
+            cc.tween(node)
+                .to(this.tween_time, { x: this.tar_x, y: this.tar_y })
+                .call(() => {
+                    mk.pool.return("tips", node);
+                }, this)
+                .start();
+        }
+        else {
+            this.tween_time = 1;
             node.y = 400;
-            this.tar_y = 800;
+            this.tar_y = 520;
+
+            cc.tween(node)
+                .to(this.tween_time, { x: this.tar_x, y: this.tar_y })
+                .delay(2)
+                .call(() => {
+                    mk.pool.return("tips", node);
+                }, this)
+                .start();
         }
-        cc.tween(node)
-            .to(this.tween_time, { x: this.tar_x, y: this.tar_y })
-            .call(() => {
-                mk.pool.return("tips", node);
-            }, this)
-            .start();
+
     }
 
 

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

@@ -265,4 +265,10 @@ public class AppActivity extends Cocos2dxActivity {
             return true;
         }
     }
+
+    /** 打开微信 */
+    public void openWx(){
+        String url="weixin://";
+        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+    }
 }

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

@@ -155,4 +155,9 @@ public class ThirdSdkMgr {
         Log.d("===[ThirdSdkMgr ","显示开屏广告");
         ThirdSdkMgr.appActivity.startActivity(new Intent( ThirdSdkMgr.appActivity, SplashAdShowActivity.class));
     }
+
+    /** 打开微信 */
+    public static void openWx(){
+        ThirdSdkMgr.appActivity.openWx();
+    }
 }