Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
4d1dd983
Commit
4d1dd983
authored
Jun 06, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 企业认证fragment切换
parent
cecbb46d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
11 deletions
+48
-11
LifeAccountEnterpriseAuthActivity.kt
.../newscontent/ui/auth/LifeAccountEnterpriseAuthActivity.kt
+38
-10
LifeAccountIDCardAuthFragment.kt
...quan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
+8
-0
LifeAccountPersonalAuthActivity.kt
...an/newscontent/ui/auth/LifeAccountPersonalAuthActivity.kt
+2
-1
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountEnterpriseAuthActivity.kt
View file @
4d1dd983
...
...
@@ -40,6 +40,11 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
)
}
/**
* 当前显示的fragment
*/
private
var
curFragment
:
Fragment
?
=
null
override
fun
createViewBinding
():
ActivityLifeAccountEnterpriseAuthBinding
{
return
ActivityLifeAccountEnterpriseAuthBinding
.
inflate
(
layoutInflater
)
}
...
...
@@ -54,8 +59,7 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
initListener
()
// 默认企业资质Fragment
viewBind
.
pvAuthProcess
.
setProcess
(
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_QUALIFICATION
)
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
fragment_container
,
fragmentList
[
0
]).
commit
()
switchFragment
(
fragmentList
[
0
])
}
private
fun
initView
()
{
...
...
@@ -102,6 +106,35 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
}
}
/**
* fragment切换
*/
private
fun
switchFragment
(
targetFragment
:
Fragment
)
{
when
{
// 当前无fragment被添加
curFragment
==
null
->
{
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
fragment_container
,
targetFragment
)
.
commit
()
}
// 目标fragment已被添加
targetFragment
.
isAdded
->
{
curFragment
?.
let
{
supportFragmentManager
.
beginTransaction
().
hide
(
it
).
show
(
targetFragment
)
.
commit
()
}
}
// 目前fragment没被添加
else
->
{
curFragment
?.
let
{
supportFragmentManager
.
beginTransaction
().
hide
(
it
)
.
add
(
R
.
id
.
fragment_container
,
targetFragment
).
commit
()
}
}
}
curFragment
=
targetFragment
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_back
->
{
...
...
@@ -114,10 +147,8 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
viewBind
.
svMerchantType
.
enableSelect
(
true
)
}
// 回退fragment
supportFragmentManager
.
beginTransaction
().
replace
(
R
.
id
.
fragment_container
,
fragmentList
[
viewBind
.
pvAuthProcess
.
curProcess
]
).
commit
()
switchFragment
(
fragmentList
[
viewBind
.
pvAuthProcess
.
curProcess
])
checkNextCondition
()
}
}
R
.
id
.
sv_merchant_type
->
{
...
...
@@ -187,10 +218,7 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
)
fragment
.
arguments
=
bundle
supportFragmentManager
.
beginTransaction
()
.
replace
(
R
.
id
.
fragment_container
,
fragment
).
commit
()
switchFragment
(
fragment
)
checkNextCondition
()
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
View file @
4d1dd983
...
...
@@ -105,6 +105,14 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
return
FragmentLifeAccountIdCardAuthBinding
.
inflate
(
layoutInflater
,
container
,
false
)
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
super
.
onHiddenChanged
(
hidden
)
if
(!
hidden
)
{
// fragment显示
initView
()
}
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initView
()
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountPersonalAuthActivity.kt
View file @
4d1dd983
...
...
@@ -37,7 +37,6 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
.
add
(
R
.
id
.
fragment_container
,
LifeAccountIDCardAuthFragment
()).
commit
()
initView
()
initListener
()
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
=
"工程师"
}
private
fun
initView
()
{
...
...
@@ -72,6 +71,8 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
R
.
id
.
iv_back
->
XPageManager
.
pop
(
null
)
R
.
id
.
sv_occupation
->
{
// TODO: 5/27/21 跳转职业标签选择 选择完成后进行下一步检查
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
=
"工程师"
viewBind
.
svOccupation
.
setContentResult
(
"工程师"
)
}
R
.
id
.
btn_next
->
{
// 个人认证 完成认证
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment