Explorar o código

页面调整与优化

kob hai 1 mes
pai
achega
07f1c13bcb
Modificáronse 27 ficheiros con 2318 adicións e 487 borrados
  1. 806 84
      assets/lobbyRes/ui/mail/Mail.prefab
  2. 8 8
      assets/lobbyRes/ui/mail/MailItem.prefab
  3. 322 17
      assets/lobbyRes/ui/userInfo/ChangeAvatar.prefab
  4. 322 17
      assets/lobbyRes/ui/userInfo/ChangeName.prefab
  5. 323 144
      assets/lobbyRes/ui/userInfo/UserInfoView.prefab
  6. 13 0
      assets/scripts/api/ApiHelper.ts
  7. 1 0
      assets/scripts/components/button/OTPButton.ts
  8. 28 12
      assets/scripts/modules/lobby/ui/CheckInView/CheckInView.ts
  9. 34 0
      assets/scripts/modules/lobby/ui/Mail/Mail.ts
  10. 42 23
      assets/scripts/modules/lobby/ui/Mail/MailDetail.ts
  11. 2 2
      assets/scripts/modules/lobby/ui/Mail/MailItem.ts
  12. 37 12
      assets/scripts/modules/lobby/ui/SeasonPassView/Prize/NodeItem.ts
  13. 6 0
      assets/scripts/modules/lobby/ui/SeasonPassView/SeasonPassPurchase.ts
  14. 2 2
      assets/scripts/modules/lobby/ui/SeasonPassView/SeasonPassView.ts
  15. 18 6
      assets/scripts/modules/lobby/ui/SeasonPassView/Tasks/RewardItem.ts
  16. 25 14
      assets/scripts/modules/lobby/ui/UserInfoView/BindEmail.ts
  17. 25 15
      assets/scripts/modules/lobby/ui/UserInfoView/BindPhone.ts
  18. 25 1
      assets/scripts/modules/lobby/ui/UserInfoView/ChangeAvatar.ts
  19. 25 17
      assets/scripts/modules/lobby/ui/UserInfoView/ChangeEmail.ts
  20. 34 5
      assets/scripts/modules/lobby/ui/UserInfoView/ChangeName.ts
  21. 27 16
      assets/scripts/modules/lobby/ui/UserInfoView/ChangePhone.ts
  22. 23 12
      assets/scripts/modules/lobby/ui/UserInfoView/UnbindAccount.ts
  23. 44 7
      assets/scripts/modules/lobby/ui/UserInfoView/UserInfoView.ts
  24. 2 0
      assets/scripts/modules/lobby/ui/WeeklyPassView/WeeklyPassView.ts
  25. 19 39
      assets/scripts/store/mailStore/MailStore.ts
  26. 12 18
      assets/scripts/store/mainStore/MainStore.ts
  27. 93 16
      assets/scripts/utils/Helper.ts

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 806 - 84
assets/lobbyRes/ui/mail/Mail.prefab


+ 8 - 8
assets/lobbyRes/ui/mail/MailItem.prefab

@@ -1206,7 +1206,7 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 224.94140625,
+      "width": 311.6953125,
       "height": 30.240000000000002
       "height": 30.240000000000002
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
@@ -1243,13 +1243,13 @@
       "a": 255
       "a": 255
     },
     },
     "_string": "Royal Welcome Gift",
     "_string": "Royal Welcome Gift",
-    "_horizontalAlign": 1,
+    "_horizontalAlign": 0,
     "_verticalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 24,
+    "_actualFontSize": 25,
     "_fontSize": 24,
     "_fontSize": 24,
     "_fontFamily": "Arial",
     "_fontFamily": "Arial",
     "_lineHeight": 24,
     "_lineHeight": 24,
-    "_overflow": 0,
+    "_overflow": 2,
     "_enableWrapText": true,
     "_enableWrapText": true,
     "_font": null,
     "_font": null,
     "_isSystemFontUsed": true,
     "_isSystemFontUsed": true,
@@ -1365,7 +1365,7 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 265.703125,
+      "width": 310.1953125,
       "height": 25.2
       "height": 25.2
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
@@ -1402,13 +1402,13 @@
       "a": 255
       "a": 255
     },
     },
     "_string": "Lucky Rewards   08-27-2026",
     "_string": "Lucky Rewards   08-27-2026",
-    "_horizontalAlign": 1,
+    "_horizontalAlign": 0,
     "_verticalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 20,
+    "_actualFontSize": 21,
     "_fontSize": 20,
     "_fontSize": 20,
     "_fontFamily": "Arial",
     "_fontFamily": "Arial",
     "_lineHeight": 20,
     "_lineHeight": 20,
-    "_overflow": 0,
+    "_overflow": 2,
     "_enableWrapText": true,
     "_enableWrapText": true,
     "_font": null,
     "_font": null,
     "_isSystemFontUsed": true,
     "_isSystemFontUsed": true,

+ 322 - 17
assets/lobbyRes/ui/userInfo/ChangeAvatar.prefab

@@ -28,20 +28,20 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 68
+        "__id__": 80
       },
       },
       {
       {
-        "__id__": 70
+        "__id__": 82
       },
       },
       {
       {
-        "__id__": 72
+        "__id__": 84
       },
       },
       {
       {
-        "__id__": 74
+        "__id__": 86
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 76
+      "__id__": 88
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -143,7 +143,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1624,
       "width": 1624,
-      "height": 749.9999999999999
+      "height": 750
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -292,19 +292,22 @@
       },
       },
       {
       {
         "__id__": 51
         "__id__": 51
+      },
+      {
+        "__id__": 63
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 63
+        "__id__": 75
       },
       },
       {
       {
-        "__id__": 65
+        "__id__": 77
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 67
+      "__id__": 79
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -1506,22 +1509,321 @@
     "targetOverrides": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
     "nestedPrefabInstanceRoots": null
   },
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "btn_grey",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 12
+    },
+    "_children": [
+      {
+        "__id__": 64
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 70
+      },
+      {
+        "__id__": 72
+      }
+    ],
+    "_prefab": {
+      "__id__": 74
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -7,
+      "y": -236.955,
+      "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": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 63
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 65
+      },
+      {
+        "__id__": 67
+      }
+    ],
+    "_prefab": {
+      "__id__": 69
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 2.671,
+      "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": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
   {
   {
     "__type__": "cc.UITransform",
     "__type__": "cc.UITransform",
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 12
+      "__id__": 64
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
+      "__id__": 66
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 155.3125,
+      "height": 46.32
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "7brwAjdjFMwZ05sxOR/zzt"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
       "__id__": 64
       "__id__": 64
     },
     },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 68
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "CONFIRM",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 32,
+    "_fontSize": 32,
+    "_fontFamily": "Arial",
+    "_lineHeight": 32,
+    "_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": 50,
+      "g": 47,
+      "b": 47,
+      "a": 255
+    },
+    "_outlineWidth": 3,
+    "_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": "3cajX926dCUpcC1aN+5l8s"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "b9AfAjM4NOrrwIqZuqWppA",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 63
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 71
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 334,
+      "height": 94
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "68UOfSviJDaYYDsqtwL+j2"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 63
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 73
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "152d8443-b30b-48b0-85e3-92dd87898c8d@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "63eZo34TVPIKFJ27d1I163"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "35/QNhiFJLG7MPNrLeIVhE",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 76
+    },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1624,
       "width": 1624,
-      "height": 749.9999999999999
+      "height": 750
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -1544,7 +1846,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 66
+      "__id__": 78
     },
     },
     "_alignFlags": 45,
     "_alignFlags": 45,
     "_target": null,
     "_target": null,
@@ -1593,12 +1895,12 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 69
+      "__id__": 81
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1624,
       "width": 1624,
-      "height": 749.9999999999999
+      "height": 750
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -1621,7 +1923,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 71
+      "__id__": 83
     },
     },
     "_alignFlags": 45,
     "_alignFlags": 45,
     "_target": null,
     "_target": null,
@@ -1657,7 +1959,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 73
+      "__id__": 85
     },
     },
     "_id": ""
     "_id": ""
   },
   },
