zane 4 هفته پیش
والد
کامیت
e008120c33

+ 5 - 0
assets/resources/i18n/en.ts

@@ -3,6 +3,7 @@ const win = window as any;
 export const languages = {
   Common: {
     NoGem: `Insufficient balance`,
+    AlterNameConfirm: `Are you sure you want to spend Diamond x30 to change your name?`,
   },
   Family: {
     WhatIsFamily: `A Family is a group system where players team up to earn shared rewards.
@@ -26,6 +27,10 @@ Start growing your family now!`,
 
 Spend {value}Diamond to upgrade family now?`,
     UpgradeFamilySuccess: "Family upgrade successful! Max member count: +10.",
+
+    LeaveFamilyConfirm: `Are you sure you want to leave the family?`,
+    LeaveFamilySuccess: "You have left the family",
+    LeaveFamilyOwnerConfirm: `You are the owner of the family, you cannot leave the family.`,
   },
   Play: {
     TipsChoose10Times: `You have more than 10 SPINs , do you want to Auto Spin 10 times?

+ 438 - 44
assets/resources/prefab/family/FamilyPageHas.prefab

@@ -29,25 +29,28 @@
       },
       {
         "__id__": 342
+      },
+      {
+        "__id__": 358
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 364
+        "__id__": 380
       },
       {
-        "__id__": 366
+        "__id__": 382
       },
       {
-        "__id__": 368
+        "__id__": 384
       },
       {
-        "__id__": 370
+        "__id__": 386
       }
     ],
     "_prefab": {
-      "__id__": 372
+      "__id__": 388
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -124,7 +127,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 3.8975000000000364,
-      "y": 1391.2075,
+      "y": 1441.2075,
       "z": 0
     },
     "_lrot": {
@@ -3942,7 +3945,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 1070.0075,
+      "y": 1120.0075,
       "z": 0
     },
     "_lrot": {
@@ -5356,7 +5359,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 888.0844999999999,
+      "y": 938.0844999999999,
       "z": 0
     },
     "_lrot": {
@@ -8439,7 +8442,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "members",
+    "_name": "leave_family_layout",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
@@ -8448,30 +8451,421 @@
     "_children": [
       {
         "__id__": 343
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 355
+      }
+    ],
+    "_prefab": {
+      "__id__": 357
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 634.2925,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "btn_leave_family",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 342
+    },
+    "_children": [
+      {
+        "__id__": 344
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 350
       },
       {
-        "__id__": 349
+        "__id__": 352
       }
     ],
+    "_prefab": {
+      "__id__": 354
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 343
+    },
+    "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 357
+        "__id__": 345
       },
+      {
+        "__id__": 347
+      }
+    ],
+    "_prefab": {
+      "__id__": 349
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 344
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 346
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 148.66943359375,
+      "height": 31.5
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "0fMfDqtWJFfLemPRnu2hW9"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 344
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 348
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_string": "Leave Family",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 25,
+    "_fontSize": 25,
+    "_fontFamily": "Arial",
+    "_lineHeight": 25,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "46wEpYhIRMAruDr4PIsrk3"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "e0wVHY5SxMUYj0Hnr/3QAt",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 343
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 351
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 300,
+      "height": 64
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "6dPm/pijZJKYMjnw3EDNYx"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 343
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 353
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 34,
+      "g": 28,
+      "b": 28,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "b82da5d4-9d8d-459e-9782-b27abd0d75cf@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "77St7TOgVFOrD/fNMPyQWL"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "dad2egY0xE24x+hmKPQUMu",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 342
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 356
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 600,
+      "height": 80
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "58QEF1yYZNDYQBU5BTOSpw"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "c0OIqhkI5Gq6kqJPPEvNLs",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "members",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [
       {
         "__id__": 359
       },
       {
-        "__id__": 361
+        "__id__": 365
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 373
+      },
+      {
+        "__id__": 375
+      },
+      {
+        "__id__": 377
       }
     ],
     "_prefab": {
-      "__id__": 363
+      "__id__": 379
     },
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 3.8975000000000364,
-      "y": 624.2925,
+      "y": 574.2925,
       "z": 0
     },
     "_lrot": {
@@ -8503,20 +8897,20 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 342
+      "__id__": 358
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 344
+        "__id__": 360
       },
       {
-        "__id__": 346
+        "__id__": 362
       }
     ],
     "_prefab": {
-      "__id__": 348
+      "__id__": 364
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -8553,11 +8947,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 343
+      "__id__": 359
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 345
+      "__id__": 361
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -8581,11 +8975,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 343
+      "__id__": 359
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 347
+      "__id__": 363
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -8662,23 +9056,23 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 342
+      "__id__": 358
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 350
+        "__id__": 366
       },
       {
-        "__id__": 352
+        "__id__": 368
       },
       {
-        "__id__": 354
+        "__id__": 370
       }
     ],
     "_prefab": {
-      "__id__": 356
+      "__id__": 372
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -8715,11 +9109,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 349
+      "__id__": 365
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 351
+      "__id__": 367
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -8743,11 +9137,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 349
+      "__id__": 365
     },
     "_enabled": false,
     "__prefab": {
-      "__id__": 353
+      "__id__": 369
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -8788,11 +9182,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 349
+      "__id__": 365
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 355
+      "__id__": 371
     },
     "_resizeMode": 0,
     "_layoutType": 2,
