Sfoglia il codice sorgente

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

zouyong 5 anni fa
parent
commit
52836ffe8c
37 ha cambiato i file con 1145 aggiunte e 515 eliminazioni
  1. 12 0
      assets/resources/data/guide_weak_data.json
  2. 5 0
      assets/resources/data/guide_weak_data.json.meta
  3. 14 2
      assets/resources/game/prefab/game.prefab
  4. 12 0
      assets/resources/module/guideWeak.meta
  5. 127 0
      assets/resources/module/guideWeak/GuideWeak.prefab
  6. 8 0
      assets/resources/module/guideWeak/GuideWeak.prefab.meta
  7. 26 22
      assets/resources/module/redeem/RedeemNode.prefab
  8. 165 143
      assets/resources/module/reward/reward.prefab
  9. 164 142
      assets/resources/module/reward/rewardLuck.prefab
  10. 165 143
      assets/resources/module/reward/rewardMission.prefab
  11. BIN
      assets/resources/module/turnable/texture/zhuanpan2.png
  12. 6 6
      assets/resources/module/turnable/texture/zhuanpan2.png.meta
  13. 11 11
      assets/resources/module/turnable/turnable.prefab
  14. 89 8
      assets/scene/MainScene.fire
  15. 2 2
      assets/script/game/component/BangsFit.ts
  16. 1 0
      assets/script/game/component/BtnClosePanel.ts
  17. 10 0
      assets/script/game/component/BtnOpenPanel.ts
  18. 1 1
      assets/script/game/data/AppData.ts
  19. 4 1
      assets/script/game/data/GData.ts
  20. 14 0
      assets/script/game/data/GameData.ts
  21. 1 5
      assets/script/game/data/LoginData.ts
  22. 17 7
      assets/script/game/data/module/GuideData.ts
  23. 92 0
      assets/script/game/data/module/GuideWeakData.ts
  24. 9 0
      assets/script/game/data/module/GuideWeakData.ts.meta
  25. 2 12
      assets/script/game/data/module/RewardData.ts
  26. 1 1
      assets/script/game/game/FunBtns.ts
  27. 22 0
      assets/script/game/game/Game.ts
  28. 12 0
      assets/script/game/module/guideWeak.meta
  29. 74 0
      assets/script/game/module/guideWeak/GuideWeak.ts
  30. 9 0
      assets/script/game/module/guideWeak/GuideWeak.ts.meta
  31. 2 1
      assets/script/game/module/moreGame/MoreGamePopNode.ts
  32. 12 0
      assets/script/game/module/pigBank/PigBank.ts
  33. 10 0
      assets/script/game/module/redBagCash/RedBagCash.ts
  34. 7 3
      assets/script/game/module/redeem/RedeemNode.ts
  35. 23 2
      assets/script/game/module/reward/Reward.ts
  36. 1 1
      assets/script/game/module/sign/Sign.ts
  37. 15 2
      assets/script/mk/system/FlySystem.ts

+ 12 - 0
assets/resources/data/guide_weak_data.json

@@ -0,0 +1,12 @@
+{
+	"panelWeight": {
+		"1": 10,
+		"2": 10,
+		"4": 10,
+		"5": 10,
+		"6": 10,
+		"7": 10,
+		"8": 10
+	},
+	"triggerTime": 10
+}

+ 5 - 0
assets/resources/data/guide_weak_data.json.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.0",
+  "uuid": "6395adfa-2f63-47cf-9b41-4641bb2d41e1",
+  "subMetas": {}
+}

+ 14 - 2
assets/resources/game/prefab/game.prefab

@@ -860,6 +860,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redeem/RedeemNode",
+    "bool_Auth": true,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -1115,6 +1116,7 @@
     },
     "_enabled": true,
     "panel_name": "module/turnable/turnable",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -1373,6 +1375,7 @@
     },
     "_enabled": false,
     "panel_name": "module/invite/invite",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -1815,6 +1818,7 @@
     },
     "_enabled": true,
     "panel_name": "module/receiptNotice/receiptNotice",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 3,
     "onComplete": {
@@ -2061,6 +2065,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redBagCash/redBagCash",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 3,
     "onComplete": {
@@ -2307,6 +2312,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redBagCode/redBagCode",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 3,
     "onComplete": {
@@ -2723,6 +2729,7 @@
     },
     "_enabled": true,
     "panel_name": "module/pigBank/pigBank",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -2978,6 +2985,7 @@
     },
     "_enabled": true,
     "panel_name": "module/blessingBag/blessingBag",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -3233,6 +3241,7 @@
     },
     "_enabled": true,
     "panel_name": "module/sign/sign",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -4031,6 +4040,7 @@
     },
     "_enabled": true,
     "panel_name": "module/setting/setting",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": [],
@@ -4310,7 +4320,7 @@
       "ctor": "Float64Array",
       "array": [
         -6,
-        2.5,
+        0,
         0,
         0,
         0,
@@ -4631,6 +4641,7 @@
     },
     "_enabled": true,
     "panel_name": "module/pigBank/pigBank",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": [],
@@ -4840,7 +4851,7 @@
       "ctor": "Float64Array",
       "array": [
         -6,
-        2.5,
+        0,
         0,
         0,
         0,
@@ -5161,6 +5172,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redBagCash/redBagCash",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": [],

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

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "ab5e8500-43f4-483b-a621-6ddbaaf94257",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 127 - 0
assets/resources/module/guideWeak/GuideWeak.prefab

@@ -0,0 +1,127 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "GuideWeak",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 1334
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        375,
+        667,
+        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.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "f13f5zT97NMpINpXOCogVAt",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "ba2e33b2-5a64-424b-8b08-247fed4be0f0"
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 8 - 0
assets/resources/module/guideWeak/GuideWeak.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.9",
+  "uuid": "ba2e33b2-5a64-424b-8b08-247fed4be0f0",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 26 - 22
assets/resources/module/redeem/RedeemNode.prefab

@@ -516,15 +516,15 @@
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
+      "r": 241,
+      "g": 160,
+      "b": 36,
       "a": 255
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 292,
-      "height": 35
+      "width": 144,
+      "height": 50.4
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -561,7 +561,7 @@
     "_id": ""
   },
   {
-    "__type__": "cc.Sprite",
+    "__type__": "cc.Label",
     "_name": "",
     "_objFlags": 0,
     "node": {
@@ -575,21 +575,22 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "228bd30f-23b1-44ad-986a-1352c203da41"
-    },
-    "_type": 0,
-    "_sizeMode": 1,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
+    "_string": "新手礼包",
+    "_N$string": "新手礼包",
+    "_fontSize": 36,
+    "_lineHeight": 40,
+    "_enableWrapText": true,
+    "_N$file": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_batchAsBitmap": false,
+    "_styleFlags": 1,
+    "_underlineHeight": 0,
+    "_N$horizontalAlign": 1,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 0,
+    "_N$cacheMode": 0,
     "_id": ""
   },
   {
@@ -600,7 +601,7 @@
     "asset": {
       "__uuid__": "2115765a-89cf-4ed8-8984-9cc608d7cad4"
     },
-    "fileId": "7coDkmQaRPDKa56kqfPVt6",
+    "fileId": "4fyzkG+kRIH5LVDStXjUce",
     "sync": false
   },
   {
@@ -9627,6 +9628,9 @@
       "__id__": 1
     },
     "_enabled": true,
+    "lab_title": {
+      "__id__": 13
+    },
     "txtGiftName": {
       "__id__": 134
     },

File diff suppressed because it is too large
+ 165 - 143
assets/resources/module/reward/reward.prefab


File diff suppressed because it is too large
+ 164 - 142
assets/resources/module/reward/rewardLuck.prefab


File diff suppressed because it is too large
+ 165 - 143
assets/resources/module/reward/rewardMission.prefab


BIN
assets/resources/module/turnable/texture/zhuanpan2.png


+ 6 - 6
assets/resources/module/turnable/texture/zhuanpan2.png.meta

@@ -7,8 +7,8 @@
   "premultiplyAlpha": false,
   "genMipmaps": false,
   "packable": true,
-  "width": 548,
-  "height": 535,
+  "width": 543,
+  "height": 543,
   "platformSettings": {},
   "subMetas": {
     "zhuanpan2": {
@@ -22,10 +22,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 548,
-      "height": 535,
-      "rawWidth": 548,
-      "rawHeight": 535,
+      "width": 543,
+      "height": 543,
+      "rawWidth": 543,
+      "rawHeight": 543,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

+ 11 - 11
assets/resources/module/turnable/turnable.prefab

@@ -1007,25 +1007,25 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 548,
-      "height": 535
+      "width": 543,
+      "height": 543
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0.504,
-      "y": 0.499
+      "x": 0.5,
+      "y": 0.5
     },
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
         0,
-        0.5,
         0,
         0,
         0,
         0,
-        1,
+        -0.21643961393810288,
+        0.9762960071199334,
         1,
         1,
         1
@@ -1035,7 +1035,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 0
+      "z": -25
     },
     "_skewX": 0,
     "_skewY": 0,
@@ -2026,7 +2026,7 @@
     "asset": {
       "__uuid__": "18e0b7f8-059f-4a52-9e57-690fe778a31a"
     },
-    "fileId": "eaCLbJlPRKEZBCfqME/KD7",
+    "fileId": "98r2cpWPlKbIXSTRZi2ltd",
     "sync": false
   },
   {
@@ -2158,7 +2158,7 @@
     "asset": {
       "__uuid__": "18e0b7f8-059f-4a52-9e57-690fe778a31a"
     },
-    "fileId": "81/5BDdi1LIqwIWPzdjdur",
+    "fileId": "51tbO9E2dGJIK70TVp5zXx",
     "sync": false
   },
   {
@@ -2290,7 +2290,7 @@
     "asset": {
       "__uuid__": "18e0b7f8-059f-4a52-9e57-690fe778a31a"
     },
-    "fileId": "59EpiRO/RJrLF6CHIaIWnb",
+    "fileId": "d88UfN1BZFHY4bvsipwGnv",
     "sync": false
   },
   {
@@ -2503,7 +2503,7 @@
     "asset": {
       "__uuid__": "18e0b7f8-059f-4a52-9e57-690fe778a31a"
     },
-    "fileId": "a4MpVqY8pOvqBtAyamKRuW",
+    "fileId": "53HCly4QJDNYoWJDsP9aLl",
     "sync": false
   },
   {

+ 89 - 8
assets/scene/MainScene.fire

@@ -90,16 +90,16 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 14
+        "__id__": 17
       },
       {
-        "__id__": 15
+        "__id__": 18
       },
       {
-        "__id__": 16
+        "__id__": 19
       },
       {
-        "__id__": 17
+        "__id__": 20
       }
     ],
     "_prefab": null,
@@ -580,9 +580,17 @@
     "_parent": {
       "__id__": 2
     },
-    "_children": [],
+    "_children": [
+      {
+        "__id__": 14
+      }
+    ],
     "_active": true,