@@ -1675,7 +1977,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 75
+      "__id__": 87
     },
     },
     "popupMask": {
     "popupMask": {
       "__id__": 9
       "__id__": 9
@@ -1689,6 +1991,9 @@
     "btn_confirm": {
     "btn_confirm": {
       "__id__": 51
       "__id__": 51
     },
     },
+    "btn_grey": {
+      "__id__": 63
+    },
     "item_avatar": {
     "item_avatar": {
       "__id__": 27
       "__id__": 27
     },
     },

+ 322 - 17
assets/lobbyRes/ui/userInfo/ChangeName.prefab

@@ -28,20 +28,20 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 88
+        "__id__": 100
       },
       },
       {
       {
-        "__id__": 90
+        "__id__": 102
       },
       },
       {
       {
-        "__id__": 92
+        "__id__": 104
       },
       },
       {
       {
-        "__id__": 94
+        "__id__": 106
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 96
+      "__id__": 108
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -143,7 +143,7 @@
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1624,
       "width": 1624,
-      "height": 749.9999999999999
+      "height": 750
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -289,19 +289,22 @@
       },
       },
       {
       {
         "__id__": 71
         "__id__": 71
+      },
+      {
+        "__id__": 83
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 83
+        "__id__": 95
       },
       },
       {
       {
-        "__id__": 85
+        "__id__": 97
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 87
+      "__id__": 99
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -2039,22 +2042,321 @@
     "targetOverrides": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
     "nestedPrefabInstanceRoots": null
   },
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "btn_grey",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 12
+    },
+    "_children": [
+      {
+        "__id__": 84
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 90
+      },
+      {
+        "__id__": 92
+      }
+    ],
+    "_prefab": {
+      "__id__": 94
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -8,
+      "y": -155.314,
+      "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": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 83
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 85
+      },
+      {
+        "__id__": 87
+      }
+    ],
+    "_prefab": {
+      "__id__": 89
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 2.671,
+      "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": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
   {
   {
     "__type__": "cc.UITransform",
     "__type__": "cc.UITransform",
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 12
+      "__id__": 84
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
+      "__id__": 86
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 155.3125,
+      "height": 46.32
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "e2ZjHJpdZMIZSpjeUBgrWU"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
       "__id__": 84
       "__id__": 84
     },
     },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 88
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "CONFIRM",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 32,
+    "_fontSize": 32,
+    "_fontFamily": "Arial",
+    "_lineHeight": 32,
+    "_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": 50,
+      "g": 47,
+      "b": 47,
+      "a": 255
+    },
+    "_outlineWidth": 3,
+    "_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": "f39hA198VLLZjy+4+vwtx9"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "eaZtSn9AVP+6L3VtOsWTbj",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 83
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 91
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 334,
+      "height": 94
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "44KHhZjbtIaJuZx5GBluai"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 83
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 93
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "152d8443-b30b-48b0-85e3-92dd87898c8d@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "a5AycfT4dLRaIy1Nq1x5g9"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "29PobCtY9OUoOrTNYgB56o",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 96
+    },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1624,
       "width": 1624,
-      "height": 749.9999999999999
+      "height": 750
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -2077,7 +2379,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 86
+      "__id__": 98
     },
     },
     "_alignFlags": 45,
     "_alignFlags": 45,
     "_target": null,
     "_target": null,
@@ -2126,12 +2428,12 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 89
+      "__id__": 101
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
       "width": 1624,
       "width": 1624,
-      "height": 749.9999999999999
+      "height": 750
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -2154,7 +2456,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 91
+      "__id__": 103
     },
     },
     "_alignFlags": 45,
     "_alignFlags": 45,
     "_target": null,
     "_target": null,
@@ -2190,7 +2492,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 93
+      "__id__": 105
     },
     },
     "_id": ""
     "_id": ""
   },
   },
@@ -2208,7 +2510,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 95
+      "__id__": 107
     },
     },
     "popupMask": {
     "popupMask": {
       "__id__": 9
       "__id__": 9
@@ -2222,6 +2524,9 @@
     "btn_confirm": {
     "btn_confirm": {
       "__id__": 71
       "__id__": 71
     },
     },
+    "btn_grey": {
+      "__id__": 83
+    },
     "nickname": {
     "nickname": {
       "__id__": 38
       "__id__": 38
     },
     },

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 323 - 144
assets/lobbyRes/ui/userInfo/UserInfoView.prefab


+ 13 - 0
assets/scripts/api/ApiHelper.ts

@@ -21,6 +21,19 @@ export function getHttpMsg(data) {
     return result;
     return result;
 }
 }
 
 
+export async function handleResMsg(res, callback?: () => Promise<void> | void) {
+    if (success(res)) {
+        if (callback) {
+            await callback();
+        }
+        return true;
+    } else if (res?.code === 301) {
+        const msg = res?.msg || "";
+        if (msg) AppKernel.ui.toast(msg);
+    }
+    return false;
+}
+
 
 
 export const success = (res: ApiEnvelope) => {
 export const success = (res: ApiEnvelope) => {
     return res && (res.code === 0 || res.code === 200);
     return res && (res.code === 0 || res.code === 200);

+ 1 - 0
assets/scripts/components/button/OTPButton.ts

@@ -51,6 +51,7 @@ export class OTPButton extends Component {
 
 
     protected onEnable(): void {
     protected onEnable(): void {
         this.updateBtnStatus();
         this.updateBtnStatus();
+        this.handleTextChanged();
     }
     }
 
 
     private async onSendCode() {
     private async onSendCode() {

+ 28 - 12
assets/scripts/modules/lobby/ui/CheckInView/CheckInView.ts

@@ -3,7 +3,7 @@ import { UIView } from '@scripts/framework/ui/UIView';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UICloseReason } from '@scripts/framework/ui/UILayer';
 import { UICloseReason } from '@scripts/framework/ui/UILayer';
-import { formatCurrency } from '@scripts/utils/Helper';
+import { formatCurrency, formatNumShort } from '@scripts/utils/Helper';
 import { addBtnClick } from '@scripts/utils/UIHelper';
 import { addBtnClick } from '@scripts/utils/UIHelper';
 import { setSpriteFrame } from '@scripts/utils/ResHelper';
 import { setSpriteFrame } from '@scripts/utils/ResHelper';
 
 
@@ -56,11 +56,11 @@ export class CheckInView extends UIView {
   }
   }
 
 
   protected onDestroy(): void {
   protected onDestroy(): void {
-    AppKernel.events.off('checkIn:update', this.updateCheckInView, this);
+    // AppKernel.events.off('checkIn:update', this.updateCheckInView, this);
     super.onDestroy();
     super.onDestroy();
   }
   }
 
 
- 
+
 
 
   private updateCheckInView() {
   private updateCheckInView() {
     this._checkInData = AppKernel.stores.checkInStore.checkInData;
     this._checkInData = AppKernel.stores.checkInStore.checkInData;
@@ -128,7 +128,12 @@ export class CheckInView extends UIView {
         }
         }
 
 
         const num = reward.getChildByName('num');
         const num = reward.getChildByName('num');
-        num.getComponent(Label).string = `${(Number(val) / 100).toFixed(2)}`;
+        // num.getComponent(Label).string = `${(Number(val) / 100).toFixed(2)}`;
+        if (key == "sc" || key == "gc") {
+          num.getComponent(Label).string = formatNumShort(String(val), 999);
+        } else {
+          num.getComponent(Label).string = formatNumShort(String(val), 999, 1);
+        }
 
 
 
 
         if (!isLastDay) rewards_layout.spacingX = rewardsNums > 2 ? 5 : 40;
         if (!isLastDay) rewards_layout.spacingX = rewardsNums > 2 ? 5 : 40;
@@ -174,19 +179,30 @@ export class CheckInView extends UIView {
     uiOpacity.opacity = 255; // 恢复不透明
     uiOpacity.opacity = 255; // 恢复不透明
   }
   }
 
 
+  private _claiming = false;
   async onDayClick(index: number) {
   async onDayClick(index: number) {
-    const { final_reward: reward, status } = this._checkInData.days[index];
-    console.log('onDayClick', index, 'reward', reward, 'status', status);
-    if (!reward || status != "claimable") return;
+    if (this._claiming) return;
+    this._claiming = true;
+    AppKernel.ui.loading(true);
+
+    try {
+      const { final_reward: reward, status } = this._checkInData.days[index];
+      console.log('onDayClick', index, 'reward', reward, 'status', status);
+      if (!reward || status != "claimable") return;
+
+      const checkInStore = AppKernel.stores.checkInStore;
+      const res = await checkInStore.reqCheckIn(index + 1);
+      if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+      //  AppKernel.ui.open(UIViewID.RewardView, { reward });
+    } finally {
+      this._claiming = false;
+      AppKernel.ui.loading(false);
+    }
 
 
-    const checkInStore = AppKernel.stores.checkInStore;
-    const res = await checkInStore.reqCheckIn(index + 1);
-    if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
-    //  AppKernel.ui.open(UIViewID.RewardView, { reward });
   }
   }
 
 
   private onBtnViewClubClick() {
   private onBtnViewClubClick() {
-
+    AppKernel.ui.open(UIViewID.ClubView);
   }
   }
 
 
 }
 }

+ 34 - 0
assets/scripts/modules/lobby/ui/Mail/Mail.ts

@@ -6,6 +6,7 @@ const { ccclass, property } = _decorator;
 import { UIPopup } from '@scripts/framework/ui/UIPopup';
 import { UIPopup } from '@scripts/framework/ui/UIPopup';
 import { MailItem } from './MailItem';
 import { MailItem } from './MailItem';
 import VirtualList from '@scripts/components/virtualList/VirtualList';
 import VirtualList from '@scripts/components/virtualList/VirtualList';
+import { parseMailRewardStr } from '@scripts/utils/Helper';
 
 
 @ccclass('Mail')
 @ccclass('Mail')
 export class Mail extends UIPopup {
 export class Mail extends UIPopup {
@@ -17,9 +18,15 @@ export class Mail extends UIPopup {
     @property(Node)
     @property(Node)
     private btn_deleteAll: Node = null;
     private btn_deleteAll: Node = null;
 
 
+    @property(Node)
+    private btn_deleteAll_grey: Node = null;
+
     @property(Node)
     @property(Node)
     private btn_claimAll: Node = null;
     private btn_claimAll: Node = null;
 
 
+    @property(Node)
+    private btn_claimAll_grey: Node = null;
+
     @property(VirtualList)
     @property(VirtualList)
     private scrollView: VirtualList = null;
     private scrollView: VirtualList = null;
 
 
@@ -41,6 +48,7 @@ export class Mail extends UIPopup {
     protected onOpen(): void | Promise<void> {
     protected onOpen(): void | Promise<void> {
         const list = this._store.mailList ?? [];
         const list = this._store.mailList ?? [];
         this.scrollView.numItems = list.length;
         this.scrollView.numItems = list.length;
+        this.updateBtnState();
     }
     }
 
 
     onRenderMailItem(item: Node, index: number) {
     onRenderMailItem(item: Node, index: number) {
@@ -53,10 +61,36 @@ export class Mail extends UIPopup {
 
 
     private updateMailItems() {
     private updateMailItems() {
         console.log('updateMailItems');
         console.log('updateMailItems');
+        this.updateBtnState();
         this.scrollView.numItems = this._store.mailList.length;
         this.scrollView.numItems = this._store.mailList.length;
         if (this.scrollView.checkInited(false)) this.scrollView.updateAll();
         if (this.scrollView.checkInited(false)) this.scrollView.updateAll();
     }
     }
 
 
+    private updateBtnState() {
+        const list = this._store.mailList ?? [];
+        let canClaimAll = false;
+        let canDeleteAll = false;
+        list?.forEach((mailData) => {
+            const mailStatus = mailData?.MailStatus;
+            const bonusString = mailData?.BonusString;
+            const rewards = parseMailRewardStr(bonusString);
+            const hasReward = rewards.length > 0;
+            if (!canClaimAll) canClaimAll = mailStatus <= 2 && hasReward;
+
+            const hasNorRead = !hasReward && mailStatus >= 2;
+            const hasRewRead = hasReward && mailStatus >= 3;
+
+            if (!canDeleteAll) canDeleteAll = hasNorRead || hasRewRead;
+
+        });
+        this.btn_claimAll.active = canClaimAll;
+        this.btn_claimAll_grey.active = !canClaimAll;
+
+        this.btn_deleteAll.active = canDeleteAll;
+        this.btn_deleteAll_grey.active = !canDeleteAll;
+
+    }
+
     private onBtnCloseClick() {
     private onBtnCloseClick() {
         AppKernel.ui.close(UIViewID.Mail);
         AppKernel.ui.close(UIViewID.Mail);
     }
     }

+ 42 - 23
assets/scripts/modules/lobby/ui/Mail/MailDetail.ts

@@ -5,7 +5,7 @@ import { addBtnClick } from '@scripts/utils/UIHelper';
 import { _decorator, Button, Component, Label, Node } from 'cc';
 import { _decorator, Button, Component, Label, Node } from 'cc';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 import { UIPopup } from '@scripts/framework/ui/UIPopup';
 import { UIPopup } from '@scripts/framework/ui/UIPopup';
-import { formatMailTimeToMMDDYYYY, parseMailRewardStr } from '@scripts/utils/Helper';
+import { formatMailTimeToMMDDYYYY, formatNumShort, parseMailRewardStr } from '@scripts/utils/Helper';
 
 
 @ccclass('MailDetail')
 @ccclass('MailDetail')
 export class MailDetail extends UIPopup {
 export class MailDetail extends UIPopup {
@@ -96,7 +96,7 @@ export class MailDetail extends UIPopup {
                     : this.reward_layout.getChildByName("gc")
                     : this.reward_layout.getChildByName("gc")
 
 
                 const num = node.getChildByName("num");
                 const num = node.getChildByName("num");
-                num.getComponent(Label).string = item?.reward;
+                num.getComponent(Label).string = formatNumShort(item?.reward, 999, 1);
                 node.active = true;
                 node.active = true;
             })
             })
         }
         }
@@ -109,32 +109,51 @@ export class MailDetail extends UIPopup {
         AppKernel.ui.close(UIViewID.MailDetail);
         AppKernel.ui.close(UIViewID.MailDetail);
     }
     }
 
 
+    private _deleting = false;
     private async onBtnDeleteClick() {
     private async onBtnDeleteClick() {
-        const { MailStatus, MailID, BonusString } = this._mailData;
-        const { mailStore } = AppKernel.stores;
-
-        const rewards = parseMailRewardStr(BonusString);
-        const hasReward = rewards.length > 0;
-        console.log("handleMailDelete", MailID);
-        if (hasReward && MailStatus < "3") return;
-        
-        await mailStore.reqMailDelete(MailID);
-        mailStore.reqMailList();
-        this.onBtnCloseClick();
+        if (this._deleting) return;
+        this._deleting = true;
+        AppKernel.ui.loading(true);
+        try {
+            const { MailStatus, MailID, BonusString } = this._mailData;
+            const { mailStore } = AppKernel.stores;
+
+            const rewards = parseMailRewardStr(BonusString);
+            const hasReward = rewards.length > 0;
+            console.log("handleMailDelete", MailID);
+            if (hasReward && MailStatus < "3") return;
+
+            await mailStore.reqMailDelete(MailID);
+            mailStore.reqMailList();
+            this.onBtnCloseClick();
+        } finally {
+            AppKernel.ui.loading(false);
+            this._deleting = false;
+        }
     }
     }
 
 
+    private _claiming = false;
     private async onBtnClaimClick() {
     private async onBtnClaimClick() {
-        const { MailStatus, MailID, BonusString } = this._mailData;
-        const { mailStore } = AppKernel.stores;
-
-        const rewards = parseMailRewardStr(BonusString);
-        const hasReward = rewards.length > 0;
-        console.log("handleMailClaim", MailID);
-        if (hasReward && MailStatus < "3") {
-            await mailStore.reqMailTake(MailID);
-            mailStore.reqMailList();
+        if (this._claiming) return;
+        this._claiming = true;
+        AppKernel.ui.loading(true);
+        try {
+            const { MailStatus, MailID, BonusString } = this._mailData;
+            const { mailStore } = AppKernel.stores;
+
+            const rewards = parseMailRewardStr(BonusString);
+            const hasReward = rewards.length > 0;
+            console.log("handleMailClaim", MailID);
+            if (hasReward && MailStatus < "3") {
+                await mailStore.reqMailTake(MailID);
+                mailStore.reqMailList();
+            }
+            this.onBtnCloseClick();
+
+        } finally {
+            AppKernel.ui.loading(false);
+            this._claiming = false;
         }
         }
-        this.onBtnCloseClick();
     }
     }
 
 
 
 

+ 2 - 2
assets/scripts/modules/lobby/ui/Mail/MailItem.ts

@@ -1,7 +1,7 @@
 import { AppKernel } from '@scripts/app/AppKernel';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIView } from '@scripts/framework/ui/UIView';
 import { UIView } from '@scripts/framework/ui/UIView';
-import { formatMailTimeToMMDDYYYY, parseMailRewardStr } from '@scripts/utils/Helper';
+import { formatMailTimeToMMDDYYYY, formatNumShort, parseMailRewardStr } from '@scripts/utils/Helper';
 import { addBtnClick, removeBtnClick } from '@scripts/utils/UIHelper';
 import { addBtnClick, removeBtnClick } from '@scripts/utils/UIHelper';
 import { _decorator, Button, Component, instantiate, Label, Node, UIOpacity } from 'cc';
 import { _decorator, Button, Component, instantiate, Label, Node, UIOpacity } from 'cc';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
@@ -68,7 +68,7 @@ export class MailItem extends Component {
                 item?.type == "30000" ? this.item_sc : this.item_gc
                 item?.type == "30000" ? this.item_sc : this.item_gc
             );
             );
             const num = node.getChildByName("num");
             const num = node.getChildByName("num");
-            num.getComponent(Label).string = item?.reward;
+            num.getComponent(Label).string = formatNumShort(item?.reward, 999, 1);
 
 
             node.active = true;
             node.active = true;
             node.parent = this.reward_layout;
             node.parent = this.reward_layout;

+ 37 - 12
assets/scripts/modules/lobby/ui/SeasonPassView/Prize/NodeItem.ts

@@ -1,7 +1,7 @@
 import { AppKernel } from '@scripts/app/AppKernel';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIView } from '@scripts/framework/ui/UIView';
 import { UIView } from '@scripts/framework/ui/UIView';
-import { formatMailTimeToMMDDYYYY, parseMailRewardStr } from '@scripts/utils/Helper';
+import { formatMailTimeToMMDDYYYY, formatNumShort, parseMailRewardStr } from '@scripts/utils/Helper';
 import { addBtnClick, removeBtnClick } from '@scripts/utils/UIHelper';
 import { addBtnClick, removeBtnClick } from '@scripts/utils/UIHelper';
 import { _decorator, Button, Component, Enum, instantiate, Label, Node, NodePool, Prefab, ProgressBar, Sprite, SpriteFrame, tween, UIOpacity } from 'cc';
 import { _decorator, Button, Component, Enum, instantiate, Label, Node, NodePool, Prefab, ProgressBar, Sprite, SpriteFrame, tween, UIOpacity } from 'cc';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
@@ -77,9 +77,11 @@ export class NodeItem extends Component {
             const num = item.getChildByName('num');
             const num = item.getChildByName('num');
             const label = num.getComponent(Label);
             const label = num.getComponent(Label);
             if (key == "sc" || key == "gc") {
             if (key == "sc" || key == "gc") {
-                label.string = `${(Number(val) / 100).toFixed(2)}`;
+                // label.string = `${(Number(val) / 100).toFixed(2)}`;
+                label.string = formatNumShort(String(val), 999);
             } else {
             } else {
-                label.string = `${val}`;
+                // label.string = `${val}`;
+                label.string = formatNumShort(String(val), 999, 1);
             }
             }
         }
         }
 
 
@@ -118,9 +120,11 @@ export class NodeItem extends Component {
             const num = item.getChildByName('num');
             const num = item.getChildByName('num');
             const label = num.getComponent(Label);
             const label = num.getComponent(Label);
             if (key == "sc" || key == "gc") {
             if (key == "sc" || key == "gc") {
-                label.string = `${(Number(val) / 100).toFixed(2)}`;
+                // label.string = `${(Number(val) / 100).toFixed(2)}`;
+                label.string = formatNumShort(String(val), 999);
             } else {
             } else {
-                label.string = `${val}`;
+                // label.string = `${val}`;
+                label.string = formatNumShort(String(val), 999, 1);
             }
             }
         }
         }
 
 