@@ -8839,11 +9233,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 342
+      "__id__": 358
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 358
+      "__id__": 374
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -8867,11 +9261,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 342
+      "__id__": 358
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 360
+      "__id__": 376
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -8912,11 +9306,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 342
+      "__id__": 358
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 362
+      "__id__": 378
     },
     "_resizeMode": 1,
     "_layoutType": 2,
@@ -8967,12 +9361,12 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 365
+      "__id__": 381
     },
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 720,
-      "height": 2822.415
+      "height": 2922.415
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -8995,7 +9389,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 367
+      "__id__": 383
     },
     "_alignFlags": 40,
     "_target": null,
@@ -9031,7 +9425,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 369
+      "__id__": 385
     },
     "_resizeMode": 1,
     "_layoutType": 2,
@@ -9069,7 +9463,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 371
+      "__id__": 387
     },
     "_id": ""
   },

+ 23 - 0
assets/resources/prefab/family/FamilyPageHas.ts

@@ -202,6 +202,9 @@ export class FamilyPageHas extends BaseUI {
   protected simpleOnBtnClick(name: string): void {
     let self = this;
     switch (name) {
+      case "btn_leave_family":
+        this.leaveFamily();
+        break;
       case "btn_edit_family_notice":
         this.editFamilyNotice();
         break;
@@ -226,6 +229,26 @@ export class FamilyPageHas extends BaseUI {
         break;
     }
   }
+  async leaveFamily() {
+    if (this._data.ownerDto != null) {
+      TipsLayer.showConfirm(
+        "",
+        Utils.setI18nLabel("Family.LeaveFamilyOwnerConfirm")
+      );
+      return;
+    }
+
+    let ok = await TipsLayer.showConfirm("", Utils.setI18nLabel("Family.LeaveFamilyConfirm"));
+    if (!ok) {
+      return;
+    }
+
+    let result = await FamilyM.ins.leaveFamily();
+    if (result) {
+      Tips.show(Utils.setI18nLabel("Family.LeaveFamilySuccess"));
+      await UserM.ins.refreshInfo();
+    }
+  }
   async upgradeFamily() {
     let costDiamond = 10;
 

+ 77 - 77
assets/resources/prefab/hall/Hall.prefab

@@ -4812,9 +4812,6 @@
       {
         "__id__": 202
       },
-      {
-        "__id__": 208
-      },
       {
         "__id__": 226
       },
@@ -4865,29 +4862,89 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "icon_my_grade",
+    "_name": "btn_name_layout",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
       "__id__": 201
     },
+    "_children": [
+      {
+        "__id__": 203
+      },
+      {
+        "__id__": 209
+      },
+      {
+        "__id__": 215
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 221
+      },
+      {
+        "__id__": 223
+      }
+    ],
+    "_prefab": {
+      "__id__": 225
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -441.435,
+      "y": 3.028,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "icon_my_grade",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 202
+    },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 203
+        "__id__": 204
       },
       {
-        "__id__": 205
+        "__id__": 206
       }
     ],
     "_prefab": {
-      "__id__": 207
+      "__id__": 208
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -413.80100000000004,
-      "y": -1.2699999999999818,
+      "x": 25,
+      "y": -7.326000000000022,
       "z": 0
     },
     "_lrot": {
@@ -4919,11 +4976,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 202
+      "__id__": 203
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 204
+      "__id__": 205
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -4947,11 +5004,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 202
+      "__id__": 203
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 206
+      "__id__": 207
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -4999,70 +5056,13 @@
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
-  {
-    "__type__": "cc.Node",
-    "_name": "name_layout",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "_parent": {
-      "__id__": 201
-    },
-    "_children": [
-      {
-        "__id__": 209
-      },
-      {
-        "__id__": 215
-      }
-    ],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 221
-      },
-      {
-        "__id__": 223
-      }
-    ],
-    "_prefab": {
-      "__id__": 225
-    },
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": -392.157,
-      "y": 3.028,
-      "z": 0
-    },
-    "_lrot": {
-      "__type__": "cc.Quat",
-      "x": 0,
-      "y": 0,
-      "z": 0,
-      "w": 1
-    },
-    "_lscale": {
-      "__type__": "cc.Vec3",
-      "x": 1,
-      "y": 1,
-      "z": 1
-    },
-    "_mobility": 0,
-    "_layer": 33554432,
-    "_euler": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_id": ""
-  },
   {
     "__type__": "cc.Node",
     "_name": "lbl_title_player_name",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 208
+      "__id__": 202
     },
     "_children": [],
     "_active": true,