-    "_components": [],
+    "_components": [
+      {
+        "__id__": 16
+      }
+    ],
     "_prefab": null,
     "_opacity": 255,
     "_color": {
@@ -594,8 +602,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
+      "width": 750,
+      "height": 1334
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -632,6 +640,79 @@
     "_id": "00l+e+JEJA2YTFgORvtX+s"
   },
   {
+    "__type__": "cc.Node",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 13
+    },
+    "_prefab": {
+      "__id__": 15
+    },
+    "_name": "GuideWeak",
+    "_active": true,
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "eanBXyELZLiLKDrC2BLhHQ"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 14
+    },
+    "asset": {
+      "__uuid__": "ba2e33b2-5a64-424b-8b08-247fed4be0f0"
+    },
+    "fileId": "",
+    "sync": true
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 13
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_id": "4a5t4pwQtJiI5cavWztbU0"
+  },
+  {
     "__type__": "cc.Canvas",
     "_name": "",
     "_objFlags": 0,

+ 2 - 2
assets/script/game/component/BangsFit.ts

@@ -1,7 +1,7 @@
 
 const {ccclass, property} = cc._decorator;
-const LeftPadding = 50;
-const RightPadding = 50;
+const LeftPadding = 65;
+const RightPadding = 65;
 /**
  * 刘海屏适配
  * @author 薛鸿潇

+ 1 - 0
assets/script/game/component/BtnClosePanel.ts

@@ -32,6 +32,7 @@ export default class BtnClosePanel extends cc.Component {
         if (this.block_click) return;
         if (this.node_panel) {
             mk.ui.closePanel(this.node_panel.name);
+            mk.event.emit('close-panel', this.node_panel.name);
         }
         const c_count = this.onComplete.length;
         for (let i = 0; i < c_count; i++) {

+ 10 - 0
assets/script/game/component/BtnOpenPanel.ts

@@ -1,5 +1,6 @@
 
 const { ccclass, property } = cc._decorator;
+import JsbSystem from '../../mk/system/JsbSystem';
 import { OpenActionType } from '../../mk/system/UISystem';
 /**
  * 打开指定名字的面板
@@ -10,6 +11,8 @@ export default class BtnOpenPanel extends cc.Component {
 
     @property({ displayName: '预制体路径', tooltip: '对应路径:resources/' })
     private panel_name = '';
+    @property({ displayName: '是否需要微信授权', tooltip: '授权勾选' })
+    private bool_Auth: boolean = false;
     @property({ displayName: '打开类型', tooltip: 'normal不操作,closeOther关闭其他,closeLast关闭上一个', type: cc.Enum(OpenActionType) })
     private open_type = OpenActionType.normal;
     @property({ displayName: '点击效果', tooltip: "仅支持 NONE 和 SCALE", type: cc.Enum(cc.Button.Transition) })
@@ -30,6 +33,13 @@ export default class BtnOpenPanel extends cc.Component {
 
     private async openPanel() {
         mk.audio.playEffect("button");
+        if (this.bool_Auth) {
+            if (!gData.loginData.isAuth) {
+                JsbSystem.WxAuth();
+                return;
+            }
+        }
+
         if (!this.panel_name) return;
         await mk.ui.openPanel(this.panel_name, this.open_type);
         const c_count = this.onComplete.length;

+ 1 - 1
assets/script/game/data/AppData.ts

@@ -31,7 +31,7 @@ export class AppData {
     /** 安卓版本号 */
     public androidVersion: string = '';
 
-    public mac: string = 'c9:24:e2:12:b3:23,f6:60:e4:1a:b7:27';
+    public mac: string = '5d:24:e2:12:b3:23,f6:60:e4:1a:b7:27';
 
     /** 设备信息 */
     public machineInfo = {

+ 4 - 1
assets/script/game/data/GData.ts

@@ -22,6 +22,7 @@ import RedeemData from "./module/RedeemData";
 import { MoreGameData } from "./module/MoreGameData";
 import { SettingData } from "./module/SettingData";
 import { GuideData } from "./module/GuideData";
+import GuideWeakData from "./module/GuideWeakData";
 
 /**
  * 数据集合全局类
@@ -40,7 +41,8 @@ class GData {
     public httpData: HttpData;
     public adData: AdData;
     public storageData: StorageData;
-    public guideData:GuideData;
+    public guideData: GuideData;
+    public guideWeakData: GuideWeakData;
 
     //module
     /** 领取红包奖励 */
@@ -79,6 +81,7 @@ class GData {
         this.adData = new AdData();
         this.storageData = new StorageData();
         this.guideData = new GuideData();
+        this.guideWeakData = new GuideWeakData();
 
         this.reward = new RewardData();
         this.help = new HelpData();

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

@@ -1,3 +1,4 @@
+import FunBtns from "../game/FunBtns";
 import Game from "../game/Game";
 
 /**
@@ -37,6 +38,8 @@ export class GameData {
 
     /** 主页样式脚本 */
     public gameStyle: Game = null;
+    /** 入口按钮 */
+    public funBtns: FunBtns = null;
 
     /**
      * 初始化游戏数据:网络配置信息,用户信息
@@ -64,6 +67,8 @@ export class GameData {
         mk.console.logSingle("getInfoCrypt", response.data);
         this.initPlayerProp(response.data)
         this.initProps(response.data.gameUserData);
+        gData.guideData.init();
+        gData.guideWeakData.init();
         gData.moduleData.forEach(element => {
             element.init();
         });
@@ -104,6 +109,7 @@ export class GameData {
         this.gameData.turntableTimes = res_data.turntableTimes;
         this.gameData.userTuCaoInfo = res_data.userTuCaoInfo;
         this.gameData.versioncfg = res_data.versioncfg;
+        this.gameData.isFirstRedMoney = res_data.isFirstRedMoney;
     }
 
     /**
@@ -176,6 +182,8 @@ export class GameData {
     public resetProps() {
         let arr = [];
         arr.push({ key: GameProp.sign_can, value: 1 });
+        arr.push({ key: GameProp.isAutoOpenPanel, value: 1 });
+        arr.push({ key: GameProp.isOpenBankOnCloseCash, value: 0 });
 
         this.setProps(arr);
     }
@@ -196,6 +204,10 @@ export enum GameProp {
     newPlayer = 1,
     /** 当前新手引导步骤 */
     guideID = 2,
+    /** 需要自动弹界面 每天一次 除首次 表示今日是否要自动开 1自动开 2不自动开 其他不处理*/
+    isAutoOpenPanel = 3,
+    /** 关闭常规提现时需要自动开存钱罐 每天一次 表示今日有没有开过 */
+    isOpenBankOnCloseCash = 4,
 
     /** ------------------ 游戏核心数据 --------------------------- */
     /** 关卡数 */
@@ -315,6 +327,8 @@ class PlayerProp {
     resetPropNum = 0;
     /** 变色道具数目 */
     changePropNum = 0;
+    /** 能免费领红包 1 表示是新人第一次产出红包币,不用看视频*/
+    isFirstRedMoney = 0;
 }
 
 /**

+ 1 - 5
assets/script/game/data/LoginData.ts

@@ -45,13 +45,9 @@ export class LoginData {
         if (result && result.json) {
             this.rule_data = result.json.server;
             this.privacy_data = result.json.privacy;
-        }
-
-        result = await mk.loader.load("data/guide_data", cc.JsonAsset);
-        if (result && result.json) {
-            gData.guideData.init(result.json);
             this.loadResCompelete = true;
         }
+
     }
 
     /**

+ 17 - 7
assets/script/game/data/module/GuideData.ts

@@ -1,3 +1,5 @@
+import { Data } from "../../../mk/data/Data";
+
 /**
  * @description 新手引导
  * @author 邹勇
@@ -10,7 +12,15 @@ export class GuideData {
     /** 当前引导id */
     public crtID: number = null;
 
-    public init(config) {
+    public async init() {
+        let config = gData.gameData.configs.Guide
+        if (!config) {
+            let result = await mk.loader.load("data/guide_data", cc.JsonAsset);
+            if (result && result.json) {
+                config = result.json;
+            }
+            cc.log('无远程引导数据,使用本地测试数据');
+        }
         this.data = new Map<number, GuideVO[]>();
         let arr = [];
         let id = 1;
@@ -21,13 +31,13 @@ export class GuideData {
             guide.id = parseInt(a[0]);
             guide.step = parseInt(a[1]);
             guide.trigger = o.trigger;
-            guide.tr_num = o.tr_num;
-            guide.tr_form = o.tr_form;
+            guide.tr_num = o.tr_num || o.trNum;
+            guide.tr_form = o.tr_form || o.trForm;
             guide.dialog = o.dialog;
-            guide.display_rect = o.display_rect;
-            guide.click_rect = o.click_rect;
-            guide.finger = o.finger;
-            guide.lag_next = o.lag_next;
+            guide.display_rect = o.display_rect || o.displayRect;
+            guide.click_rect = o.click_rect || o.clickRect;
+            guide.finger = o.finger || '';
+            guide.lag_next = o.lag_next || o.lagNext;
             if (id != guide.id) {
                 this.data.set(id, arr);
                 arr = [];

+ 92 - 0
assets/script/game/data/module/GuideWeakData.ts

@@ -0,0 +1,92 @@
+import { Data } from "../../../mk/data/Data";
+import GuideWeak from "../../module/guideWeak/GuideWeak";
+/**
+ * 弱引导数据
+ * - 主界面-弱引导
+    1. 弱引导启动:用户在主界面超过10秒未操作【配置】。
+    2. 弱引导效果:自动弹出以下界面中的一种:气泡红包界面、福袋界面、互推界面……【配置】
+    3. 配置需支持配置界面ID和对应的弹出概率。
+    - 关卡界面-弱引导
+    1. 弱引导启动:用户在关卡界面超过10秒未操作【配置】。
+    2. 弱引导效果:自动弹出以下界面中的一种:气泡红包界面、福袋界面、互推界面……【配置】
+    3. 配置需支持配置界面ID和对应的弹出概率。
+ * @author 薛鸿潇
+ */
+export default class GuideWeakData {
+
+    /**
+     * 数据初始化
+     */
+    public init() {
+        // this.data_config = data_config;
+    }
+    /**
+     * 星云数据配置
+     * - 面板权重
+     * - 触发时间
+     */
+    public data_config = {
+        "panelWeight": {
+            "1": 10,
+            "2": 10,
+            "4": 10,
+            "5": 10,
+            "6": 10,
+            "7": 10
+        },
+        "triggerTime": 5
+    }
+    /** 功能是否启动 */
+    public enable: boolean = false;
+    /** 引导正在运行 */
+
+    /** 样式类 */
+    public guideStyle: GuideWeak = null;
+
+    /**
+     * 玩家静默时间
+     * - 即:未进行任何操作的时间
+     */
+    public silent_time: number = 0;
+
+    /** 当前打开的界面id */
+    public cur_guide_id: number = 0;
+    /** 当前打开的界面名字 */
+    public cur_guide_panel: string = null;
+
+    public initGuideId() {
+        // gData.guideWeakData.cur_guide_id = 1 + 1;
+        const panelWeight = this.data_config.panelWeight;
+        let p_count = 0;
+        let total_weight = 0;
+        for (const key in panelWeight) {
+            total_weight += panelWeight[key];
+            p_count++;
+        }
+        /** 累计零时权重 */
+        let temp_weight_sum = 0;
+        // 根据奖池权重随机物品
+        let random = mk.math.random(1, total_weight);
+        for (const key in panelWeight) {
+            temp_weight_sum += panelWeight[key];
+            if (random < temp_weight_sum) {
+                // 中奖了
+                gData.guideWeakData.cur_guide_id = parseInt(key);
+                break;
+            }
+        }
+    }
+    public openPanelByBtn() {
+        const panel_id = gData.guideWeakData.cur_guide_id
+        gData.gameData.funBtns['btn' + panel_id].emit('click')
+    }
+    public panel_name_config = {
+        moreGame: 1,
+        turnable: 2,
+        none: 3,
+        pigBank: 4,
+        blessingBag: 5,
+        sign: 6,
+        redBagCash: 7,
+    }
+}

+ 9 - 0
assets/script/game/data/module/GuideWeakData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "8cbac365-032d-482a-a894-53d83ede033c",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 2 - 12
assets/script/game/data/module/RewardData.ts

@@ -6,7 +6,7 @@ import { RewardType } from "../GameData";
  * @author 邹勇 薛鸿潇
  */
 export class RewardData extends Data {
-    
+
     /** 增加的红包币 */
     public add_redbag_value: number = 0;
 
@@ -48,18 +48,8 @@ export class RewardData extends Data {
         let is_add_money = true;
         const i_count = gData.reward.data.length;
         for (let i = 0; i < i_count; i++) {
-            let target_node = gData.gameData.gameStyle.icon_hb;
-            if (gData.reward.data[i].rewardType == RewardType.redBag) {
-                target_node = gData.gameData.gameStyle.icon_hb;
-            } else if (gData.reward.data[i].rewardType == RewardType.rmb) {
-                // target_node = gData.gameData.gameStyle.icon_zb;
-            } else if (gData.reward.data[i].rewardType == RewardType.pigRmb) {
-                target_node = gData.gameData.gameStyle.icon_zb;
-            }
-            const end_world_pos = target_node.parent.convertToWorldSpaceAR(target_node.getPosition());
-            const end_node_pos = gData.gameData.gameStyle.node.parent.convertToNodeSpaceAR(end_world_pos);
             let start_node_pos = new cc.Vec2(0, -300);
-            mk.fly.PlayCoinAnim(gData.reward.data[i].rewardType, 10, start_node_pos, end_world_pos, () => {
+            mk.fly.PlayCoinAnim(gData.reward.data[i].rewardType, 10, start_node_pos, '', () => {
                 is_add_money && this.addReward();
             })
         }

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

@@ -22,7 +22,7 @@ export default class FunBtns extends cc.Component {
     btn_redeem: cc.Node = null;
 
     onLoad() {
-
+        gData.gameData.funBtns = this;
     }
 
     start() {

+ 22 - 0
assets/script/game/game/Game.ts

@@ -49,6 +49,8 @@ export default class Game extends cc.Component {
         this.initBtns();
         this.initQiPaos();
         this.initInfo();
+        this.autoOpenPanel();
+        this.runGuideWeak();
 
         // if(gData.gameData.isNewPlayer()){
         //     this.initGuide();
@@ -117,6 +119,26 @@ export default class Game extends cc.Component {
         this.img_head.spriteFrame = new cc.SpriteFrame(result);
     }
 
+    /**
+     * 自动打开面板
+     * - isAutoOpenPanel 1自动开 2不自动开 其他不处理
+     */
+    private autoOpenPanel() {
+        const isAutoOpenPanel = gData.gameData.getProp(GameProp.isAutoOpenPanel);
+        if (isAutoOpenPanel == 1) {
+            mk.ui.openPanel('module/pigBank/pigBank');
+        } else if (isAutoOpenPanel != 2) {
+            // 未定义,给初始值
+            gData.gameData.setProp(GameProp.isAutoOpenPanel, 1)
+        }
+    }
+    /**
+     * 开始运行弱引导
+     */
+    private runGuideWeak() {
+        gData.guideWeakData.enable = true;
+    }
+
     //测试道具获取效果
     private testFly() {
         mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));

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

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "e5435836-5de8-4f99-82ac-2ba5fa3b30ea",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 74 - 0
assets/script/game/module/guideWeak/GuideWeak.ts

@@ -0,0 +1,74 @@
+
+const { ccclass, property } = cc._decorator;
+/**
+ * @author 薛鸿潇
+ */
+@ccclass
+export default class GuideWeak extends cc.Component {
+
+    onLoad() {
+        gData.guideWeakData.guideStyle = this;
+        this.InitTouch();
+        mk.event.register('close-panel', this.onClosePanel, this);
+    }
+
+    update(dt) {
+        if (!gData.guideWeakData.enable) return;
+        if (!gData.guideWeakData.data_config.triggerTime) return;
+        if (gData.guideWeakData.cur_guide_id) return;
+
+        gData.guideWeakData.silent_time += dt;
+        if (gData.guideWeakData.silent_time >= gData.guideWeakData.data_config.triggerTime) {
+            gData.guideWeakData.initGuideId();
+            gData.guideWeakData.openPanelByBtn();
+        }
+    }
+
+    /**
+     * 界面关闭
+     */
+    public onClosePanel(panel_name: string = '') {
+        cc.log(panel_name)
+        if (gData.guideWeakData.panel_name_config[panel_name] == gData.guideWeakData.cur_guide_id) {
+            gData.guideWeakData.cur_guide_id = 0;
+        }
+    }
+    /** 玩家的屏幕触摸操作 */
+    private onClickCall(touch) {
+        cc.log('弱引导计时重置');
+        gData.guideWeakData.silent_time = 0;
+    }
+
+    ///////////////// 自定义触摸监听 /////////////////
+    private _eventManager = cc["internal"]["eventManager"];
+    private _touchListener: any;
+    private InitTouch() {
+        const EventListener = cc["EventListener"];
+        this._touchListener = EventListener.create({
+            event: EventListener.TOUCH_ONE_BY_ONE,
+            swallowTouches: false,//是否吞噬touch事件
+            owner: this.node,
+            mask: null,
+            onTouchBegan: this.onTouchStart.bind(this),
+            onTouchMoved: null,
+            onTouchEnded: this.onTouchEnded.bind(this),
+            onTouchCancelled: null,
+        });
+        this._eventManager.addListener(this._touchListener, this.node);
+    }
+
+    private onTouchStart(touch: cc.Touch, event: cc.Event.EventTouch): boolean {
+        // cc.log("touch start");
+        //此处必须返回true(表示接触到了节点),否则TOUCH_MOVE,TOUCH_END,TOUCH_CANCEL不触发。
+        return true;
+    }
+    private onTouchEnded(touch: cc.Touch, event: cc.Event.EventTouch): void {
+        // cc.log("touch end");
+        this.onClickCall(touch);
+    }
+    protected onDestroy(): void {
+        // super.onDestroy();
+        this._eventManager.removeListener(this._touchListener, this.node);
+        mk.event.remove('close-panel', this.onClosePanel, this);
+    }
+}

+ 9 - 0
assets/script/game/module/guideWeak/GuideWeak.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "f13f5cd3-f7b3-4ca4-8369-5ce0a881502d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

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

@@ -4,6 +4,7 @@
  */
 
 import JsbSystem from "../../../mk/system/JsbSystem";
+import { RewardType } from "../../data/GameData";
 
 
 const { ccclass, property } = cc._decorator;
@@ -71,6 +72,6 @@ export default class MoreGamePopNode extends cc.Component {
         // mk.audio.playEffect('getGold');
         mk.tip.pop('红包币+300');
         //     GameM.commonData.updateRedMoney(300, RecordTYPE.online)
-        mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));
+        mk.fly.PlayCoinAnim(RewardType.pigRmb, 20, cc.v2(0, -300));
     }
 }

+ 12 - 0
assets/script/game/module/pigBank/PigBank.ts

@@ -1,4 +1,5 @@
 import JsbSystem from "../../../mk/system/JsbSystem";
+import { GameProp } from "../../data/GameData";
 
 const { ccclass, property } = cc._decorator;
 /**
@@ -109,4 +110,15 @@ export default class PigBank extends cc.Component {
     onClickClose() {
         mk.ad.checkShowInterByChance();
     }
+
+    onDestroy() {
+        const isAutoOpenPanel = gData.gameData.getProp(GameProp.isAutoOpenPanel);
+        if (isAutoOpenPanel === 1) {
+            // 必须是可签到才弹
+            if (!gData.gameData.gameData.isSignInToday && gData.sign.haveSignDay()) {
+                mk.ui.openPanel('module/sign/sign');
+            }
+            gData.gameData.setProp(GameProp.isAutoOpenPanel, 2);
+        }
+    }
 }

+ 10 - 0
assets/script/game/module/redBagCash/RedBagCash.ts

@@ -1,4 +1,5 @@
 import TableView from "../../component/TableView";
+import { GameProp } from "../../data/GameData";
 
 const { ccclass, property } = cc._decorator;
 /**
@@ -74,4 +75,13 @@ export default class RedBagCash extends cc.Component {
         rmb = rmb > 1 ? Math.floor(rmb) : parseFloat(rmb.toFixed(2));
         this.lbl_rmb.string = `${rmb}`;
     }
+
+    onDestroy() {
+        // 是否需要打开存钱罐
+        const isOpenBankOnCloseCash = gData.gameData.getProp(GameProp.isOpenBankOnCloseCash);
+        if (!isOpenBankOnCloseCash) {
+            mk.ui.openPanel('module/pigBank/pigBank');
+            gData.gameData.setProp(GameProp.isOpenBankOnCloseCash, 1);
+        }
+    }
 }

+ 7 - 3
assets/script/game/module/redeem/RedeemNode.ts

@@ -10,6 +10,9 @@ const { ccclass, property } = cc._decorator;
 export default class RedeemNode extends cc.Component {
 
     @property(cc.Label)
+    lab_title: cc.Label = null;
+
+    @property(cc.Label)
     txtGiftName: cc.Label = null;
 
     @property(cc.Prefab)
@@ -57,10 +60,11 @@ export default class RedeemNode extends cc.Component {
 
     InitData() {
         let data = gData.redeem.redeemData.redemption;
-        if (!data.content) {
-            mk.ui.closePanel('module/redeem/RedeemNode');
+        if (!data) {
+            mk.ui.closePanel(this.node.name);
             return
         }
+        this.lab_title.string = data.title;
         this.txtGiftName.string = data.title;
         this.rewardData = data.content;
         for (let n of this.rds) {
@@ -142,7 +146,7 @@ export default class RedeemNode extends cc.Component {
 
         for (let i = 0; i < this.rewardData.length; i++) {
             mk.audio.playEffect('rewardClose');
-            mk.fly.PlayCoinAnim(this.rewardData[i].type, 5, cc.v2(0, -300), cc.v2(0, 0))
+            mk.fly.PlayCoinAnim(this.rewardData[i].type, 5, cc.v2(0, -300));
         }
 
 

+ 23 - 2
assets/script/game/module/reward/Reward.ts

@@ -1,6 +1,6 @@
 import GamePlay from "../../../before/GamePlay";
 import { AdFun } from "../../data/AdData";
-import { RewardType } from "../../data/GameData";
+import { GameProp, RewardType } from "../../data/GameData";
 
 const { ccclass, property } = cc._decorator;
 /**
@@ -50,6 +50,9 @@ export default class Reward extends cc.Component {
     private lbl_cash_out: cc.Label = null;
     @property({ displayName: '提现金额', type: cc.Label })
     private lbl_cash: cc.Label = null;
+    @property({ displayName: '提现按钮', type: cc.Animation })
+    private node_cash: cc.Animation = null;
+
 
 
     /** 当前阶段 */
@@ -124,13 +127,31 @@ export default class Reward extends cc.Component {
         const fillRange = newRedMoney / cash_data.type_value >= 1 ? 1 : newRedMoney / cash_data.type_value;
         // this.spr_cash_out.fillRange = fillRange;
         cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();
+        if (redMoney >= cash_data.type_value) {
+            this.node_cash.play();
+        } else {
+            this.node_cash.stop();
+        }
     }
 
     /**
      * 看广告
      */
-    private clickWatchVideo() {
+    private async clickWatchVideo() {
         cc.log('看广告请求');
+        if (gData.gameData.gameData.isFirstRedMoney) {
+            gData.gameData.gameData.isFirstRedMoney = 0;
+            // 用户第一次看此视频时,可不需要看直接领取奖励
+            let response = await mk.http.sendData('getFreeRedMoney', {});
+            if (response.errcode != 0) {
+                mk.tip.pop(response.errmsg);
+                return;
+            }
+            gData.reward.adData = {}
+            gData.reward.adData.videoRedMoney = {}
+            gData.reward.adData.videoRedMoney.videoRewardList = [{ rewardType: RewardType.redBag, rewardNum: response.data.freeRedMoney }]
+            return;
+        }
         if (this.lid_type === LidType.mission) {
             // 关卡结算红包
             mk.ad.watchAd((success: boolean) => {

+ 1 - 1
assets/script/game/module/sign/Sign.ts

@@ -59,7 +59,6 @@ export default class Sign extends cc.Component {
     }
 
     lateUpdate() {
-        gData.sign.init_data = false;
         gData.sign.adData = null;
     }
 
@@ -114,6 +113,7 @@ export default class Sign extends cc.Component {
             this.anim_btn.node.scale = 1;
             this.anim_btn.getComponent('SetGray').setGray(true);
         }
+        gData.sign.init_data = false;
     }
 
     onClickClose() {

+ 15 - 2
assets/script/mk/system/FlySystem.ts

@@ -1,3 +1,5 @@
+import { RewardType } from "../../game/data/GameData";
+
 /** 
  * @description 获取道具特效
  * @author kaka 
@@ -15,10 +17,10 @@ export default class FlySystem extends cc.Component {
      * @param type 类型 道具id  10001,10002
      * @param num 特效数量
      * @param pos 起始位置
-     * @param endpos 飞行目标的世界坐标 或目标对象路径
+     * @param endpos 飞行目标的世界坐标 或目标对象路径  如果为"",则飞到主界面货币按钮处 默认""
      * @param cb 动画结束回调
     */
-    public async PlayCoinAnim(type: number = 0, num: number, pos: cc.Vec2, endpos: cc.Vec2 | string, item_cb: Function = null) {
+    public async PlayCoinAnim(type: number = 0, num: number, pos: cc.Vec2, endpos: cc.Vec2 | string = '', item_cb: Function = null) {
         for (let i = 0; i < num; i++) {
             let copyCoin = await mk.pool.getPrefab('game/prefab/coin');
             let url = 'game/texture/coin/' + type;
@@ -56,6 +58,17 @@ export default class FlySystem extends cc.Component {
         let end_pos: cc.Vec2 = null;
         let end_node: cc.Node = null;
         if (typeof end === 'string') {
+            if (end == '') {
+                let url = ''
+                if (type == RewardType.redBag) {
+                    url = 'Canvas/界面层/game/node_ui/顶部个人信息/红包币按钮/icon_hb';
+                }
+                else if (type == RewardType.pigRmb) {
+                    url = 'Canvas/界面层/game/node_ui/顶部个人信息/金猪币按钮/icon_zb';
+                }
+                end = url;
+            }
+
             end_node = cc.find(end as string);
             let world_pos = end_node.parent.convertToWorldSpaceAR(end_node.getPosition());
             end_pos = this.node.convertToNodeSpaceAR(world_pos);

Some files were not shown because too many files changed in this diff