@@ -155,17 +159,38 @@ export class NodeItem extends Component {
     }
     }
 
 
 
 
-
+    private _dlxClaiming = false;
     private async onDlxBtnClick() {
     private async onDlxBtnClick() {
-        const { reward_id, reward } = this._data?.node?.deluxe ?? {};
-        const res = await AppKernel.stores.seasonPassStore.reqSeasonPassPrizeClaim(reward_id);
-        if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+        if (this._dlxClaiming) return;
+        this._dlxClaiming = true;
+        AppKernel.ui.loading(true);
+
+        try {
+            const { reward_id, reward } = this._data?.node?.deluxe ?? {};
+            const res = await AppKernel.stores.seasonPassStore.reqSeasonPassPrizeClaim(reward_id);
+            if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+        } finally {
+            AppKernel.ui.loading(false);
+            this._dlxClaiming = false;
+        }
+
     }
     }
 
 
+    private _freeClaiming = false;
     private async onFreeBtnClick() {
     private async onFreeBtnClick() {
-        const { reward_id, reward } = this._data?.node?.free ?? {};
-        const res = await AppKernel.stores.seasonPassStore.reqSeasonPassPrizeClaim(reward_id);
-        if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+        if (this._freeClaiming) return;
+        this._freeClaiming = true;
+        AppKernel.ui.loading(true);
+
+        try {
+            const { reward_id, reward } = this._data?.node?.free ?? {};
+            const res = await AppKernel.stores.seasonPassStore.reqSeasonPassPrizeClaim(reward_id);
+            if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+        } finally {
+            AppKernel.ui.loading(false);
+            this._freeClaiming = false;
+        }
+
     }
     }
 
 
 
 

+ 6 - 0
assets/scripts/modules/lobby/ui/SeasonPassView/SeasonPassPurchase.ts

@@ -27,6 +27,7 @@ export class SeasonPassPurchase extends UIPopup {
 
 
 
 
   protected onCreate(): void | Promise<void> {
   protected onCreate(): void | Promise<void> {
+    AppKernel.events.on("hall:pay-finished", this.handlePayFinished, this);
     addBtnClick(this.btn_close, this.onBtnCloseClick, this);
     addBtnClick(this.btn_close, this.onBtnCloseClick, this);
     addBtnClick(this.btn_buy, this.onBtnBuyClick, this);
     addBtnClick(this.btn_buy, this.onBtnBuyClick, this);
   }
   }
@@ -42,6 +43,11 @@ export class SeasonPassPurchase extends UIPopup {
 
 
   }
   }
 
 
+    private handlePayFinished() {
+      AppKernel.stores.seasonPassStore.reqSeasonPassInfo();
+      this.closeSelf();
+    }
+
   private formatGoods(goods: any) {
   private formatGoods(goods: any) {
     goods.gears = JSON.parse(goods.gear);
     goods.gears = JSON.parse(goods.gear);
     goods.cp = Number(goods.cp);
     goods.cp = Number(goods.cp);

+ 2 - 2
assets/scripts/modules/lobby/ui/SeasonPassView/SeasonPassView.ts

@@ -289,8 +289,8 @@ export class SeasonPassView extends UIView {
     this._seasonalItemPool.clear();
     this._seasonalItemPool.clear();
     this.stopAllTimer();
     this.stopAllTimer();
 
 
-    AppKernel.events.off('seasonPass:update', this.updateSeasonPassView, this);
-    AppKernel.events.off('checkIn:update', this.handleCheckInUpdate, this);
+    // AppKernel.events.off('seasonPass:update', this.updateSeasonPassView, this);
+    // AppKernel.events.off('checkIn:update', this.handleCheckInUpdate, this);
 
 
     super.onDestroy();
     super.onDestroy();
   }
   }

+ 18 - 6
assets/scripts/modules/lobby/ui/SeasonPassView/Tasks/RewardItem.ts

@@ -1,7 +1,7 @@
 import { AppKernel } from '@scripts/app/AppKernel';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIView } from '@scripts/framework/ui/UIView';
 import { UIView } from '@scripts/framework/ui/UIView';
-import { formatMailTimeToMMDDYYYY, parseMailRewardStr } from '@scripts/utils/Helper';
+import { formatMailTimeToMMDDYYYY, formatNumShort, parseMailRewardStr } from '@scripts/utils/Helper';
 import { setOriginalSp, setSpriteFrame } from '@scripts/utils/ResHelper';
 import { setOriginalSp, setSpriteFrame } from '@scripts/utils/ResHelper';
 import { addBtnClick, removeBtnClick } from '@scripts/utils/UIHelper';
 import { addBtnClick, removeBtnClick } from '@scripts/utils/UIHelper';
 import { _decorator, Button, Component, Enum, instantiate, Label, Node, NodePool, Prefab, ProgressBar, Sprite, UIOpacity, UITransform } from 'cc';
 import { _decorator, Button, Component, Enum, instantiate, Label, Node, NodePool, Prefab, ProgressBar, Sprite, UIOpacity, UITransform } from 'cc';
@@ -123,9 +123,11 @@ export class RewardItem extends Component {
             const num = item.getChildByName('num');
             const num = item.getChildByName('num');
             const label = num.getComponent(Label);
             const label = num.getComponent(Label);
             if (key == "sc" || key == "gc") {
             if (key == "sc" || key == "gc") {
-                label.string = `${(Number(val) / 100).toFixed(2)}`;
+                // label.string = `${(Number(val) / 100).toFixed(2)}`;
+                label.string = formatNumShort(String(val), 999);
             } else {
             } else {
-                label.string = `${val}`;
+                // label.string = `${val}`;
+                label.string = formatNumShort(String(val), 999, 1);
             }
             }
         }
         }
 
 
@@ -159,10 +161,20 @@ export class RewardItem extends Component {
         }
         }
     }
     }
 
 
