feat: 添加账号注销功能,优化登录注册流程

1.  新增账号注销全流程功能,包括注销页面、验证码校验和注销接口调用
2.  优化邮箱注册校验逻辑,区分已设置密码和未设置密码的账号
3.  重构个人页面登出逻辑,统一登出处理流程
4.  更新多语言文案,补充注销相关提示文本
5.  调整个人信息页面布局,添加注销账号入口
This commit is contained in:
“虞渠成” 2026-09-21 15:55:13 +08:00
parent ed0ba72402
commit 1500451aa8
15 changed files with 4353 additions and 1250 deletions

View File

@ -1,7 +1,7 @@
[ [
{ {
"key": "100001", "key": "100001",
"zh": "创建你的\n账", "zh": "创建你的\n账",
"en": "Create your\nAccount" "en": "Create your\nAccount"
}, },
{ {
@ -91,7 +91,7 @@
}, },
{ {
"key": "100019", "key": "100019",
"zh": "设置您的\n账密码", "zh": "设置您的\n账密码",
"en": "Create your\nAccount Password" "en": "Create your\nAccount Password"
}, },
{ {
@ -166,7 +166,7 @@
}, },
{ {
"key": "100034", "key": "100034",
"zh": "绑定您的\n账", "zh": "绑定您的\n账",
"en": "Connect Your\nAccount" "en": "Connect Your\nAccount"
}, },
{ {
@ -1738,7 +1738,33 @@
"key": "100338", "key": "100338",
"zh": "立即设置", "zh": "立即设置",
"en": "Set Now" "en": "Set Now"
},
{
"key": "100339",
"zh": "注销帐号",
"en": "Delete account"
},
{
"key": "100340",
"zh": "1.账号注销成功后,该账号对应的全部用户数据将一并删除。\n2.账号注销操作一经确认提交,不可撤销、无注销冷静期。\n3.账号注销完成后,原账号标识可重新用于注册新账号,注册成功后方可登录使用。",
"en": "1.After account cancellation, all user data associated with the account will be completely deleted.\n2.The account cancellation operation is irreversible once confirmed and submitted, with no cooling-off period applicable.\n3.After successful account cancellation, the original account identifier may be used for re-registration and subsequent login."
},
{
"key": "100341",
"zh": "是否确认注销账号?",
"en": "Are you sure you want to delete this account?"
},
{
"key": "100342",
"zh": "验证码错误或已过期",
"en": "Incorrect or expired verification code"
},
{
"key": "100343",
"zh": "注销失败,请重试",
"en": "Account deletion failed. Please try again"
} }
] ]

View File

