Browse Source

【功能】完成恭喜翻倍奖励

mojunshou 9 months ago
parent
commit
a3f8ee8272

File diff suppressed because it is too large
+ 458 - 262
assets/bundle/gui/eliminate/prefab/doubleRewards.prefab


+ 80 - 118
assets/bundle/gui/eliminate/prefab/item/bricsItem.prefab

@@ -22,20 +22,20 @@
         "__id__": 2
       },
       {
-        "__id__": 14
+        "__id__": 12
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 50
+        "__id__": 48
       },
       {
-        "__id__": 52
+        "__id__": 50
       }
     ],
     "_prefab": {
-      "__id__": 54
+      "__id__": 52
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -57,7 +57,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -83,13 +83,10 @@
     "_components": [
       {
         "__id__": 9
-      },
-      {
-        "__id__": 11
       }
     ],
     "_prefab": {
-      "__id__": 13
+      "__id__": 11
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -111,7 +108,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -161,7 +158,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -285,44 +282,6 @@
     "fileId": "98NLEmi/ZPjp8EnNKMdRL5"
   },
   {
-    "__type__": "47052uw/Y5O1LXaLObj4ARx",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 2
-    },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 12
-    },
-    "watchPath": "",
-    "foreachChildMode": false,
-    "condition": 0,
-    "foreachChildType": 0,
-    "valueA": 0,
-    "valueB": 0,
-    "valueAction": 0,
-    "valueActionOpacity": 0,
-    "valueActionColor": {
-      "__type__": "cc.Color",
-      "r": 155,
-      "g": 155,
-      "b": 155,
-      "a": 255
-    },
-    "valueComponentName": "",
-    "valueComponentProperty": "",
-    "valueComponentDefaultValue": "",
-    "valueComponentActionValue": "",
-    "watchNodes": [],
-    "_id": ""
-  },
-  {
-    "__type__": "cc.CompPrefabInfo",
-    "fileId": "32PWC9xU9HNIZxh5pYkjVD"
-  },
-  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -345,29 +304,29 @@
     },
     "_children": [
       {
-        "__id__": 15
+        "__id__": 13
       },
       {
-        "__id__": 23
+        "__id__": 21
       },
       {
-        "__id__": 29
+        "__id__": 27
       },
       {
-        "__id__": 35
+        "__id__": 33
       },
       {
-        "__id__": 41
+        "__id__": 39
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
-        "__id__": 47
+        "__id__": 45
       }
     ],
     "_prefab": {
-      "__id__": 49
+      "__id__": 47
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -389,7 +348,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -404,23 +363,23 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 14
+      "__id__": 12
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 16
+        "__id__": 14
       },
       {
-        "__id__": 18
+        "__id__": 16
       },
       {
-        "__id__": 20
+        "__id__": 18
       }
     ],
     "_prefab": {
-      "__id__": 22
+      "__id__": 20
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -442,7 +401,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -457,11 +416,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 15
+      "__id__": 13
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 17
+      "__id__": 15
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -485,11 +444,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 15
+      "__id__": 13
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 19
+      "__id__": 17
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -530,11 +489,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 15
+      "__id__": 13
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 21
+      "__id__": 19
     },
     "playOnLoad": true,
     "_clips": [
@@ -572,20 +531,20 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 14
+      "__id__": 12
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 22
       },
       {
-        "__id__": 26
+        "__id__": 24
       }
     ],
     "_prefab": {
-      "__id__": 28
+      "__id__": 26
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -607,7 +566,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -622,11 +581,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 23
+      "__id__": 21
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 25
+      "__id__": 23
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -650,11 +609,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 23
+      "__id__": 21
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 27
+      "__id__": 25
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -708,20 +667,20 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 14
+      "__id__": 12
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 30
+        "__id__": 28
       },
       {
-        "__id__": 32
+        "__id__": 30
       }
     ],
     "_prefab": {
-      "__id__": 34
+      "__id__": 32
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -743,7 +702,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -758,11 +717,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 29
+      "__id__": 27
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 31
+      "__id__": 29
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -786,11 +745,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 29
+      "__id__": 27
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 33
+      "__id__": 31
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -844,20 +803,20 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 14
+      "__id__": 12
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 36
+        "__id__": 34
       },
       {
-        "__id__": 38
+        "__id__": 36
       }
     ],
     "_prefab": {
-      "__id__": 40
+      "__id__": 38
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -879,7 +838,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -894,11 +853,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 35
+      "__id__": 33
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 37
+      "__id__": 35
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -922,11 +881,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 35
+      "__id__": 33
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 39
+      "__id__": 37
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -980,20 +939,20 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 14
+      "__id__": 12
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 42
+        "__id__": 40
       },
       {
-        "__id__": 44
+        "__id__": 42
       }
     ],
     "_prefab": {
-      "__id__": 46
+      "__id__": 44
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1015,7 +974,7 @@
       "z": 1
     },
     "_mobility": 0,
-    "_layer": 1073741824,
+    "_layer": 33554432,
     "_euler": {
       "__type__": "cc.Vec3",
       "x": 0,
@@ -1030,11 +989,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 41
+      "__id__": 39
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 43
+      "__id__": 41
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1058,11 +1017,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 41
+      "__id__": 39
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 45
+      "__id__": 43
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -1139,11 +1098,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 14
+      "__id__": 12
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 48
+      "__id__": 46
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1184,7 +1143,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 51
+      "__id__": 49
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1212,16 +1171,16 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 53
+      "__id__": 51
     },
     "brickNode": {
-      "__id__": 14
+      "__id__": 12
     },
     "completeNode": {
       "__id__": 2
     },
     "levelLabel": {
-      "__id__": 44
+      "__id__": 42
     },
     "iconList": [
       {
@@ -1234,13 +1193,16 @@
       }
     ],
     "iconSprite": {
-      "__id__": 32
+      "__id__": 30
     },
     "iconNode": {
-      "__id__": 29
+      "__id__": 27
     },
     "icon2Node": {
-      "__id__": 41
+      "__id__": 33
+    },
+    "circleNode": {
+      "__id__": 13
     },
     "_id": ""
   },

+ 16 - 5
assets/script/game/view/BricsItem.ts

@@ -2,11 +2,12 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-18 15:09:04
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-18 16:38:55
+ * @LastEditTime: 2025-04-18 18:05:15
  * @Description: 金砖道具
  */
-import { _decorator, Label, Node, Sprite, SpriteFrame } from 'cc';
+import { _decorator, Component, Label, Node, Sprite, SpriteFrame } from 'cc';
 import VMParent from 'db://oops-framework/libs/model-view/VMParent';
+import { smc } from '../common/SingletonModuleComp';
 const { ccclass, property } = _decorator;
 
 @ccclass('BricsItem')
@@ -33,13 +34,16 @@ export class BricsItem extends VMParent {
     @property(Node)
     private icon2Node: Node = null!;
 
+    @property(Node)
+    private circleNode: Node = null!;
+
     data: any = {
         level: 0,
         eventType: "",
         withdraw: false,
-        // position?: 0, //位置
-        // isFirstNotWithdraw?: false, //是否第一个没提现
-        // isAllWithdrawBeforeSecondLast?: false, //是否所有提现点都提现
+        position: 0, //位置
+        isFirstNotWithdraw: false, //是否第一个没提现
+        isAllWithdrawBeforeSecondLast: false, //是否所有提现点都提现
     }
     start() {
 
@@ -59,6 +63,7 @@ export class BricsItem extends VMParent {
         if (this.data.eventType === "SIGN_POINT") {
             this.iconSprite.spriteFrame = this.iconList[0];
             //
+            this.iconNode.active = true;
         } else {
             this.iconSprite.spriteFrame = this.iconList[1];
         }
@@ -73,6 +78,12 @@ export class BricsItem extends VMParent {
                 this.icon2Node.active = true;
             }
         }
+        //显示光圈
+        if (this.data.level === smc.account.AccountModel.curLevel) {
+            this.circleNode.active = true;
+        } else {
+            this.circleNode.active = false;
+        }
     }
 }
 

+ 17 - 46
assets/script/game/view/DoubleRewardsView.ts

@@ -2,18 +2,16 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 11:57:43
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-18 17:07:22
+ * @LastEditTime: 2025-04-18 18:04:32
  * @Description: 惊喜翻倍弹窗
  */
-import { _decorator, instantiate, Label, Node, Prefab, UITransform, ProgressBar } from 'cc';
+import { _decorator, instantiate, Label, Node, Prefab, UITransform } from 'cc';
 import { oops } from 'db://oops-framework/core/Oops';
-import { CCVMParentComp } from 'db://oops-framework/module/common/CCVMParentComp';
+import VMParent from 'db://oops-framework/libs/model-view/VMParent';
 import { AD_TYPE } from '../common/config/GameDefine';
 import { UIID } from '../common/config/GameUIConfig';
 import { ADHandler } from '../common/manager/ADHandler';
 import { smc } from '../common/SingletonModuleComp';
-import { ecs } from 'db://oops-framework/libs/ecs/ECS';
-import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
 import { BricsItem } from './BricsItem';
 
 const { ccclass, property } = _decorator;