+    private _claiming = false;
     async handleBtnClaimClick() {
     async handleBtnClaimClick() {
-        const { id: task_id, reward } = this._data;
-        const res = await AppKernel.stores.seasonPassStore.reqSeasonPassTasksClaim(task_id);
-        if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+        if (this._claiming) return;
+        this._claiming = true;
+        AppKernel.ui.loading(true);
+
+        try {
+            const { id: task_id, reward } = this._data;
+            const res = await AppKernel.stores.seasonPassStore.reqSeasonPassTasksClaim(task_id);
+            if (res) AppKernel.ui.open(UIViewID.RewardView, { reward });
+        } finally {
+            AppKernel.ui.loading(false);
+            this._claiming = false;
+        }
     }
     }
 
 
     handleBtnClaimedClick() {
     handleBtnClaimedClick() {

+ 25 - 14
assets/scripts/modules/lobby/ui/UserInfoView/BindEmail.ts

@@ -55,30 +55,41 @@ export class BindEmail extends UIPopup {
     const hasPsd = isGuest ? false : true;
     const hasPsd = isGuest ? false : true;
     this.psd_label.string = hasPsd ? 'Current Password' : 'Set Password';
     this.psd_label.string = hasPsd ? 'Current Password' : 'Set Password';
     this.psd.placeholder = hasPsd ? 'Current Password' : 'Set Password';
     this.psd.placeholder = hasPsd ? 'Current Password' : 'Set Password';
+
+    this.onTextChanged(); //初始化按钮状态
   }
   }
 
 
   private onBtnCloseClick() {
   private onBtnCloseClick() {
     AppKernel.ui.close(UIViewID.BindEmail);
     AppKernel.ui.close(UIViewID.BindEmail);
   }
   }
 
 
+  private _clicking = false;
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
-    const email = this.new_email.string;
-    const pwd = this.psd.string;
-    const code = this.verify_code.string;
-    const isReady = !!email && !!pwd && !!code;
-    if (!isReady) return;
-
-    const res = await AppKernel.stores.mailStore.reqBindEmailConfirm({
-      account: email,
-      password: pwd,
-      code: code
-    });
-    if (res) {
-      await AppKernel.ui.close(UIViewID.BindEmail);
-      AppKernel.ui.toast("Bind success");
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+    try {
+      const email = this.new_email.string;
+      const pwd = this.psd.string;
+      const code = this.verify_code.string;
+      const isReady = !!email && !!pwd && !!code;
+      if (!isReady) return;
+      const res = await AppKernel.stores.mailStore.reqBindEmailConfirm({
+        account: email,
+        password: pwd,
+        code: code
+      });
+      if (res) {
+        await AppKernel.ui.close(UIViewID.BindEmail);
+        AppKernel.ui.toast("Bind success");
+      }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
   }
   }
 
 
+
   private onTextChanged() {
   private onTextChanged() {
     const isReady = !!this._new_email && !!this._psd && !!this._verify_code;
     const isReady = !!this._new_email && !!this._psd && !!this._verify_code;
     this.btn_grey.active = !isReady;
     this.btn_grey.active = !isReady;

+ 25 - 15
assets/scripts/modules/lobby/ui/UserInfoView/BindPhone.ts

@@ -58,31 +58,41 @@ export class BindPhone extends UIPopup {
     this.psd.placeholder = hasPsd ? 'Current Password' : 'Set Password';
     this.psd.placeholder = hasPsd ? 'Current Password' : 'Set Password';
 
 
     this.select_country.initSelectItems(["+1 United States"], { defaultIndex: 0 });
     this.select_country.initSelectItems(["+1 United States"], { defaultIndex: 0 });
+    this.onTextChanged(); //初始化按钮
   }
   }
 
 
   private onBtnCloseClick() {
   private onBtnCloseClick() {
     AppKernel.ui.close(UIViewID.BindPhone);
     AppKernel.ui.close(UIViewID.BindPhone);
   }
   }
 
 
+  private _clicking = false;
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
-    const phone = this.phone.string;
-    const pwd = this.psd.string;
-    const code = this.verify_code.string;
-    const isReady = !!phone && !!pwd && !!code;
-    if (!isReady) return;
-
-    const res = await AppKernel.stores.mainStore.reqBindPhoneConfirm({
-      account: phone,
-      password: pwd,
-      code: code
-    });
-    if (res) {
-      await AppKernel.ui.close(UIViewID.BindPhone);
-      AppKernel.ui.toast("Bind success");
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+
+    try {
+      const phone = this.phone.string;
+      const pwd = this.psd.string;
+      const code = this.verify_code.string;
+      const isReady = !!phone && !!pwd && !!code;
+      if (!isReady) return;
+      const res = await AppKernel.stores.mainStore.reqBindPhoneConfirm({
+        account: phone,
+        password: pwd,
+        code: code
+      });
+      if (res) {
+        await AppKernel.ui.close(UIViewID.BindPhone);
+        AppKernel.ui.toast("Bind success");
+      }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
-
   }
   }
 
 
+
   private onTextChanged() {
   private onTextChanged() {
     const isReady = !!this.phone && !!this._psd && !!this._verify_code;
     const isReady = !!this.phone && !!this._psd && !!this._verify_code;
     this.btn_grey.active = !isReady;
     this.btn_grey.active = !isReady;

+ 25 - 1
assets/scripts/modules/lobby/ui/UserInfoView/ChangeAvatar.ts

@@ -19,6 +19,9 @@ export class ChangeAvatar extends UIPopup {
   @property(Node)
   @property(Node)
   private btn_confirm: Node = null;
   private btn_confirm: Node = null;
 
 
+  @property(Node)
+  private btn_grey: Node = null;
+
   @property(Node)
   @property(Node)
   private item_avatar: Node = null;
   private item_avatar: Node = null;
 
 
@@ -47,12 +50,14 @@ export class ChangeAvatar extends UIPopup {
       const selected = node.getChildByName('selected');
       const selected = node.getChildByName('selected');
       setAvatars(sprite_avatar, i);
       setAvatars(sprite_avatar, i);
       selected.active = i == FaceID;
       selected.active = i == FaceID;
+      if (i == FaceID) this.selectedAvatarId = i;
 
 
       addBtnClick(node, () => this.onSelectAvatar(i), this);
       addBtnClick(node, () => this.onSelectAvatar(i), this);
 
 
       this.items_avatar.push(node);
       this.items_avatar.push(node);
     }
     }
 
 
+    this.refreshConfirmBtn(); // 初始化刷新按钮
   }
   }
 
 
 
 
@@ -61,16 +66,25 @@ export class ChangeAvatar extends UIPopup {
     AppKernel.ui.close(UIViewID.ChangeAvatar);
     AppKernel.ui.close(UIViewID.ChangeAvatar);
   }
   }
 
 
+  private _clicking = false;
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
-    if (this.selectedAvatarId >= 1) {
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+
+    try {
       const res = await AppKernel.stores.mainStore.reqChangeUserInfo({ FaceID: this.selectedAvatarId });
       const res = await AppKernel.stores.mainStore.reqChangeUserInfo({ FaceID: this.selectedAvatarId });
       if (res) {
       if (res) {
         await AppKernel.ui.close(UIViewID.ChangeAvatar);
         await AppKernel.ui.close(UIViewID.ChangeAvatar);
         AppKernel.ui.toast("Change success")
         AppKernel.ui.toast("Change success")
       }
       }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
   }
   }
 
 
+
   private onSelectAvatar(id: number) {
   private onSelectAvatar(id: number) {
     if (this.selectedAvatarId == id) return;
     if (this.selectedAvatarId == id) return;
     console.log("onSelectAvatar", id);
     console.log("onSelectAvatar", id);
@@ -80,7 +94,17 @@ export class ChangeAvatar extends UIPopup {
       const selected = item.getChildByName('selected');
       const selected = item.getChildByName('selected');
       selected.active = (i + 1 == id);
       selected.active = (i + 1 == id);
     })
     })
+
+    this.refreshConfirmBtn(); // 选中后更新按钮状态
   }
   }
 
 
+  // 新增方法:更新确认按钮状态
+  private refreshConfirmBtn() {
+    const originFaceId = AppKernel.stores.mainStore.userInfo.FaceID;
+    // 和当前头像一样:灰按钮;不一样:点亮确认
+    const isSame = this.selectedAvatarId === originFaceId;
+    this.btn_confirm.active = !isSame;
+    this.btn_grey.active = isSame;
+  }
 
 
 }
 }

+ 25 - 17
assets/scripts/modules/lobby/ui/UserInfoView/ChangeEmail.ts

@@ -56,30 +56,38 @@ export class ChangeEmail extends UIPopup {
 
 
     const { Email } = AppKernel.stores.mainStore.userInfo;
     const { Email } = AppKernel.stores.mainStore.userInfo;
     this.cur_email.string = "Current Email:" + Email;
     this.cur_email.string = "Current Email:" + Email;
-
+    this.onTextChanged(); //初始化按钮状态
   }
   }
 
 
   private onBtnCloseClick() {
   private onBtnCloseClick() {
     AppKernel.ui.close(UIViewID.ChangeEmail);
     AppKernel.ui.close(UIViewID.ChangeEmail);
   }
   }
 
 
+  private _clicking: boolean = false;
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
-    const old_code = this.cur_email_code.string;
-    const email = this.new_email.string;
-    const pwd = this.psd.string;
-    const new_code = this.verify_code.string;
-    const isReady = !!old_code && !!email && !!pwd && !!new_code;
-    if (!isReady) return;
-
-    const res = await AppKernel.stores.mailStore.reqChangeEmailConfirm({
-      account: email,
-      old_code,
-      new_code,
-      password: pwd
-    });
-    if (res) {
-      await AppKernel.ui.close(UIViewID.ChangeEmail);
-      AppKernel.ui.toast("Change success");
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+    try {
+      const old_code = this.cur_email_code.string;
+      const email = this.new_email.string;
+      const pwd = this.psd.string;
+      const new_code = this.verify_code.string;
+      const isReady = !!old_code && !!email && !!pwd && !!new_code;
+      if (!isReady) return;
+      const res = await AppKernel.stores.mailStore.reqChangeEmailConfirm({
+        account: email,
+        old_code,
+        new_code,
+        password: pwd
+      });
+      if (res) {
+        await AppKernel.ui.close(UIViewID.ChangeEmail);
+        AppKernel.ui.toast("Change success");
+      }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
   }
   }
 
 

+ 34 - 5
assets/scripts/modules/lobby/ui/UserInfoView/ChangeName.ts

@@ -18,11 +18,16 @@ export class ChangeName extends UIPopup {
   @property(Node)
   @property(Node)
   private btn_confirm: Node = null;
   private btn_confirm: Node = null;
 
 
+  @property(Node)
+  private btn_grey: Node = null;
+
   @property(EditBox)
   @property(EditBox)
   private nickname: EditBox = null;
   private nickname: EditBox = null;
 
 
   private _userInfo: any = null;
   private _userInfo: any = null;
 
 
+  private _clicking: boolean = false;
+
   protected onCreate(): void | Promise<void> {
   protected onCreate(): void | Promise<void> {
     addBtnClick(this.btn_close, this.onBtnCloseClick, this);
     addBtnClick(this.btn_close, this.onBtnCloseClick, this);
     addBtnClick(this.btn_confirm, this.onBtnConfirmClick, this);
     addBtnClick(this.btn_confirm, this.onBtnConfirmClick, this);
@@ -31,6 +36,8 @@ export class ChangeName extends UIPopup {
     const { NickName } = this._userInfo;
     const { NickName } = this._userInfo;
     this.nickname.placeholder = NickName;
     this.nickname.placeholder = NickName;
 
 
+    const Event = EditBox.EventType.TEXT_CHANGED;
+    this.nickname.node.on(Event, this.handleCheckForm, this);
   }
   }
 
 
   private onBtnCloseClick() {
   private onBtnCloseClick() {
@@ -38,17 +45,29 @@ export class ChangeName extends UIPopup {
   }
   }
 
 
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+
     const newName = this.nickname.string;
     const newName = this.nickname.string;
-    if (this._userInfo.NickName === newName || !newName) {
-      AppKernel.ui.toast("Cannot use the same nickname");
-    } else if (!this.validateNickname(newName)) {
-      AppKernel.ui.toast("Invalid format")
-    } else {
+    // if (this._userInfo.NickName === newName || !newName) {
+    //   AppKernel.ui.toast("Cannot use the same nickname");
+    // } else if (!this.validateNickname(newName)) {
+    //   AppKernel.ui.toast("Invalid format")
+    // } else {
+
+    // }
+
+    // try finally
+    try {
       const res = await AppKernel.stores.mainStore.reqChangeUserInfo({ NickName: newName });
       const res = await AppKernel.stores.mainStore.reqChangeUserInfo({ NickName: newName });
       if (res) {
       if (res) {
         await AppKernel.ui.close(UIViewID.ChangeName);
         await AppKernel.ui.close(UIViewID.ChangeName);
         AppKernel.ui.toast("Change success")
         AppKernel.ui.toast("Change success")
       }
       }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
   }
   }
 
 
@@ -58,5 +77,15 @@ export class ChangeName extends UIPopup {
     return reg.test(str);
     return reg.test(str);
   }
   }
 
 
+  // 实时输入校验:空白、同名、格式,用来控制按钮可用,不弹toast
+  private handleCheckForm() {
+    const trimName = this.nickname.string.trim();
+    const origin = this._userInfo?.NickName;
+    // 满足全部条件才可以点确认
+    const isReady = !!trimName && trimName !== origin && this.validateNickname(trimName);
+    this.btn_confirm.active = isReady;
+    this.btn_grey.active = !isReady;
+  }
+
 
 
 }
 }