@ -406,6 +406,9 @@ RectTransform:
- {fileID: 2804317011649488167} - {fileID: 2804317011649488167}
- {fileID: 6062647938688273390} - {fileID: 6062647938688273390}
- {fileID: 1667034045599266742} - {fileID: 1667034045599266742}
- {fileID: 7146889589913556336}
- {fileID: 1035419108335367957}
- {fileID: 6032238728068850519}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
@ -492,6 +495,8 @@ MonoBehaviour:
deviceTeachingPagePrefabs: deviceTeachingPagePrefabs:
- {fileID: 1474905962228275108, guid: 246adf78ac3d6124bb946741f1faa8d2, type: 3} - {fileID: 1474905962228275108, guid: 246adf78ac3d6124bb946741f1faa8d2, type: 3}
- {fileID: 2000208765999145634, guid: 900faf6395fb9264cb12e7a136cd858f, type: 3} - {fileID: 2000208765999145634, guid: 900faf6395fb9264cb12e7a136cd858f, type: 3}
signoutButton: {fileID: 2179229062968731820}
signoutTip: {fileID: 6379451326206866652}
--- !u!1 &1109903661156198062 --- !u!1 &1109903661156198062
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2180,6 +2185,99 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
textKey: 100117 textKey: 100117
--- !u!1 &6902311399457977606
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4208999303476437369}
- component: {fileID: 7435457182357532492}
- component: {fileID: 5900129080785392847}
- component: {fileID: 7069059077903250055}
m_Layer: 5
m_Name: Text (Legacy)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4208999303476437369
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902311399457977606}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7146889589913556336}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7435457182357532492
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902311399457977606}
m_CullTransparentMesh: 1
--- !u!114 &5900129080785392847
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902311399457977606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: f4c31d68e7cd3454685bb4c132a52f58, type: 3}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Sign Out
--- !u!114 &7069059077903250055
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902311399457977606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 89f1d49b50a31514787b4e268b1c73bb, type: 3}
m_Name:
m_EditorClassIdentifier:
textKey: 100199
--- !u!1 &7359753191010044759 --- !u!1 &7359753191010044759
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3048,6 +3146,127 @@ MonoBehaviour:
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: m_Text:
--- !u!1 &8940119328318279167
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7146889589913556336}
- component: {fileID: 2784790590864870743}
- component: {fileID: 2572477641597898842}
- component: {fileID: 2179229062968731820}
m_Layer: 5
m_Name: "\u767B\u51FA"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7146889589913556336
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8940119328318279167}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4208999303476437369}
m_Father: {fileID: 6157072509248269050}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 119.99999}
m_SizeDelta: {x: -60, y: 90}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &2784790590864870743
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8940119328318279167}
m_CullTransparentMesh: 1
--- !u!114 &2572477641597898842
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8940119328318279167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: e70cab5c4dbadd748a0e5e007f58bf9d, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &2179229062968731820
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8940119328318279167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2572477641597898842}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1001 &3570835734124545750 --- !u!1001 &3570835734124545750
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3502,3 +3721,583 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1001 &6484252301306899974
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 6157072509248269050}
m_Modifications:
- target: {fileID: 1507386632888176871, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1507386632888176871, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1507386632888176871, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.x
value: 530
objectReference: {fileID: 0}
- target: {fileID: 1507386632888176871, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: 1507386632888176871, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 295
objectReference: {fileID: 0}
- target: {fileID: 1507386632888176871, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -312
objectReference: {fileID: 0}
- target: {fileID: 4296973555611399213, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4296973555611399213, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4296973555611399213, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.x
value: 530
objectReference: {fileID: 0}
- target: {fileID: 4296973555611399213, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.y
value: 45
objectReference: {fileID: 0}
- target: {fileID: 4296973555611399213, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 295
objectReference: {fileID: 0}
- target: {fileID: 4296973555611399213, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -55
objectReference: {fileID: 0}
- target: {fileID: 4685927451915885120, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.y
value: 342
objectReference: {fileID: 0}
- target: {fileID: 5819498693055166909, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_Name
value: "\u767B\u51FA\u63D0\u793A"
objectReference: {fileID: 0}
- target: {fileID: 5819498693055166909, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6932510086501176331, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: textKey
value: 100285
objectReference: {fileID: 0}
- target: {fileID: 6936886167337472632, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6936886167337472632, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6936886167337472632, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.x
value: 530
objectReference: {fileID: 0}
- target: {fileID: 6936886167337472632, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_SizeDelta.y
value: 42
objectReference: {fileID: 0}
- target: {fileID: 6936886167337472632, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 295
objectReference: {fileID: 0}
- target: {fileID: 6936886167337472632, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -140
objectReference: {fileID: 0}
- target: {fileID: 7452104535586638788, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: textKey
value: 100286
objectReference: {fileID: 0}
- target: {fileID: 8129608870612343553, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_Text
value: Are you sure you want to log out?
objectReference: {fileID: 0}
- target: {fileID: 8129608870612343553, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_FontData.m_Alignment
value: 4
objectReference: {fileID: 0}
- target: {fileID: 8554119746467992561, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
propertyPath: m_Text
value: Sign out
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 52c284b3dc8d7b94297736ede9ad1f7e, type: 3}
--- !u!224 &1035419108335367957 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 6314676893636565267, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
m_PrefabInstance: {fileID: 6484252301306899974}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6379451326206866652 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 104968393464765146, guid: 52c284b3dc8d7b94297736ede9ad1f7e,
type: 3}
m_PrefabInstance: {fileID: 6484252301306899974}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ce7f9a66c3b832343bd86c4b491d90c8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &8438205999760478775
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 6157072509248269050}
m_Modifications:
- target: {fileID: 184803144727737283, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 184803144727737283, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 184803144727737283, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 184803144727737283, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 184803144727737283, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -201.5
objectReference: {fileID: 0}
- target: {fileID: 886015656204995988, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 886015656204995988, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 886015656204995988, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 886015656204995988, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 886015656204995988, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -50
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2851268200846277789, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2851268200846277789, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2851268200846277789, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 2851268200846277789, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 2851268200846277789, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -353
objectReference: {fileID: 0}
- target: {fileID: 3289844309708103056, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3289844309708103056, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3289844309708103056, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 3289844309708103056, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 3289844309708103056, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -302.5
objectReference: {fileID: 0}
- target: {fileID: 4107443752149291401, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4107443752149291401, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4107443752149291401, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 4107443752149291401, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 4107443752149291401, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -100.5
objectReference: {fileID: 0}
- target: {fileID: 5030859281969820890, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5030859281969820890, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5030859281969820890, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 5030859281969820890, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 5030859281969820890, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -151
objectReference: {fileID: 0}
- target: {fileID: 6774584937554793577, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6774584937554793577, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6774584937554793577, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_SizeDelta.x
value: 630
objectReference: {fileID: 0}
- target: {fileID: 6774584937554793577, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 345
objectReference: {fileID: 0}
- target: {fileID: 6774584937554793577, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -252
objectReference: {fileID: 0}
- target: {fileID: 8420805150731623820, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_Name
value: "\u4E2A\u4EBA\u4FE1\u606F\u9875"
objectReference: {fileID: 0}
- target: {fileID: 8420805150731623820, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d9dcb18ed4ca0f741a416854a791047e, type: 3}
--- !u!224 &6032238728068850519 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2786697444026413408, guid: d9dcb18ed4ca0f741a416854a791047e,
type: 3}
m_PrefabInstance: {fileID: 8438205999760478775}
m_PrefabAsset: {fileID: 0}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 41893f404b95b1f48a41f3b183109161
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -390,7 +390,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 1 m_VerticalOverflow: 1
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: m_Text: "s\ts"
--- !u!222 &433695810 --- !u!222 &433695810
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1627,7 +1627,8 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children:
- {fileID: 1662670615125641637}
m_Father: {fileID: 1547547273} m_Father: {fileID: 1547547273}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
@ -1881,6 +1882,135 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2043343453} m_GameObject: {fileID: 2043343453}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1001 &1662670615125641636
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1896827481}
m_Modifications:
- target: {fileID: 1747880209013804715, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_Name
value: "\u6CE8\u9500\u9875"
objectReference: {fileID: 0}
- target: {fileID: 1747880209013804715, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 41893f404b95b1f48a41f3b183109161, type: 3}
--- !u!224 &1662670615125641637 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 6964046110211341229, guid: 41893f404b95b1f48a41f3b183109161,
type: 3}
m_PrefabInstance: {fileID: 1662670615125641636}
m_PrefabAsset: {fileID: 0}
--- !u!1660057539 &9223372036854775807 --- !u!1660057539 &9223372036854775807
SceneRoots: SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -100,6 +100,7 @@ namespace Kill.Managers
public class BoolData public class BoolData
{ {
public bool registered; public bool registered;
public bool hasPassword;
} }
public class VerifyCodeRequest public class VerifyCodeRequest
{ {
@ -118,6 +119,11 @@ namespace Kill.Managers
public string password; public string password;
public int password_type; public int password_type;
} }
public class CancelAccountRequest
{
public string email;
public string code;
}
public class FireBaseLoginRequest public class FireBaseLoginRequest
{ {
public string firebase_token; public string firebase_token;

View File

@ -309,9 +309,9 @@ namespace Kill.UI.Pages
#region #region
/// <summary> /// <summary>
/// 验证邮箱是否已注册 /// 验证邮箱是否已注册,并带回是否已设置密码
/// </summary> /// </summary>
public async Task CheckEmailRegistered(string email, Action<bool> onSuccess, Action<int, string> onError) public async Task CheckEmailRegistered(string email, Action<bool, bool> onSuccess, Action<int, string> onError)
{ {
LoadingUI.Show(); LoadingUI.Show();
@ -330,7 +330,13 @@ namespace Kill.UI.Pages
Debug.Log(data.data.registered); Debug.Log(data.data.registered);
// 安全访问,防止 data 或 data.data 为 null // 安全访问,防止 data 或 data.data 为 null
bool isRegistered = data?.data?.registered ?? false; bool isRegistered = data?.data?.registered ?? false;
onSuccess?.Invoke(isRegistered); bool isPasswordSet = data?.data?.hasPassword ?? false;
// 未设置密码时弹出提示
if (isRegistered && !isPasswordSet)
{
ToastUI.Show("100335");
}
onSuccess?.Invoke(isRegistered, isPasswordSet);
}, },
onError: onError onError: onError
); );

View File

@ -89,15 +89,29 @@ namespace Kill.UI.Pages
// 验证邮箱是否已注册 // 验证邮箱是否已注册
await LoginPageCtrl.Instance.CheckEmailRegistered(email, await LoginPageCtrl.Instance.CheckEmailRegistered(email,
onSuccess: (data) => onSuccess: (registered, passwordSet) =>
{ {
if (data) if (!registered)
{ {
errorText.text = LanguageManager.Instance.GetLanguage("100035");
return;
}
if (passwordSet)
{
// 已注册且已设置密码,走密码登录
ShowPage(LoginPageCtrl.SubPageType.LoginPassword); ShowPage(LoginPageCtrl.SubPageType.LoginPassword);
} }
else else
{ {
errorText.text = LanguageManager.Instance.GetLanguage("100035"); // 已注册但未设置密码(如通过苹果登录创建的账号),
// 走 验证码 + 设置密码 流程,不进入密码输入页
var verifyPanel = GetSubPage(LoginPageCtrl.SubPageType.VerificationCode) as VerificationCodePanel;
if (verifyPanel != null)
{
verifyPanel.SetSceneType(VerificationCodePanel.CodeSceneType.ResetPassword);
}
ShowPage(LoginPageCtrl.SubPageType.VerificationCode);
} }
}, },
onError: (code, message) => onError: (code, message) =>

View File

@ -63,9 +63,9 @@ namespace Kill.UI.Pages
LoginPageCtrl.Instance.SetCurrentEmail(email); LoginPageCtrl.Instance.SetCurrentEmail(email);
// 验证邮箱是否已注册 // 验证邮箱是否已注册
await LoginPageCtrl.Instance.CheckEmailRegistered(email, await LoginPageCtrl.Instance.CheckEmailRegistered(email,
onSuccess: async (data) => onSuccess: async (registered, passwordSet) =>
{ {
if (data) if (registered)
{ {
errorText.text = LanguageManager.Instance.GetLanguage("100007"); errorText.text = LanguageManager.Instance.GetLanguage("100007");
} }

View File

@ -0,0 +1,166 @@
using System;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using Kill.Managers;
using Kill.Network;
using Kill.UI.Components;
namespace Kill.UI.Pages
{
/// <summary>
/// 注销账号页面(提示确认 -> 验证码(复用SelfVerificationCodePanel) -> 最终确认)
/// 在 SelfInfoPage 中通过 cancelAccountPagePrefab 实例化Init 传入返回回调
/// </summary>
public class SelfCancelAccountPage : MonoBehaviour
{
[Header("提示界面1提示确认")]
public GameObject stepConfirm;
public Button confirmNextBtn; // 确认,进入验证码
public Button step1CancelBtn; // 取消,关闭页面
[Header("验证码页(复用 SelfVerificationCodePanel")]
public SelfVerificationCodePanel verificationCodePanelPrefab;
[Header("提示界面2最终确认")]
public GameObject stepFinal;
public Button finalConfirmBtn; // 确认注销
public Button step3BackBtn; // 返回
private Action onBackCallback;
private string verifyCode; // 校验通过的验证码
private bool isSubmitting = false;
private SelfVerificationCodePanel verificationCodePanel;
public void Init(Action onBack)
{
onBackCallback = onBack;
UIManager.Instance.RegisterBackAction(OnBack);
// 提示界面1
if (confirmNextBtn != null)
{
confirmNextBtn.onClick.RemoveAllListeners();
confirmNextBtn.onClick.AddListener(OnConfirmNext);
}
if (step1CancelBtn != null)
{
step1CancelBtn.onClick.RemoveAllListeners();
step1CancelBtn.onClick.AddListener(OnBack);
}
// 提示界面2
if (finalConfirmBtn != null)
{
finalConfirmBtn.onClick.RemoveAllListeners();
finalConfirmBtn.onClick.AddListener(OnFinalConfirm);
}
if (step3BackBtn != null)
{
step3BackBtn.onClick.RemoveAllListeners();
step3BackBtn.onClick.AddListener(OnBack);
}
// 默认显示提示界面1
ShowStep(stepConfirm);
}
/// <summary>
/// 切换显示步骤
/// </summary>
private void ShowStep(GameObject step)
{
if (stepConfirm != null) stepConfirm.SetActive(step == stepConfirm);
if (stepFinal != null) stepFinal.SetActive(step == stepFinal);
}
/// <summary>
/// 提示界面1确认打开验证码面板注销场景
/// </summary>
private void OnConfirmNext()
{
stepConfirm.SetActive(false);
if (verificationCodePanelPrefab == null)
return;
verificationCodePanel = Instantiate(verificationCodePanelPrefab, transform);
verificationCodePanel.gameObject.SetActive(true);
verificationCodePanel.Init(OnVerifySuccess, OnBack, SelfVerificationCodePanel.VerificationScene.CancelAccount);
}
/// <summary>
/// 验证码校验成功,进入最终确认
/// </summary>
private void OnVerifySuccess()
{
verifyCode = verificationCodePanel != null ? verificationCodePanel.VerifiedCode : "";
if (verificationCodePanel != null)
{
Destroy(verificationCodePanel.gameObject);
verificationCodePanel = null;
}
ShowStep(stepFinal);
}
/// <summary>
/// 提示界面2最终确认执行注销
/// </summary>
private async void OnFinalConfirm()
{
if (isSubmitting)
return;
isSubmitting = true;
LoadingUI.Show();
var requestData = new CancelAccountRequest
{
email = DataManager.Instance.userInfo.email,
code = verifyCode
};
try
{
var response = await NetworkCtrl.Instance.Post<NoDataResponse>("/api/v1/user/cancel", requestData);
LoadingUI.Hide();
ResponseCodeHandler.HandleResponse(response,
onSuccess: (data) =>
{
isSubmitting = false;
DataManager.Instance.ClearInfo();
UIManager.Instance.OpenMainPage(UIManager.PageName.loginPage);
},
onError: (code, message) =>
{
isSubmitting = false;
// 验证码错误或已过期
if (code == 603)
{
ToastUI.Show("100342");
}
// 其他原因注销失败
else
{
ToastUI.Show("100343");
}
// 回到注销账号页最初状态提示界面1
verifyCode = "";
ShowStep(stepConfirm);
}
);
}
catch (Exception ex)
{
LoadingUI.Hide();
isSubmitting = false;
Debug.LogError("注销账号异常: " + ex.Message);
ToastUI.ShowText(ex.Message);
}
}
public void OnBack()
{
UIManager.Instance.RegisterBackAction(onBackCallback);
Destroy(gameObject);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9207ecce45d1d9c469027c9f85ab09b8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -23,7 +23,7 @@ namespace Kill.UI.Pages
public Text countryText; public Text countryText;
public Button selectCountryButton; public Button selectCountryButton;
List<string> passwordSetKeys = new List<string> { "100200", "100201" }; List<string> passwordSetKeys = new List<string> { "100200", "100201" };
public Button signoutButton;
/// <summary> /// <summary>
/// 0设置 1修改 /// 0设置 1修改
/// </summary> /// </summary>
@ -33,6 +33,11 @@ namespace Kill.UI.Pages
/// 0简单密码 1复杂密码 /// 0简单密码 1复杂密码
/// </summary> /// </summary>
public Button resetPassword; public Button resetPassword;
/// <summary>
/// 注销账号入口
/// </summary>
public Button cancelAccountButton;
public SelfCancelAccountPage cancelAccountPagePrefab;
public async Task Init(UserInfo userInfo) public async Task Init(UserInfo userInfo)
{ {
this.userInfo = userInfo; this.userInfo = userInfo;
@ -41,14 +46,18 @@ namespace Kill.UI.Pages
backButton.onClick.AddListener(OnBack); backButton.onClick.AddListener(OnBack);
resetPassword.onClick.RemoveAllListeners(); resetPassword.onClick.RemoveAllListeners();
resetPassword.onClick.AddListener(OnSetPassword); resetPassword.onClick.AddListener(OnSetPassword);
// 注销账号入口
if (cancelAccountButton != null)
{
cancelAccountButton.onClick.RemoveAllListeners();
cancelAccountButton.onClick.AddListener(OnCancelAccount);
}
renameButton.onClick.RemoveAllListeners(); renameButton.onClick.RemoveAllListeners();
renameButton.onClick.AddListener(() => renameButton.onClick.AddListener(() =>
{ {
RenamePage renamePage = Instantiate(renamePagePrefab, transform); RenamePage renamePage = Instantiate(renamePagePrefab, transform);
renamePage.Init(userInfo.username, CloseRenamePage, 1); renamePage.Init(userInfo.username, CloseRenamePage, 1);
}); });
signoutButton.onClick.RemoveAllListeners();
signoutButton.onClick.AddListener(ClickSignOut);
// 在这里初始化个人信息页面,显示用户信息 // 在这里初始化个人信息页面,显示用户信息
if (avatarImage != null) if (avatarImage != null)
{ {
@ -129,6 +138,22 @@ namespace Kill.UI.Pages
verificationCodePanel = Instantiate(verificationCodePanelPrefab, transform); verificationCodePanel = Instantiate(verificationCodePanelPrefab, transform);
verificationCodePanel.Init(OnSureVerificationCode, OnBack); verificationCodePanel.Init(OnSureVerificationCode, OnBack);
} }
SelfCancelAccountPage cancelAccountPage;
/// <summary>
/// 打开注销账号页面
/// </summary>
public void OnCancelAccount()
{
if (cancelAccountPagePrefab == null)
return;
cancelAccountPage = Instantiate(cancelAccountPagePrefab, transform);
cancelAccountPage.Init(OnCancelAccountBack);
cancelAccountPage.gameObject.SetActive(true);
}
void OnCancelAccountBack()
{
UIManager.Instance.RegisterBackAction(OnBack);
}
SelfSetPasswordPanel setPasswordPanel; SelfSetPasswordPanel setPasswordPanel;
public void OnSureVerificationCode() public void OnSureVerificationCode()
{ {
@ -139,7 +164,7 @@ namespace Kill.UI.Pages
public void OnSetPasswordSuccess() public void OnSetPasswordSuccess()
{ {
Destroy(setPasswordPanel.gameObject); Destroy(setPasswordPanel.gameObject);
OnSignOut(); GetComponentInParent<SelfPage>().OnSignOut();
} }
public void OnBack() public void OnBack()
@ -148,19 +173,7 @@ namespace Kill.UI.Pages
GetComponentInParent<SelfPage>().RefreshAsync(); GetComponentInParent<SelfPage>().RefreshAsync();
Destroy(gameObject); Destroy(gameObject);
} }
public WindowTipCtrl signoutTip;
public void ClickSignOut()
{
signoutTip.gameObject.SetActive(true);
signoutTip.Init(OnSignOut,()=>{signoutTip.gameObject.SetActive(false);});
}
public void OnSignOut()
{
// 清除用户数据
DataManager.Instance.ClearInfo();
// 返回登录页面
UIManager.Instance.OpenMainPage(UIManager.PageName.loginPage);
}
} }

View File

@ -40,6 +40,8 @@ namespace Kill.UI.Pages
languageSettingButton.onClick.AddListener(OnChangeLanguage); languageSettingButton.onClick.AddListener(OnChangeLanguage);
safetySettingButton.onClick.RemoveAllListeners(); safetySettingButton.onClick.RemoveAllListeners();
safetySettingButton.onClick.AddListener(EnterSafetySettingPage); safetySettingButton.onClick.AddListener(EnterSafetySettingPage);
signoutButton.onClick.RemoveAllListeners();
signoutButton.onClick.AddListener(ClickSignOut);
await RefreshAsync(); await RefreshAsync();
} }
@ -128,6 +130,20 @@ namespace Kill.UI.Pages
deviceTeachingPage.gameObject.SetActive(true); deviceTeachingPage.gameObject.SetActive(true);
deviceTeachingPage.Init(()=>{UIManager.Instance.RegisterBackAction(OnBack);}); deviceTeachingPage.Init(()=>{UIManager.Instance.RegisterBackAction(OnBack);});
} }
public Button signoutButton;
public WindowTipCtrl signoutTip;
public void ClickSignOut()
{
signoutTip.gameObject.SetActive(true);
signoutTip.Init(OnSignOut,()=>{signoutTip.gameObject.SetActive(false);});
}
public void OnSignOut()
{
// 清除用户数据
DataManager.Instance.ClearInfo();
// 返回登录页面
UIManager.Instance.OpenMainPage(UIManager.PageName.loginPage);
}
} }
} }

View File

@ -14,6 +14,14 @@ namespace Kill.UI.Pages
/// </summary> /// </summary>
public class SelfVerificationCodePanel : MonoBehaviour public class SelfVerificationCodePanel : MonoBehaviour
{ {
/// <summary>
/// 验证码使用场景
/// </summary>
public enum VerificationScene
{
SetPassword, // 设置/重置密码
CancelAccount // 注销账号
}
[Header("显示")] [Header("显示")]
public Text countdownText; public Text countdownText;
public Text emailText; public Text emailText;
@ -32,11 +40,18 @@ namespace Kill.UI.Pages
public Button backButton; public Button backButton;
Action onSuccessCallback; Action onSuccessCallback;
Action onBackCallback; Action onBackCallback;
public void Init(Action onsuccess, Action onback) public VerificationScene sceneType = VerificationScene.SetPassword;
/// <summary>
/// 校验通过的验证码(校验成功后有效)
/// </summary>
public string VerifiedCode { get; private set; }
public void Init(Action onsuccess, Action onback, VerificationScene scene = VerificationScene.SetPassword)
{ {
onSuccessCallback=onsuccess; onSuccessCallback=onsuccess;
onBackCallback=onback; onBackCallback=onback;
UIManager.Instance.RegisterBackAction(OnBack); sceneType = scene;
if(scene==VerificationScene.SetPassword)
UIManager.Instance.RegisterBackAction(OnBack);
backButton.onClick.RemoveAllListeners(); backButton.onClick.RemoveAllListeners();
backButton.onClick.AddListener(OnBack); backButton.onClick.AddListener(OnBack);
if (codeInput != null) if (codeInput != null)
@ -84,10 +99,18 @@ namespace Kill.UI.Pages
private async Task OnConfirm() private async Task OnConfirm()
{ {
string code = codeInput != null ? codeInput.GetCode() : ""; string code = codeInput != null ? codeInput.GetCode() : "";
// 注销账号场景:不单独校验验证码,直接使用(由注销接口校验)
if (sceneType == VerificationScene.CancelAccount)
{
VerifiedCode = code;
onSuccessCallback?.Invoke();
return;
}
// 验证验证码 // 验证验证码
VerifyCode(emailText.text, code, VerifyCode(emailText.text, code,
onSuccess: () => onSuccess: () =>
{ {
VerifiedCode = code;
onSuccessCallback?.Invoke(); onSuccessCallback?.Invoke();
}, },
onError: (code, message) => onError: (code, message) =>