@@ -5079,7 +5079,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 0,
+      "x": 55,
       "y": 0,
       "z": 0
     },
@@ -5221,7 +5221,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 208
+      "__id__": 202
     },
     "_children": [],
     "_active": true,
@@ -5238,7 +5238,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 144.307,
+      "x": 199.307,
       "y": 0,
       "z": 0
     },
@@ -5380,7 +5380,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 208
+      "__id__": 202
     },
     "_enabled": true,
     "__prefab": {
@@ -5388,7 +5388,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 184.957390625,
+      "width": 239.957390625,
       "height": 55.879999999999995
     },
     "_anchorPoint": {
@@ -5408,7 +5408,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 208
+      "__id__": 202
     },
     "_enabled": true,
     "__prefab": {

+ 30 - 0
assets/resources/prefab/hall/HallTitleBar.ts

@@ -29,6 +29,8 @@ import { Sprite } from "cc";
 import AB from "../../scripts/base/AB";
 import { SpriteFrame } from "cc";
 import FamilyM from "../../scripts/api/FamilyM";
+import { TipsData, TipsLayer } from "../layer/TipsLayer";
+import { InputNameLayer } from "../family/InputNameLayer";
 
 const { ccclass, property } = _decorator;
 
@@ -129,6 +131,9 @@ export class HallTitleBar extends BaseUI {
 
   protected async simpleOnBtnClick(name: string): Promise<void> {
     switch (name) {
+      case "btn_name_layout":
+        this.alterName();
+        break;
       case "btn_gem":
         GemRechargeLayer.show();
         break;
@@ -137,6 +142,7 @@ export class HallTitleBar extends BaseUI {
         Hall.ins.switchPage(Hall.PageShop);
         // RewardLayer.mock();
         break;
+      
       case "btn_game_pass":
         let page = await Hall.ins.switchPage(Hall.PageShop);
         if (!page) {
@@ -161,4 +167,28 @@ export class HallTitleBar extends BaseUI {
         break;
     }
   }
+  async alterName() {
+    
+    let tips=Utils.setI18nLabel("Common.AlterNameConfirm");
+
+    let ok = await TipsLayer.showConfirm("", tips);
+    if (!ok) {
+      return;
+    }
+
+   if(UserM.ins.getGoodsCount(GoodsId.GEM)<30){
+    Tips.show(Utils.setI18nLabel("Common.NoGem"));
+    return;
+   }
+
+    let name = await InputNameLayer.show(10);
+    if (!name || name == "") {
+      return;
+    }
+    let result = await UserM.ins.alterName(name);
+    if (result) {
+      this.setText("lbl_title_player_name", name);
+    }
+    // this.setText("lbl_title_player_name", name);
+  }
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 300 - 138
assets/resources/prefab/layer/BindGameLayer.prefab


+ 20 - 1
assets/resources/prefab/layer/BindGameLayer.ts

@@ -26,7 +26,24 @@ export class BindGameLayer
     this.FindNode("BindGameItem").active = false;
   }
 
-  private init() {}
+  private async init() {
+    await UserM.ins.refreshInfo();
+
+    let isPvzLinked: boolean = await UserM.ins.getPvzLinked();
+    this.setText(
+      "lbl_link_pvz_state",
+      "Link Status: " + (isPvzLinked ? "✅" : "❌")
+    );
+
+    if (isPvzLinked) {
+      let pvz_user_name = UserM.ins.data.gameList.find(
+        (item) => item.gameId == 1
+      )?.gameUser?.userName;
+      if (pvz_user_name != null && pvz_user_name.length > 0) {
+        this.setText("lbl_link_pvz_user_name", "@" + pvz_user_name);
+      }
+    }
+  }
 
   OnInput(gameId: number, input: string): void {
     this.startBindGame(gameId, input);
@@ -34,6 +51,8 @@ export class BindGameLayer
   async startBindGame(gameId: number, input: string) {
     let result = await GameM.ins.bindGame(gameId, input);
     if (result != null) {
+      this.init();
+
       // Tips.show("Waiting for binding...");
       // this.setText("lbl_code_banana", input);
     }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 426 - 322
assets/resources/prefab/layer/GameDetailLayer.prefab


+ 56 - 15
assets/resources/prefab/layer/GameDetailLayer.ts

@@ -12,6 +12,7 @@ import { WheelDialog } from "../play/WheelDialog";
 import UserM, {
   GameInfo,
   GameTaskInfo,
+  GiftItemInfo,
   GoodInfo,
 } from "../../scripts/api/UserM";
 import Utils from "../../scripts/utils/Utils";
@@ -25,6 +26,7 @@ import { TipsData, TipsLayer } from "./TipsLayer";
 import { GoodsId } from "../../scripts/api/GoodsId";
 import ItemsM from "../../scripts/mgr/ItemsM";
 import { RewardLayer } from "./RewardLayer";
+import { PlayGamePassReward } from "../play/PlayGamePassReward";
 const { ccclass, property } = _decorator;
 
 @ccclass("GameDetailLayer")
@@ -58,7 +60,7 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
 
   protected onLoad(): void {
     super.onLoad();
-    this.FindNode("game_pass_pvz_node").active = false;
+    // this.FindNode("game_pass_pvz_node").active = false;
   }
 
   // private spinTimes: number = 0;
@@ -75,9 +77,7 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
       this.FindNode("btn_play").active = false;
     }
 
-    if (data.gameId == 1) {
-      this.FindNode("game_pass_pvz_node").active = true;
-    }
+    this.refreshGamePassReward();
 
     if (data.gameUser != null) {
       this.setText("lbl_link_user_name", data.gameUser.userName);
@@ -113,6 +113,32 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
 
     this.refreshSpinTimes();
   }
+  async refreshGamePassReward() {
+    let giftList = this.data?.giftList;
+    let game_pass_node = this.FindNode("game_pass_reward_layout");
+    game_pass_node.removeAllChildren();
+    if (!giftList || giftList.length == 0) {
+      return;
+    }
+    let prefab = await AB.ins.loadPrefab("prefab/play/PlayGamePassReward");
+    for (let i = 0; i < giftList.length; i++) {
+      let gift: GiftItemInfo = giftList[i];
+      let item = instantiate(prefab);
+      item.parent = game_pass_node;
+      item
+        .getComponent(PlayGamePassReward)
+        .init(
+          this.data.gameId,
+          gift,
+          this.onClaimGamePassGiftSuccess.bind(this)
+        );
+    }
+  }
+  private onClaimGamePassGiftSuccess(gift: GiftItemInfo) {
+    Tips.show("Claimed successfully");
+    this.init(this.data.gameId);
+  }
+
   showButtons(c: ConfigGame) {
     this.FindNode("btn_start_game_web").active = c.webLink && c.webLink != "";
     this.FindNode("btn_start_game_tg").active = c.tgLink && c.tgLink != "";
@@ -163,6 +189,9 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
       case "btn_start_spin":
         this.startSpin();
         break;
+      case "btn_start_spin_10":
+        this.spin10times();
+        break;
 
       case "btn_start_game_web":
         ConfigM.ins.openLink(c.webLink);
@@ -173,9 +202,6 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
       case "btn_start_game_line":
         ConfigM.ins.openLink(c.lineLink);
         break;
-      case "btn_game_pass_claim_pvz":
-        Tips.show("Coming soon");
-        break;
     }
   }
   async choose10times() {
@@ -194,18 +220,20 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
     });
   }
 
+  
+
   async startSpin() {
     if (this.data.currentSpin <= 0) {
       return;
     }
 
-    if (this.data.currentSpin >= 10) {
-      let ok = await this.choose10times();
-      if (ok) {
-        this.spin10times();
-        return;
-      }
-    }
+    // if (this.data.currentSpin >= 10) {
+    //   let ok = await this.choose10times();
+    //   if (ok) {
+    //     this.spin10times();
+    //     return;
+    //   }
+    // }
 
     WheelDialog.show(this.data.gameId);
 
@@ -213,6 +241,10 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
     this.refreshSpinTimes();
   }
   async spin10times() {
+    if (this.data.currentSpin < 10) {
+      return;
+    }
+
     let loadingNode = this.FindNode("requesting_10_times");
     loadingNode.active = true;
     let onceTimes = 10;
@@ -245,7 +277,12 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
 
       let g = new GoodInfo();
       g.count = pog;
-      g.id = GoodsId.POG;
+
+      if (pog > 0) {
+        g.id = GoodsId.POG;
+      } else {
+        g.id = GoodsId.AIR;
+      }
 
       rewards.push(g);
     }
@@ -260,5 +297,9 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
     this.setText("lbl_game_spin_times", "x" + this.data.currentSpin + "");
     this.FindAs("btn_start_spin", Sprite).grayscale =
       this.data.currentSpin <= 0;
+    
+    
+    this.FindAs("btn_start_spin_10", Sprite).grayscale =
+      this.data.currentSpin < 10;
   }
 }