+ 27 - 16
assets/scripts/modules/lobby/ui/UserInfoView/ChangePhone.ts

@@ -62,32 +62,43 @@ export class ChangePhone extends UIPopup {
 
 
 
 
     this.select_country.initSelectItems(["+1 United States"], { defaultIndex: 0 });
     this.select_country.initSelectItems(["+1 United States"], { defaultIndex: 0 });
+
+    this.onTextChanged(); //初始化按钮灰态
   }
   }
 
 
   private onBtnCloseClick() {
   private onBtnCloseClick() {
     AppKernel.ui.close(UIViewID.ChangePhone);
     AppKernel.ui.close(UIViewID.ChangePhone);
   }
   }
 
 
+  private _clicking: boolean = false;
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
-    const old_code = this.cur_phone_code.string;
-    const phone = this.new_phone.string;
-    const pwd = this.psd.string;
-    const new_code = this.verify_code.string;
-    const isReady = !!old_code && !!phone && !!pwd && !!new_code;
-    if (!isReady) return;
-
-    const res = await AppKernel.stores.mainStore.reqChangePhoneConfirm({
-      oldCode: old_code,
-      newPhone: phone,
-      newCode: new_code,
-      password: pwd
-    });
-    if (res) {
-      await AppKernel.ui.close(UIViewID.ChangePhone);
-      AppKernel.ui.toast("Change success");
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+    try {
+      const old_code = this.cur_phone_code.string;
+      const phone = this.new_phone.string;
+      const pwd = this.psd.string;
+      const new_code = this.verify_code.string;
+      const isReady = !!old_code && !!phone && !!pwd && !!new_code;
+      if (!isReady) return;
+      const res = await AppKernel.stores.mainStore.reqChangePhoneConfirm({
+        oldCode: old_code,
+        newPhone: phone,
+        newCode: new_code,
+        password: pwd
+      });
+      if (res) {
+        await AppKernel.ui.close(UIViewID.ChangePhone);
+        AppKernel.ui.toast("Change success");
+      }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
   }
   }
 
 
+
   private onTextChanged() {
   private onTextChanged() {
     const isReady = !!this._cur_phone_code && !!this._new_phone && !!this._psd && !!this._verify_code;
     const isReady = !!this._cur_phone_code && !!this._new_phone && !!this._psd && !!this._verify_code;
     this.btn_grey.active = !isReady;
     this.btn_grey.active = !isReady;

+ 23 - 12
assets/scripts/modules/lobby/ui/UserInfoView/UnbindAccount.ts

@@ -38,25 +38,36 @@ export class UnbindAccount extends UIPopup {
 
 
     this.account.node.on(EditBox.EventType.TEXT_CHANGED, this.onAccountTextChanged, this);
     this.account.node.on(EditBox.EventType.TEXT_CHANGED, this.onAccountTextChanged, this);
     this.verify_code.node.on(EditBox.EventType.TEXT_CHANGED, this.onVerifyCodeTextChanged, this);
     this.verify_code.node.on(EditBox.EventType.TEXT_CHANGED, this.onVerifyCodeTextChanged, this);
+
+    this.onTextChanged(); //初始化按钮状态
   }
   }
 
 
   private onBtnCloseClick() {
   private onBtnCloseClick() {
     AppKernel.ui.close(UIViewID.UnbindAccount);
     AppKernel.ui.close(UIViewID.UnbindAccount);
   }
   }
 
 
+  private _clicking: boolean = false;
   private async onBtnConfirmClick() {
   private async onBtnConfirmClick() {
-    const account = this.account.string;
-    const code = this.verify_code.string;
-    const isReady = !!account && !!code;
-    if (!isReady) return;
-
-    const res = await AppKernel.stores.mainStore.reqUnBind3rdConfirm({
-      verify_type: checkIsEmail(account) ? "email" : "phone",
-      code
-    });
-    if (res) {
-      await AppKernel.ui.close(UIViewID.UnbindAccount);
-      AppKernel.ui.toast("Unbind success");
+    if (this._clicking) return;
+    this._clicking = true;
+    AppKernel.ui.loading(true);
+    try {
+      const account = this.account.string;
+      const code = this.verify_code.string;
+      const isReady = !!account && !!code;
+      if (!isReady) return;
+
+      const res = await AppKernel.stores.mainStore.reqUnBind3rdConfirm({
+        verify_type: checkIsEmail(account) ? "email" : "phone",
+        code
+      });
+      if (res) {
+        await AppKernel.ui.close(UIViewID.UnbindAccount);
+        AppKernel.ui.toast("Unbind success");
+      }
+    } finally {
+      AppKernel.ui.loading(false);
+      this._clicking = false;
     }
     }
   }
   }
 
 

+ 44 - 7
assets/scripts/modules/lobby/ui/UserInfoView/UserInfoView.ts

@@ -3,7 +3,7 @@ import { UIView } from '@scripts/framework/ui/UIView';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { AppKernel } from '@scripts/app/AppKernel';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UIViewID } from '@scripts/define/UIDefine';
 import { UICloseReason } from '@scripts/framework/ui/UILayer';
 import { UICloseReason } from '@scripts/framework/ui/UILayer';
-import { formatCurrency } from '@scripts/utils/Helper';
+import { copyToClipboard, formatCurrency } from '@scripts/utils/Helper';
 import { addBtnClick } from '@scripts/utils/UIHelper';
 import { addBtnClick } from '@scripts/utils/UIHelper';
 import { setAvatars, setSpriteFrame } from '@scripts/utils/ResHelper';
 import { setAvatars, setSpriteFrame } from '@scripts/utils/ResHelper';
 
 