@@ -30,21 +28,9 @@ interface LevelInfo {
 
 /** 显示对象控制 */
 @ccclass('DoubleRewardsView')
-export class DoubleRewardsView extends GameComponent {
+export class DoubleRewardsView extends VMParent {
     @property([Label])
     lab_list: Label[] = [];
-    @property(Label)
-    private lab_time: Label = null!; //提示文字 倒数
-
-    //第一个面板
-    @property(Node)
-    private tipsNode: Node = null!; //提示Node
-    @property(ProgressBar)
-    private tipsBar1: ProgressBar = null!; //进度条
-    @property(Label)
-    private lab_title1: Label = null!; //提示文字
-    @property(Label)
-    private lab_tips: Label = null!; //提示文字 已赚,还差
     @property(Node)
     private redBagNode: Node = null!; //红包Node
     @property(Node)
@@ -56,14 +42,9 @@ export class DoubleRewardsView extends GameComponent {
     @property(Node)
     private tipsLabelNode: Node = null!; //提示文字Node
 
-
-
-    @property(Label)
-    private lab_title2: Label = null!; //提示文字
-    @property(ProgressBar)
-    private tipsBar2: ProgressBar = null!; //进度条
     @property(Node)
     private levelListNode: Node = null!; //等级Node
+
     @property(Prefab)
     private levelItemPrefab: Prefab = null!; //等级Item预制体
 
@@ -143,22 +124,6 @@ export class DoubleRewardsView extends GameComponent {
                 this.data.handlingCharge = info.handingChargeProgress.handingCharge;
                 this.data.curGoldNum = info.handingChargeProgress.hasNum;
                 this.data.gapGoldNum = info.handingChargeProgress.gapNum;
-                let str = this.lab_title1.string;
-                str = str.replace("{{0}}", this.data.curGoldNum + "");
-                str = str.replace("{{1}}", this.data.totalGoldNum + "");
-                this.lab_title1.string = str;
-                //已赚 还差
-                let str2 = this.lab_tips.string;
-                str2 = str2.replace("{{0}}", this.data.curGoldNum + "");
-                str2 = str2.replace("{{1}}", this.data.gapGoldNum + "");
-                this.lab_tips.string = str2;
-                //进度条计算
-                let progress = this.data.curGoldNum / this.data.handlingCharge;
-                if (progress > 1) {
-                    progress = 1;
-                }
-                this.tipsBar1.progress = progress;
-
                 const showNode = this.node.getChildByPath("bottonNode/tips_node1");
                 if (showNode) {
                     showNode.active = true;
@@ -191,12 +156,10 @@ export class DoubleRewardsView extends GameComponent {
                 if (showNode) {
                     showNode.active = false;
                 }
-
             }
             if (info.levelProgress) {
                 //设置进度条
                 //克隆,然后添加
-
                 const showNode = this.node.getChildByPath("bottonNode/tips_node2");
                 if (showNode) {
                     showNode.active = true;
@@ -208,6 +171,7 @@ export class DoubleRewardsView extends GameComponent {
                 levelInfoList.forEach((item, index) => {
                     const levelItem = instantiate(this.levelItemPrefab);
                     this.levelListNode.addChild(levelItem);
+                    this.levelListNode.addChild(levelItem);
                     if (item.position) {
                         levelItem.setPosition(item.position, 0);
                         //设置数据
@@ -218,6 +182,16 @@ export class DoubleRewardsView extends GameComponent {
                     }
                 });
 
+                //计算进度//如果当前关提现了
+                //const 最大关
+                const maxLevel = levelInfoList[levelInfoList.length - 1].level;
+                //const 当前关
+                const currentLevel = smc.account.AccountModel.curLevel;
+                this.data.curGoldNum = currentLevel;
+                this.data.handlingCharge = maxLevel;
+
+
+
             } else {
                 //隐藏节点
                 const showNode = this.node.getChildByPath("bottonNode/tips_node2");
@@ -236,6 +210,7 @@ export class DoubleRewardsView extends GameComponent {
         }
     }
 
+
     //计算位置
     calculatePositions(levelInfoList: LevelInfo[], totalLength: number = 516): LevelInfo[] {
         if (levelInfoList.length === 0) return [];
@@ -297,8 +272,4 @@ export class DoubleRewardsView extends GameComponent {
             return item;
         });
     }
-
-    reset(): void {
-
-    }
 }

+ 4 - 2
assets/script/game/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-18 17:08:53
+ * @LastEditTime: 2025-04-18 17:49:58
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -2209,7 +2209,7 @@ export class EliminateViewComp extends CCComp {
                     {
                         "level": 1,
                         "eventType": "WITHDRAW_POINT",
-                        "withdraw": false
+                        "withdraw": true
                     },
                     {
                         "level": 4,
@@ -2235,6 +2235,8 @@ export class EliminateViewComp extends CCComp {
             }
         }
 
+
+
         let str = JSON.stringify(param);
         ServerHandler.inst.onDoubleSurprise(str);
     }