+ 1581 - 0
assets/resources/prefab/play/PlayGamePassReward.prefab

@@ -0,0 +1,1581 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "PlayGamePassReward",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "PlayGamePassReward",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 16
+      },
+      {
+        "__id__": 22
+      },
+      {
+        "__id__": 28
+      },
+      {
+        "__id__": 34
+      },
+      {
+        "__id__": 40
+      },
+      {
+        "__id__": 46
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 70
+      },
+      {
+        "__id__": 72
+      },
+      {
+        "__id__": 74
+      }
+    ],
+    "_prefab": {
+      "__id__": 76
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -312.11199999999997,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "bg",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 7
+      }
+    ],
+    "_prefab": {
+      "__id__": 9
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 4
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 586.794,
+      "height": 150
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "96yuSy2LJOFqJpxF8dB5jt"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 6
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "2amXPRXF5HobwzTsQd8Lcp"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 8
+    },
+    "_alignFlags": 45,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 2,
+    "_originalHeight": 100,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "8aALVUjbhCp4Xt9fAPwPqv"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "7f2HUMvepF+peMqxL7zWeL",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "title",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 11
+      },
+      {
+        "__id__": 13
+      }
+    ],
+    "_prefab": {
+      "__id__": 15
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -255.285,
+      "y": 45.28,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 10
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 12
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 245.73583984375,
+      "height": 35.5
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "1ecDGBsEJIY4paRq4Mt7g6"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 10
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 14
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "Daily Currency Drop",
+    "_horizontalAlign": 0,
+    "_verticalAlign": 1,
+    "_actualFontSize": 25,
+    "_fontSize": 25,
+    "_fontFamily": "Arial",
+    "_lineHeight": 25,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": true,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": true,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "7eP6llJlNHDrbrW9D7updL"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "77mhgWSitDwLsLhG9nQzFH",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "icon_game_pass",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 17
+      },
+      {
+        "__id__": 19
+      }
+    ],
+    "_prefab": {
+      "__id__": 21
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -228.424,
+      "y": -15.784,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 16
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 18
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 61,
+      "height": 65
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "e9eJBCrjpISbrwNiF72QWb"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 16
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 20
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "9d338c5f-2d20-4226-a2bc-7f2f7aae1cc5@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "7bJaQxehtMRoSTC/s57xyV"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "26wCIvDdZKZoAihLf/w7SG",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "line",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 23
+      },
+      {
+        "__id__": 25
+      }
+    ],
+    "_prefab": {
+      "__id__": 27
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -66.577,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 22
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 24
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 586,
+      "height": 1
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "92TuS+B7tK0r3KbC39Hyhw"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 22
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 26
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "9ae76881-2275-4c45-8a27-e446e924c7a8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "1c49WMSnFJ6LL2ICIW+q2g"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "11uuKJ/KNPKY4FG7Mxg2gz",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "lbl_game_pass_reward",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 29
+      },
+      {
+        "__id__": 31
+      }
+    ],
+    "_prefab": {
+      "__id__": 33
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -179.24999999999997,
+      "y": -0.19500000000005002,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 28
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 30
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 256.235828125,
+      "height": 25.2
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "a17m1m5IhMdp16ksI+mUKj"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 28
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 32
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "x8811111",
+    "_horizontalAlign": 0,
+    "_verticalAlign": 1,
+    "_actualFontSize": 20,
+    "_fontSize": 20,
+    "_fontFamily": "Arial",
+    "_lineHeight": 20,
+    "_overflow": 3,
+    "_enableWrapText": true,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "bewmr5vxVPg6OlXrqfQV79"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "70BrhgLrBNmKE7bz+8AmuO",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "pvz_sunshine",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 35
+      },
+      {
+        "__id__": 37
+      }
+    ],
+    "_prefab": {
+      "__id__": 39
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -160.702,
+      "y": -0.347,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 34
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 36
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 40,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "14NY1zJgZN46XTyTyfIKJO"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 34
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 38
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "c06cb59d-7618-449e-acc6-bc80b0858c85@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "b5TucpJodCc4yoSiJatiHr"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "b4g3PcF59FAapiNUKRIFMI",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "lbl_desc",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 41
+      },
+      {
+        "__id__": 43
+      }
+    ],
+    "_prefab": {
+      "__id__": 45
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -181.474,
+      "y": -36.974,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 40
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 42
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 258.4599609375,
+      "height": 22.68
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "30ploBjO5Li6ocpR286HNL"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 40
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 44
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 195,
+      "g": 195,
+      "b": 195,
+      "a": 255
+    },
+    "_string": "You can claim rewards everyday",
+    "_horizontalAlign": 0,
+    "_verticalAlign": 1,
+    "_actualFontSize": 18,
+    "_fontSize": 18,
+    "_fontFamily": "Arial",
+    "_lineHeight": 18,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "dcuLzUFj1Nr4DeZ47nFW0E"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "c26ilisthGVrP6T/b7N1Bb",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_prefab": {
+      "__id__": 47
+    },
+    "__editorExtras__": {}
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 46
+    },
+    "asset": {
+      "__uuid__": "c2e7166b-e33c-4a11-97b0-02d29cea7171",
+      "__expectedType__": "cc.Prefab"
+    },
+    "fileId": "f8jfPMKd1FBpemtSH8LaoC",
+    "instance": {
+      "__id__": 48
+    },
+    "targetOverrides": null
+  },
+  {
+    "__type__": "cc.PrefabInstance",
+    "fileId": "40Hl9N/ddI14PztpXE3h0K",
+    "prefabRootNode": {
+      "__id__": 1
+    },
+    "mountedChildren": [],
+    "mountedComponents": [
+      {
+        "__id__": 49
+      }
+    ],
+    "propertyOverrides": [
+      {
+        "__id__": 53
+      },
+      {
+        "__id__": 55
+      },
+      {
+        "__id__": 56
+      },
+      {
+        "__id__": 57
+      },
+      {
+        "__id__": 58
+      },
+      {
+        "__id__": 60
+      },
+      {
+        "__id__": 62
+      },
+      {
+        "__id__": 63
+      },
+      {
+        "__id__": 64
+      },
+      {
+        "__id__": 65
+      },
+      {
+        "__id__": 67
+      },
+      {
+        "__id__": 69
+      }
+    ],
+    "removedComponents": []
+  },
+  {
+    "__type__": "cc.MountedComponentsInfo",
+    "targetInfo": {
+      "__id__": 50
+    },
+    "components": [
+      {
+        "__id__": 51
+      }
+    ]
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "f8jfPMKd1FBpemtSH8LaoC"
+    ]
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {
+      "mountedRoot": {
+        "__id__": 46
+      }
+    },
+    "node": {
+      "__id__": 46
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 52
+    },
+    "clickEvents": [],
+    "_interactable": true,
+    "_transition": 3,
+    "_normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_hoverColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_pressedColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_normalSprite": null,
+    "_hoverSprite": null,
+    "_pressedSprite": null,
+    "_disabledSprite": null,
+    "_duration": 0.1,
+    "_zoomScale": 1.2,
+    "_target": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "36AcNg0m1Fea54+cgxaUQq"
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 54
+    },
+    "propertyPath": [
+      "_name"
+    ],
+    "value": "btn_game_pass_claim"
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "f8jfPMKd1FBpemtSH8LaoC"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 54
+    },
+    "propertyPath": [
+      "_lpos"
+    ],
+    "value": {
+      "__type__": "cc.Vec3",
+      "x": 212.635,
+      "y": -8.445,
+      "z": 0
+    }
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 54
+    },
+    "propertyPath": [
+      "_lrot"
+    ],
+    "value": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    }
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 54
+    },
+    "propertyPath": [
+      "_euler"
+    ],
+    "value": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    }
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 59
+    },
+    "propertyPath": [
+      "_string"
+    ],
+    "value": "CLAIM"
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "caxnWQxKNL15VmjGKxgYLJ"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 61
+    },
+    "propertyPath": [
+      "_contentSize"
+    ],
+    "value": {
+      "__type__": "cc.Size",
+      "width": 140,
+      "height": 64
+    }
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "56f2S38PhF/YxjmEjEprp7"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 59
+    },
+    "propertyPath": [
+      "_fontSize"
+    ],
+    "value": 25
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 59
+    },
+    "propertyPath": [
+      "_actualFontSize"
+    ],
+    "value": 25
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 59
+    },
+    "propertyPath": [
+      "_lineHeight"
+    ],
+    "value": 25
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 66
+    },
+    "propertyPath": [
+      "_contentSize"
+    ],
+    "value": {
+      "__type__": "cc.Size",
+      "width": 110,
+      "height": 31.5
+    }
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "b3UbFiih5FbbXp14M4FduU"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 68
+    },
+    "propertyPath": [
+      "_type"
+    ],
+    "value": 1
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "59EugXPYlCZoCrdpYVGQz5"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 68
+    },
+    "propertyPath": [
+      "_spriteFrame"
+    ],
+    "value": {
+      "__uuid__": "b82da5d4-9d8d-459e-9782-b27abd0d75cf@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    }
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 71
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 720,
+      "height": 150
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "63jQ7U3pFJo6VdHwWftoMb"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 73
+    },
+    "_alignFlags": 40,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 100,
+    "_originalHeight": 0,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "e1A+Ak2TdFDbTsn3N/FZBj"
+  },
+  {
+    "__type__": "d8e348lzbFNaKGUaaTjPKzd",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 75
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "03LMooE7hDU4rJ/7NsnGDG"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "d5a3qtaOxHsqYTxndmmqVE",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": [
+      {
+        "__id__": 46
+      }
+    ]
+  }
+]

+ 13 - 0
assets/resources/prefab/play/PlayGamePassReward.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "ec1b8f4e-4371-4379-b24d-641db5923dd1",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "PlayGamePassReward"
+  }
+}

+ 43 - 0
assets/resources/prefab/play/PlayGamePassReward.ts

@@ -0,0 +1,43 @@
+import { _decorator, Component, Node } from "cc";
+import BaseUI from "../../scripts/base/BaseUI";
+import UserM, { GiftItemInfo } from "../../scripts/api/UserM";
+import { Tips } from "../../scripts/mgr/Tips";
+import GameM from "../../scripts/api/GameM";
+import { GoodsId } from "../../scripts/api/GoodsId";
+const { ccclass, property } = _decorator;
+
+@ccclass("PlayGamePassReward")
+export class PlayGamePassReward extends BaseUI {
+  private data: GiftItemInfo;
+  private gameId: number;
+  private onClaimSuccess: () => void;
+  async init(gameId: number, data: GiftItemInfo, onClaimSuccess: () => void) {
+    this.data = data;
+    this.gameId = gameId;
+    this.onClaimSuccess = onClaimSuccess;
+    this.setText("lbl_game_pass_reward", this.data.rewardMsg);
+
+    this.FindNode("btn_game_pass_claim").active = this.data.canClaim > 0;
+  }
+  protected simpleOnBtnClick(name: string): void {
+    switch (name) {
+      case "btn_game_pass_claim":
+        this.requestClaimGamePassGift();
+        break;
+    }
+  }
+  async requestClaimGamePassGift() {
+    if (UserM.ins.getGamePassCount() <= 0) {
+      Tips.show("Insufficient Game Pass");
+      return;
+    }
+
+    let result = await GameM.ins.claimGamePassGift(
+      this.gameId,
+      this.data.giftId
+    );
+    if (result) {
+      this.onClaimSuccess();
+    }
+  }
+}

+ 9 - 0
assets/resources/prefab/play/PlayGamePassReward.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "d8e34f25-cdb1-4d68-a194-69a4e33cacdd",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 13 - 2
assets/resources/scripts/api/FamilyM.ts

@@ -121,8 +121,14 @@ export default class FamilyM {
     return result;
   }
 
-  async claimFamilyRewardMemberBox(familyId: string,num:number): Promise<RewardGoods> {
-    let result: RewardGoods = await WsM.ins.syncRequest(26011, { familyId ,num});
+  async claimFamilyRewardMemberBox(
+    familyId: string,
+    num: number
+  ): Promise<RewardGoods> {
+    let result: RewardGoods = await WsM.ins.syncRequest(26011, {
+      familyId,
+      num,
+    });
     if (result) {
       ItemsM.ins.itemChange(result.changeList, result.goodList);
     }
@@ -136,4 +142,9 @@ export default class FamilyM {
     }
     return result;
   }
+
+  async leaveFamily(): Promise<any> {
+    let result = await WsM.ins.syncRequest(26014, {});
+    return result;
+  }
 }

+ 7 - 0
assets/resources/scripts/api/GameM.ts

@@ -23,6 +23,13 @@ export class CritRewardResult {
   goodList: GoodInfo[];
 }
 export default class GameM {
+  async claimGamePassGift(gameId: number, giftId: number) {
+    let result = await WsM.ins.syncRequest(24007, {
+      gameId: gameId,
+      giftId: giftId,
+    });
+    return result;
+  }
   async bindGame(gameId: number, input: string) {
     let result = await WsM.ins.syncRequest(24002, {
       gameId: gameId,

+ 23 - 0
assets/resources/scripts/api/UserM.ts

@@ -27,6 +27,14 @@ export class GameTaskInfo {
   onceSpin: number;
   xp: number;
 }
+
+export class GiftItemInfo {
+  giftId: number; // 礼包id
+  giftMsg: string; // 礼包描述
+  rewardMsg: string; // 礼包奖励
+  canClaim: number; // 可以领取数量
+  haveBeenClaimed: number; // 已经领取数量
+}
 export class GameInfo {
   gameId: number;
   myRewardPog: number;
@@ -75,6 +83,21 @@ export class MyBadgeInfo {
   badgeList: BadgeInfo[];
 }
 export default class UserM {
+  async getPvzLinked(): Promise<boolean> {
+    let game = this.data?.gameList?.find((item) => item.gameId == 1);
+    if (game != null && game.gameUser != null && game.gameUser.userId != null && game.gameUser.userId.length > 0) {
+      return true;
+    }
+    return false;
+  }
+  async alterName(userName: string) {
+    let result = await WsM.ins.syncRequest(20004, { userName: userName });
+    if (result) {
+      await this.refreshInfo();
+    }
+
+    return result;
+  }
   async isLinkPvz(): Promise<boolean> {
     let game = this.data?.gameList?.find((item) => item.gameId == 1);
 

+ 6 - 6
assets/resources/scripts/mgr/PogAd.ts

@@ -27,12 +27,12 @@ export default class PogAd {
             resolve(true);
           });
 
-          // setTimeout(() => {
-          //   if (success) {
-          //     return;
-          //   }
-          //   resolve(false);
-          // }, 3000);
+          setTimeout(() => {
+            if (success) {
+              return;
+            }
+            resolve(false);
+          }, 40*1000);
         });
       }
     }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است