@@ -40,6 +40,15 @@ export class UserInfoView extends UIView {
   @property(Node)
   @property(Node)
   btn_unlink_third_party: Node;
   btn_unlink_third_party: Node;
 
 
+  @property(Node)
+  btn_vip: Node;
+
+  @property(Node)
+  btn_sc: Node;
+
+  @property(Node)
+  btn_gc: Node;
+
   @property(Sprite)
   @property(Sprite)
   avatar: Sprite;
   avatar: Sprite;
 
 
@@ -101,6 +110,9 @@ export class UserInfoView extends UIView {
     addBtnClick(this.btn_bind_google, this.onBtnBindGoogleClick, this);
     addBtnClick(this.btn_bind_google, this.onBtnBindGoogleClick, this);
     addBtnClick(this.btn_bind_facebook, this.onBtnBindFacebookClick, this);
     addBtnClick(this.btn_bind_facebook, this.onBtnBindFacebookClick, this);
     addBtnClick(this.btn_unlink_third_party, this.onBtnUnlinkThirdPartyClick, this);
     addBtnClick(this.btn_unlink_third_party, this.onBtnUnlinkThirdPartyClick, this);
+    addBtnClick(this.btn_vip, this.onBtnVipClick, this);
+    addBtnClick(this.btn_sc, this.onBtnSCClick, this);
+    addBtnClick(this.btn_gc, this.onBtnGCClick, this);
 
 
 
 
     this._googleWebBtn = AppKernel.google.createLoginBtn(
     this._googleWebBtn = AppKernel.google.createLoginBtn(
@@ -120,9 +132,9 @@ export class UserInfoView extends UIView {
   }
   }
 
 
   protected onDestroy(): void {
   protected onDestroy(): void {
-    AppKernel.events.off('user:update', this.updateUserInfo, this);
-    AppKernel.events.off('open:ui-view', this.handleSubViewOpen, this);
-    AppKernel.events.off('close:ui-view', this.handleSubViewClose, this);
+    // AppKernel.events.off('user:update', this.updateUserInfo, this);
+    // AppKernel.events.off('open:ui-view', this.handleSubViewOpen, this);
+    // AppKernel.events.off('close:ui-view', this.handleSubViewClose, this);
 
 
     this._googleWebBtn?.clear();
     this._googleWebBtn?.clear();
     super.onDestroy();
     super.onDestroy();
@@ -149,8 +161,8 @@ export class UserInfoView extends UIView {
     this.id.string = `ID:${GameID}`;
     this.id.string = `ID:${GameID}`;
     this.level.string = `LV.${Level}`;
     this.level.string = `LV.${Level}`;
     this.vip_level.string = `VIP.${vipLevel}`;
     this.vip_level.string = `VIP.${vipLevel}`;
-    this.score.string = Score;
-    this.gold_score.string = InsureScore;
+    this.score.string = formatCurrency(Score);
+    this.gold_score.string = formatCurrency(InsureScore);
 
 
     this.email.string = Email ? Email : "Not bound";
     this.email.string = Email ? Email : "Not bound";
     const btn_email_label = this.btn_email.getChildByName("label");
     const btn_email_label = this.btn_email.getChildByName("label");
@@ -197,8 +209,21 @@ export class UserInfoView extends UIView {
     AppKernel.ui.open(UIViewID.ChangeName);
     AppKernel.ui.open(UIViewID.ChangeName);
   }
   }
 
 
-  private onBtnCopyIDClick() {
+  private async onBtnCopyIDClick() {
     const { GameID } = this._userInfo;
     const { GameID } = this._userInfo;
+
+    // 按钮点击回调
+    const copyStr = GameID;
+    const success = await copyToClipboard(copyStr);
+    if (success) {
+      console.log("复制成功");
+      
+      // 弹出toast:已复制到剪贴板
+      AppKernel.ui.toast("Copied to clipboard");
+    } else {
+      console.log("复制失败");
+    }
+
   }
   }
 
 
   private async onBtnBindGoogleClick() {
   private async onBtnBindGoogleClick() {
@@ -240,6 +265,18 @@ export class UserInfoView extends UIView {
     }
     }
   }
   }
 
 
+  private onBtnVipClick() {
+    AppKernel.ui.open(UIViewID.ClubView);
+  }
+
+  private onBtnSCClick() {
+    AppKernel.ui.open(UIViewID.StoreView);
+  }
+
+  private onBtnGCClick() {
+    AppKernel.ui.open(UIViewID.StoreView);
+  }
+
   private handleSubViewOpen(payload: UIViewID) {
   private handleSubViewOpen(payload: UIViewID) {
     if (this.listenViews.includes(payload)) {
     if (this.listenViews.includes(payload)) {
       this._googleWebBtn?.setActive(false);
       this._googleWebBtn?.setActive(false);

+ 2 - 0
assets/scripts/modules/lobby/ui/WeeklyPassView/WeeklyPassView.ts

@@ -240,6 +240,7 @@ export class WeeklyPassView extends UIView {
   private async onBtnClaimAllClick() {
   private async onBtnClaimAllClick() {
     if (this._claiming) return;
     if (this._claiming) return;
     this._claiming = true;
     this._claiming = true;
+    AppKernel.ui.loading(true);
 
 
     const idx = this._default_gift;
     const idx = this._default_gift;
     if (idx < 0) return;
     if (idx < 0) return;
@@ -253,6 +254,7 @@ export class WeeklyPassView extends UIView {
       const res = await AppKernel.stores.weeklyPassStore.reqWeeklyPassClaim(payload) as any;
       const res = await AppKernel.stores.weeklyPassStore.reqWeeklyPassClaim(payload) as any;
       if (res) AppKernel.ui.open(UIViewID.WeeklyPassClaim, { data: res });
       if (res) AppKernel.ui.open(UIViewID.WeeklyPassClaim, { data: res });
     } finally {
     } finally {
+      AppKernel.ui.loading(false);
       this._claiming = false;
       this._claiming = false;
     }
     }
 
 

+ 19 - 39
assets/scripts/store/mailStore/MailStore.ts

@@ -13,7 +13,7 @@ import {
     APP_REGISTER,
     APP_REGISTER,
 } from '../../api';
 } from '../../api';
 import { Http } from '../../request';
 import { Http } from '../../request';
-import { success } from '@scripts/api/ApiHelper';
+import { handleResMsg, success } from '@scripts/api/ApiHelper';
 import { IMailActionData, IMailCheckData, IMailItem, IMailPageData } from './data';
 import { IMailActionData, IMailCheckData, IMailItem, IMailPageData } from './data';
 import { APP_LOGIN_TYPE } from '@scripts/define/Define';
 import { APP_LOGIN_TYPE } from '@scripts/define/Define';
 import { mainStore } from '../mainStore/MainStore';
 import { mainStore } from '../mainStore/MainStore';
@@ -119,27 +119,23 @@ class MailStore {
 
 
     async reqMailDelete(mailID: number) {
     async reqMailDelete(mailID: number) {
         const res = await Http.call(APP_MAIL_DELETE, { MailID: mailID });
         const res = await Http.call(APP_MAIL_DELETE, { MailID: mailID });
-        if (success(res)) {
+        return handleResMsg(res, () => {
             if (mailID === 0) {
             if (mailID === 0) {
                 this._mailList = [];
                 this._mailList = [];
             } else {
             } else {
                 this._mailList = this._mailList.filter(item => Number(item.MailID) !== Number(mailID));
                 this._mailList = this._mailList.filter(item => Number(item.MailID) !== Number(mailID));
             }
             }
             if (this._readMailID === mailID) this._readMailID = 0;
             if (this._readMailID === mailID) this._readMailID = 0;
-            return true;
-        }
-        return false;
+        });
     }
     }
 
 
     async reqMailTake(mailID: number) {
     async reqMailTake(mailID: number) {
         const res = await Http.call<IMailActionData>(APP_MAIL_TAKE, { MailID: mailID });
         const res = await Http.call<IMailActionData>(APP_MAIL_TAKE, { MailID: mailID });
-        if (success(res)) {
+        return handleResMsg(res, () => {
             const responseMailID = Number(res.data?.MailID ?? mailID);
             const responseMailID = Number(res.data?.MailID ?? mailID);
             const item = this.getMail(responseMailID);
             const item = this.getMail(responseMailID);
             if (item) item.MailStatus = '3';
             if (item) item.MailStatus = '3';
-            return true;
-        }
-        return false;
+        });
     }
     }
 
 
     clear() {
     clear() {
@@ -164,11 +160,9 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call(APP_EMAIL_SEND_CODE, params);
         const res = await Http.call(APP_EMAIL_SEND_CODE, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             this.setOtpTs(send_type);
             this.setOtpTs(send_type);
-            return true;
-        }
-        return false;
+        });
     }
     }
 
 
     async reqRegister({ account, code, password, act }) {
     async reqRegister({ account, code, password, act }) {
@@ -183,10 +177,7 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call(APP_REGISTER, params);
         const res = await Http.call(APP_REGISTER, params);
-        if (success(res)) {
-            return true;
-        }
-        return false;
+        return handleResMsg(res);
     }
     }
 
 
     async reqResetPsd({ account, code, newpassword }) {
     async reqResetPsd({ account, code, newpassword }) {
@@ -199,10 +190,7 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call(APP_EMAIL_RESET_PSD, params);
         const res = await Http.call(APP_EMAIL_RESET_PSD, params);
-        if (success(res)) {
-            return true;
-        }
-        return false;
+        return handleResMsg(res);
     }
     }
 
 
     async reqBindEmailCode({ account }) {
     async reqBindEmailCode({ account }) {
@@ -212,11 +200,10 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call(APP_EMAIL_BIND_CODE, params);
         const res = await Http.call(APP_EMAIL_BIND_CODE, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             this.setOtpTs(MailOtpType.Bind);
             this.setOtpTs(MailOtpType.Bind);
-            return true;
-        }
-        return false;
+        });
+
     }
     }
 
 
     async reqBindEmailConfirm({ account, code, password }) {
     async reqBindEmailConfirm({ account, code, password }) {
@@ -227,13 +214,10 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call<IUserData>(APP_EMAIL_BIND_CONFIRM, params);
         const res = await Http.call<IUserData>(APP_EMAIL_BIND_CONFIRM, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             mainStore.updateUserInfo(res.data);
             mainStore.updateUserInfo(res.data);
             AppKernel.events.emit('user:update');
             AppKernel.events.emit('user:update');
-
-            return true;
-        }
-        return false;
+        });
     }
     }
 
 
     async reqChangeEmailCode({ account, target }) {
     async reqChangeEmailCode({ account, target }) {
@@ -248,11 +232,9 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call(APP_EMAIL_CHANGE_CODE, params);
         const res = await Http.call(APP_EMAIL_CHANGE_CODE, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             this.setOtpTs(send_type);
             this.setOtpTs(send_type);
-            return true;
-        }
-        return false;
+        })
     }
     }
 
 
     async reqChangeEmailConfirm({ account, old_code, new_code, password }) {
     async reqChangeEmailConfirm({ account, old_code, new_code, password }) {
@@ -264,13 +246,11 @@ class MailStore {
         }
         }
 
 
         const res = await Http.call(APP_EMAIL_CHANGE_CONFIRM, params);
         const res = await Http.call(APP_EMAIL_CHANGE_CONFIRM, params);
-        if (success(res)) {
+
+        return handleResMsg(res, async () => {
             await mainStore.reqUserInfo();
             await mainStore.reqUserInfo();
             AppKernel.events.emit('user:update');
             AppKernel.events.emit('user:update');
-
-            return true;
-        }
-        return false;
+        })
     }
     }
 
 
 }
 }

+ 12 - 18
assets/scripts/store/mainStore/MainStore.ts

@@ -17,7 +17,7 @@ import {
     APP_UNBIND_3RD_CONFIRM,
     APP_UNBIND_3RD_CONFIRM,
     APP_BIG_WIN,
     APP_BIG_WIN,
 } from "../../api";
 } from "../../api";
-import { success } from '@scripts/api/ApiHelper';
+import { handleResMsg, success } from '@scripts/api/ApiHelper';
 import { AppKernel } from "../../app/AppKernel";
 import { AppKernel } from "../../app/AppKernel";
 import { Login3rdType, APP_LOGIN_TYPE, COUNTRY_CODE, CurrencyType, CURRENCY_TYPE } from "../../define/Define";
 import { Login3rdType, APP_LOGIN_TYPE, COUNTRY_CODE, CurrencyType, CURRENCY_TYPE } from "../../define/Define";
 import { LOCAL_CURRENCY_MODE, LOCAL_SIGN } from "../../constants/Localkey";
 import { LOCAL_CURRENCY_MODE, LOCAL_SIGN } from "../../constants/Localkey";
@@ -323,15 +323,13 @@ class MainStore {
         }
         }
 
 
         const res = await Http.call(APP_SEND_CODE, params);
         const res = await Http.call(APP_SEND_CODE, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             if (isChangeOld) {
             if (isChangeOld) {
                 this.setOtpTs(OtpType.ChangeOld);
                 this.setOtpTs(OtpType.ChangeOld);
             } else {
             } else {
                 this.setOtpTs(OtpType.Main);
                 this.setOtpTs(OtpType.Main);
             }
             }
-            return true;
-        }
-        return false;
+        });
     }
     }
 
 
     async reqProtectCheck() {
     async reqProtectCheck() {
@@ -411,13 +409,10 @@ class MainStore {
             country: 1
             country: 1
         }
         }
         const res = await Http.call<IUserData>(APP_BIND_SMS, params);
         const res = await Http.call<IUserData>(APP_BIND_SMS, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             mainStore.updateUserInfo(res.data);
             mainStore.updateUserInfo(res.data);
             AppKernel.events.emit('user:update');
             AppKernel.events.emit('user:update');
-
-            return true;
-        }
-        return false;
+        });
 
 
     }
     }
 
 
@@ -430,13 +425,10 @@ class MainStore {
             country: 1
             country: 1
         }
         }
         const res = await Http.call<IUserData>(APP_CHANGE_BIND_PHONE, params);
         const res = await Http.call<IUserData>(APP_CHANGE_BIND_PHONE, params);
-        if (success(res)) {
+        return handleResMsg(res, () => {
             mainStore.updateUserInfo(res.data);
             mainStore.updateUserInfo(res.data);
             AppKernel.events.emit('user:update');
             AppKernel.events.emit('user:update');
-
-            return true;
-        }
-        return false;
+        });
 
 
     }
     }
 
 
@@ -447,11 +439,11 @@ class MainStore {
             token: token
             token: token
         }
         }
         const res = await Http.call(APP_BIND_3RD, params);
         const res = await Http.call(APP_BIND_3RD, params);
-        if (success(res)) {
+
+        return handleResMsg(res, async () => {
             await this.reqUserInfo();
             await this.reqUserInfo();
             AppKernel.events.emit('user:update');
             AppKernel.events.emit('user:update');
-        }
-        return res;
+        });
     }
     }
 
 
     async reqBindFacebook() {
     async reqBindFacebook() {
@@ -521,6 +513,8 @@ class MainStore {
         return false;
         return false;
     }
     }
 
 
+
+
 }
 }
 
 
 
 

+ 93 - 16
assets/scripts/utils/Helper.ts

@@ -1,6 +1,7 @@
 import { CASH_BASE } from '@scripts/constants/App';
 import { CASH_BASE } from '@scripts/constants/App';
-import { sys } from 'cc';
+import { native, sys } from 'cc';
 import { ANDROID, IOS } from 'cc/env';
 import { ANDROID, IOS } from 'cc/env';
+import { NATIVE } from 'cc/env';
 
 
 const STORAGE_ENCRYPTION_HEAD = 'a6072637';
 const STORAGE_ENCRYPTION_HEAD = 'a6072637';
 const STORAGE_ENCRYPTION_PASSWORD = 'xbd4jl';
 const STORAGE_ENCRYPTION_PASSWORD = 'xbd4jl';
@@ -79,7 +80,7 @@ export function formatGoodsNum(value: number): string {
 }
 }
 
 
 /**
 /**
- * 通用数量格式化:支持缩放除数 + K/M/B/T缩写
+ * 通用数量格式化:支持缩放除数 + K/M/B/T缩写,边界自动向上进位直到最大单位
  * @param rawStr 后端原始字符串,如 "120000.00"
  * @param rawStr 后端原始字符串,如 "120000.00"
  * @param max 触发缩写的【真实数值阈值】(除以divisor之后的值)
  * @param max 触发缩写的【真实数值阈值】(除以divisor之后的值)
  * @param decimalPlaces 最多保留小数位数,默认2
  * @param decimalPlaces 最多保留小数位数,默认2
@@ -95,34 +96,65 @@ export function formatNumShort(
     if (!rawStr) return "0";
     if (!rawStr) return "0";
     const rawNum = Number(rawStr);
     const rawNum = Number(rawStr);
     if (isNaN(rawNum)) return "0";
     if (isNaN(rawNum)) return "0";
-    const realNum = rawNum / divisor;
 
 
-    const units = [
-        { value: 1e12, suffix: "T" },
-        { value: 1e9, suffix: "B" },
-        { value: 1e6, suffix: "M" },
+    let realNum = rawNum / divisor;
+
+    // 单位从最小到最大,方便向上升级
+    const unitsAsc = [
         { value: 1e3, suffix: "K" },
         { value: 1e3, suffix: "K" },
+        { value: 1e6, suffix: "M" },
+        { value: 1e9, suffix: "B" },
+        { value: 1e12, suffix: "T" },
     ];
     ];
+    // 从大到小,用于第一轮查找
+    const unitsDesc = [...unitsAsc].reverse();
 
 
-    // 没达到缩写阈值
+    // 没达到缩写阈值,直接返回处理后的原始数字
     if (realNum < max) {
     if (realNum < max) {
         const fixedStr = realNum.toFixed(decimalPlaces);
         const fixedStr = realNum.toFixed(decimalPlaces);
-        // 去除末尾多余0,如 8.00 → "8",0.08 → "0.08"
         return parseFloat(fixedStr).toString();
         return parseFloat(fixedStr).toString();
     }
     }
 
 
-    for (const unit of units) {
-        if (realNum >= unit.value) {
-            const val = realNum / unit.value;
-            const fixedStr = val.toFixed(decimalPlaces);
-            const trimStr = parseFloat(fixedStr).toString();
-            return `${trimStr}${unit.suffix}`;
+    let finalVal = realNum;
+    let finalSuffix = "";
+
+    // 第一轮:找到基础单位
+    for (const unit of unitsDesc) {
+        if (finalVal >= unit.value - 1e-9) {
+            finalVal = finalVal / unit.value;
+            finalSuffix = unit.suffix;
+            break;
         }
         }
     }
     }
-    return realNum.toString();
+
+    //  循环向上升级:直到舍入后小于1000 或者已经是最大单位T
+    let loop = true;
+    while (loop) {
+        const fixedStr = finalVal.toFixed(decimalPlaces);
+        const trimNum = parseFloat(fixedStr);
+        // 舍入后 >=1000,往上进位
+        if (trimNum >= 1000) {
+            finalVal = trimNum / 1000;
+            // 升级后缀
+            if (finalSuffix === "K") finalSuffix = "M";
+            else if (finalSuffix === "M") finalSuffix = "B";
+            else if (finalSuffix === "B") finalSuffix = "T";
+            else if (finalSuffix === "T") {
+                // 已经是最大单位T,不再升级,停止循环
+                loop = false;
+            }
+        } else {
+            loop = false;
+        }
+    }
+
+    const fixedStr = finalVal.toFixed(decimalPlaces);
+    const trimNum = parseFloat(fixedStr).toString();
+    return `${trimNum}${finalSuffix}`;
 }
 }
 
 
 
 
+
 /**
 /**
  * 读取本地数据,并兼容 game_web_us2 写入的加密格式。
  * 读取本地数据,并兼容 game_web_us2 写入的加密格式。
  */
  */
@@ -392,4 +424,49 @@ export function parseMailRewardStr(str: string) {
         });
         });
     }
     }
     return result;
     return result;
+}
+
+/**
+ * 复制文本到系统剪贴板
+ * @param text 要复制的字符串
+ * @returns Promise<boolean> true成功 false失败
+ */
+export async function copyToClipboard(text: string): Promise<boolean> {
+    if (!text) return false;
+
+    // ========== 原生平台 Android / iOS ==========
+    if (NATIVE) {
+        try {
+            native.copyTextToClipboard(text);
+            return true;
+        } catch (e) {
+            console.error("复制剪贴板失败 native:", e);
+            return false;
+        }
+    }
+
+    // ========== Web网页平台(H5) ==========
+    if (sys.isBrowser) {
+        try {
+            // 新版浏览器标准API
+            await navigator.clipboard.writeText(text);
+            return true;
+        } catch (err) {
+            // console.warn("navigator.clipboard失败,降级使用textarea方案", err);
+            // 降级兼容老浏览器
+            const ta = document.createElement('textarea');
+            ta.style.position = 'absolute';
+            ta.style.left = '-9999px';
+            ta.value = text;
+            document.body.appendChild(ta);
+            ta.select();
+            const ok = document.execCommand('copy');
+            document.body.removeChild(ta);
+            return ok;
+        }
+    }
+
+    // 其他平台(微信小游戏单独处理)
+    console.warn("当前平台不支持剪贴板复制");
+    return false;
 }
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio