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
67014c68
Commit
67014c68
authored
Jun 11, 2021
by
shiyuelong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 员工管理页面搭建完成
parent
205d0c15
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
467 additions
and
118 deletions
+467
-118
AndroidManifest.xml
Components/newscontent/src/main/AndroidManifest.xml
+1
-0
NewsContentApplication.kt
...an/shenghuoquan/newscontent/app/NewsContentApplication.kt
+6
-6
MyStaffListAdapter.kt
...oquan/newscontent/personnel/adapter/MyStaffListAdapter.kt
+11
-4
AccountListDto.kt
...shenghuoquan/newscontent/personnel/bean/AccountListDto.kt
+38
-37
PersonalRemoteDataSource.kt
...an/newscontent/personnel/http/PersonalRemoteDataSource.kt
+40
-4
ManagerChangeActivity.kt
...huoquan/newscontent/personnel/ui/ManagerChangeActivity.kt
+2
-2
MyStaffActivity.kt
.../shenghuoquan/newscontent/personnel/ui/MyStaffActivity.kt
+12
-0
StaffInfoActivity.kt
...henghuoquan/newscontent/personnel/ui/StaffInfoActivity.kt
+51
-0
StaffManageActivity.kt
...nghuoquan/newscontent/personnel/ui/StaffManageActivity.kt
+67
-0
LoginLifeCircleActivity.kt
...an/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
+1
-0
HintDialog.kt
...m/yidian/shenghuoquan/newscontent/ui/dialog/HintDialog.kt
+71
-54
activity_staff_info.xml
...s/newscontent/src/main/res/layout/activity_staff_info.xml
+83
-4
activity_staff_manage.xml
...newscontent/src/main/res/layout/activity_staff_manage.xml
+83
-4
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+1
-3
No files found.
Components/newscontent/src/main/AndroidManifest.xml
View file @
67014c68
...
...
@@ -98,6 +98,7 @@
<activity
android:name=
".personnel.ui.MyStaffActivity"
android:launchMode=
"singleTask"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.ManagerInfoActivity"
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/app/NewsContentApplication.kt
View file @
67014c68
...
...
@@ -90,7 +90,7 @@ class NewsContentApplication : YdBaseApplication() {
intent
.
putExtra
(
XRouterPathConstants
.
ParamsKey
,
params
as
HashMap
)
}
intent
.
setClass
(
context
,
LoginLifeCircleActivity
::
class
.
java
)
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
intent
.
flags
=
(
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
or
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
context
.
startActivity
(
intent
)
}
}),
...
...
@@ -259,7 +259,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
}
}),
XPageNode
(
PERSONAL_MANAGER_CHANGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_MANAGER_CHANGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
if
(
params
!=
null
)
{
...
...
@@ -270,7 +270,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
}
}),
XPageNode
(
PERSONAL_STAFF_INFO
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_STAFF_INFO
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
if
(
params
!=
null
)
{
...
...
@@ -281,7 +281,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
}
}),
XPageNode
(
PERSONAL_STAFF_MANAGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_STAFF_MANAGE
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
if
(
params
!=
null
)
{
...
...
@@ -292,7 +292,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
}
}),
XPageNode
(
PERSONAL_ADD_STAFF
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
PERSONAL_ADD_STAFF
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
if
(
params
!=
null
)
{
...
...
@@ -303,7 +303,7 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
}
}),
XPageNode
(
SYSTEM_SETTING
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
XPageNode
(
SYSTEM_SETTING
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
if
(
params
!=
null
)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/adapter/MyStaffListAdapter.kt
View file @
67014c68
...
...
@@ -3,9 +3,11 @@ package com.yidian.shenghuoquan.newscontent.personnel.adapter
import
android.widget.TextView
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.yidian.common.XRouterPathConstants
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.utils.ToastUtil
import
com.yidian.xpage.XPageManager
/**
* 我的员工列表的适配器
...
...
@@ -17,15 +19,20 @@ class MyStaffListAdapter : BaseQuickAdapter<AccountUser, BaseViewHolder>(R.layou
holder
.
getView
<
TextView
>(
R
.
id
.
tv_mobile
).
text
=
item
.
mobile
if
(!
item
.
roleList
.
isNullOrEmpty
())
{
val
sb
=
StringBuilder
()
item
.
roleList
.
forEach
{
sb
.
append
(
"$it|"
)
item
.
roleList
.
forEachIndexed
{
index
,
s
->
sb
.
append
(
s
)
if
(
index
<
item
.
roleList
.
size
-
1
)
{
sb
.
append
(
"|"
)
}
}
holder
.
getView
<
TextView
>(
R
.
id
.
tv_role_list
).
text
=
sb
}
// 点击管理,进入员工
信息
// 点击管理,进入员工
管理
holder
.
getView
<
TextView
>(
R
.
id
.
tv_manage
).
setOnClickListener
{
ToastUtil
.
showToast
(
context
,
"点击${item.nickName}"
)
val
hashMap
=
HashMap
<
String
,
Any
?>()
hashMap
[
"staffInfo"
]
=
item
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_STAFF_MANAGE
,
hashMap
)
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/bean/AccountListDto.kt
View file @
67014c68
...
...
@@ -8,47 +8,48 @@ import kotlinx.android.parcel.Parcelize
* 账号列表数据类
*/
data class
AccountListDto
(
@SerializedName
(
"admin"
)
val
admin
:
List
<
AccountAdmin
>?
=
null
,
@SerializedName
(
"users"
)
val
users
:
List
<
AccountUser
>?
=
null
@SerializedName
(
"admin"
)
val
admin
:
List
<
AccountAdmin
>?
=
null
,
@SerializedName
(
"users"
)
val
users
:
List
<
AccountUser
>?
=
null
)
@Parcelize
data class
AccountAdmin
(
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
@SerializedName
(
"merchant_id"
)
val
merchantId
:
Int
?
=
null
,
@SerializedName
(
"mobile"
)
val
mobile
:
String
?
=
null
,
@SerializedName
(
"nick_name"
)
val
nickName
:
String
?
=
null
,
@SerializedName
(
"role_list"
)
val
roleList
:
List
<
String
>?
=
null
,
@SerializedName
(
"role_type"
)
val
roleType
:
Int
?
=
null
,
@SerializedName
(
"show_button"
)
val
showButton
:
Int
?
=
null
,
@SerializedName
(
"user_id"
)
val
userId
:
Long
?
=
null
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
@SerializedName
(
"merchant_id"
)
val
merchantId
:
Int
?
=
null
,
@SerializedName
(
"mobile"
)
val
mobile
:
String
?
=
null
,
@SerializedName
(
"nick_name"
)
val
nickName
:
String
?
=
null
,
@SerializedName
(
"role_list"
)
val
roleList
:
List
<
String
>?
=
null
,
@SerializedName
(
"role_type"
)
val
roleType
:
Int
?
=
null
,
@SerializedName
(
"show_button"
)
val
showButton
:
Int
?
=
null
,
@SerializedName
(
"user_id"
)
val
userId
:
Long
?
=
null
)
:
Parcelable
@Parcelize
data class
AccountUser
(
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
@SerializedName
(
"merchant_id"
)
val
merchantId
:
Int
?
=
null
,
@SerializedName
(
"mobile"
)
val
mobile
:
String
?
=
null
,
@SerializedName
(
"nick_name"
)
val
nickName
:
String
?
=
null
,
@SerializedName
(
"role_list"
)
val
roleList
:
List
<
String
>?
=
null
,
@SerializedName
(
"role_type"
)
val
roleType
:
Int
?
=
null
,
@SerializedName
(
"show_button"
)
val
showButton
:
Int
?
=
null
,
@SerializedName
(
"user_id"
)
val
userId
:
Int
?
=
null
)
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
@SerializedName
(
"merchant_id"
)
val
merchantId
:
Int
?
=
null
,
@SerializedName
(
"mobile"
)
val
mobile
:
String
?
=
null
,
@SerializedName
(
"nick_name"
)
val
nickName
:
String
?
=
null
,
@SerializedName
(
"role_list"
)
val
roleList
:
List
<
String
>?
=
null
,
@SerializedName
(
"role_type"
)
val
roleType
:
Int
?
=
null
,
@SerializedName
(
"show_button"
)
val
showButton
:
Int
?
=
null
,
@SerializedName
(
"user_id"
)
val
userId
:
Int
?
=
null
)
:
Parcelable
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/http/PersonalRemoteDataSource.kt
View file @
67014c68
...
...
@@ -6,10 +6,7 @@ import com.yidian.common.http.HttpResultSubscriber
import
com.yidian.common.http.TransformUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalAccountListCallback
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalChangeAccountCallBack
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalCheckSmsCodeCallBack
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalGetSmsCodeCallBack
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.*
/**
* 人员管理远程数据源
...
...
@@ -100,4 +97,43 @@ object PersonalRemoteDataSource {
})
}
/**
* 添加非管理员
*/
fun
postAddUser
(
apiCallback
:
IPersonalAddUserCallBack
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
api
.
postAddUser
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
?
>?)
{
apiCallback
.
addUserSuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
?
>?)
{
}
})
}
/**
* 解除关系
*/
fun
getDissolveRelationship
(
apiCallback
:
IPersonalDissolveCallBack
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
api
.
getDissolveRelationship
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
?
>?)
{
apiCallback
.
dissolveSuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
?
>?)
{
}
})
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/ManagerChangeActivity.kt
View file @
67014c68
...
...
@@ -301,10 +301,10 @@ class ManagerChangeActivity : BaseActivity<ActivityManagerChangeBinding>() {
}
override
fun
onRightOption
()
{
XPageManager
.
push
(
XRouterPathConstants
.
LOGIN_LIFE_CIRCLE
,
null
)
ToastUtil
.
showToast
(
this
@ManagerChangeActivity
,
"进入登录页面"
)
}
})
}).
show
()
}
override
fun
onDestroy
()
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/MyStaffActivity.kt
View file @
67014c68
...
...
@@ -10,6 +10,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityMyStaffBinding
import
com.yidian.shenghuoquan.newscontent.personnel.adapter.MyStaffListAdapter
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountAdmin
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.personnel.http.callback.IPersonalAccountListCallback
import
com.yidian.shenghuoquan.newscontent.personnel.http.PersonalRemoteDataSource
import
com.yidian.xpage.XPageManager
...
...
@@ -35,6 +36,10 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
super
.
init
(
savedInstanceState
)
initClick
()
initView
()
}
override
fun
onResume
()
{
super
.
onResume
()
requestAccountList
()
}
...
...
@@ -70,6 +75,13 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
viewBind
.
tvAddStaff
.
setOnClickListener
{
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_ADD_STAFF
,
null
)
}
// 点击员工信息
myStaffAdapter
.
setOnItemChildClickListener
{
adapter
,
_
,
position
->
val
user
=
adapter
.
data
[
position
]
as
AccountUser
val
hashMap
=
HashMap
<
String
,
Any
?>()
hashMap
[
"staffInfo"
]
=
user
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_STAFF_INFO
,
hashMap
)
}
}
override
fun
getAccountListSuccess
(
response
:
AccountListDto
?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/StaffInfoActivity.kt
View file @
67014c68
package
com.yidian.shenghuoquan.newscontent.personnel.ui
import
android.content.Intent
import
android.os.Bundle
import
androidx.core.content.ContextCompat
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_INFO
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffInfoBinding
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.utils.SensitiveInfoUtil
import
com.yidian.xpage.XPageManager
/**
* 员工信息
*/
class
StaffInfoActivity
:
BaseActivity
<
ActivityStaffInfoBinding
>()
{
private
var
staffInfo
:
AccountUser
?
=
null
override
fun
createViewBinding
():
ActivityStaffInfoBinding
{
return
ActivityStaffInfoBinding
.
inflate
(
layoutInflater
)
}
...
...
@@ -16,4 +26,45 @@ class StaffInfoActivity : BaseActivity<ActivityStaffInfoBinding>() {
override
fun
getXPageName
():
String
{
return
PERSONAL_STAFF_INFO
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initTitle
()
getIntentData
(
intent
)
}
private
fun
initTitle
()
{
viewBind
.
include
.
tvTitle
.
text
=
"员工信息"
viewBind
.
include
.
ivBack
.
setOnClickListener
{
XPageManager
.
pop
(
null
)
}
viewBind
.
include
.
tvMenu
.
text
=
"管理"
viewBind
.
include
.
tvMenu
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_1852F1
))
viewBind
.
include
.
tvMenu
.
setOnClickListener
{
val
hashMap
=
HashMap
<
String
,
Any
?>()
hashMap
[
"staffInfo"
]
=
staffInfo
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_STAFF_MANAGE
,
hashMap
)
}
}
private
fun
getIntentData
(
intent
:
Intent
?)
{
val
paramsMap
=
intent
?.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
if
(
paramsMap
!=
null
)
{
paramsMap
as
HashMap
<*,
*>
staffInfo
=
paramsMap
[
"staffInfo"
]
as
AccountUser
viewBind
.
tvUserName
.
text
=
staffInfo
?.
nickName
viewBind
.
tvLoginAccount
.
text
=
staffInfo
?.
mobile
?.
let
{
SensitiveInfoUtil
.
mobileEncrypt
(
it
)
}
val
sb
=
StringBuilder
()
staffInfo
?.
roleList
?.
forEachIndexed
{
index
,
s
->
sb
.
append
(
s
)
if
(
index
<
staffInfo
!!
.
roleList
!!
.
size
-
1
)
{
sb
.
append
(
"|"
)
}
}
viewBind
.
tvCurrentRole
.
text
=
sb
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/StaffManageActivity.kt
View file @
67014c68
package
com.yidian.shenghuoquan.newscontent.personnel.ui
import
android.content.Intent
import
android.os.Bundle
import
androidx.core.content.ContextCompat
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_MANAGE
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.bean.HintOptionBean
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffManageBinding
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.shenghuoquan.newscontent.ui.dialog.HintDialog
import
com.yidian.shenghuoquan.newscontent.utils.SensitiveInfoUtil
import
com.yidian.xpage.XPageManager
/**
* 人员管理 —— 员工管理页面
...
...
@@ -16,4 +26,61 @@ class StaffManageActivity : BaseActivity<ActivityStaffManageBinding>() {
override
fun
getXPageName
():
String
{
return
PERSONAL_STAFF_MANAGE
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initTitle
()
getIntentData
(
intent
)
}
private
fun
initTitle
()
{
viewBind
.
include
.
tvTitle
.
text
=
"员工管理"
viewBind
.
include
.
ivBack
.
setOnClickListener
{
XPageManager
.
pop
(
null
)
}
viewBind
.
include
.
tvMenu
.
text
=
"解除关系"
viewBind
.
include
.
tvMenu
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FFFF3A3A
))
viewBind
.
include
.
tvMenu
.
setOnClickListener
{
showConfirmDialog
()
}
}
private
fun
getIntentData
(
intent
:
Intent
?)
{
val
paramsMap
=
intent
?.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
if
(
paramsMap
!=
null
)
{
paramsMap
as
HashMap
<*,
*>
val
staffInfo
=
paramsMap
[
"staffInfo"
]
as
AccountUser
viewBind
.
tvUserName
.
text
=
staffInfo
.
nickName
viewBind
.
tvLoginAccount
.
text
=
staffInfo
.
mobile
?.
let
{
SensitiveInfoUtil
.
mobileEncrypt
(
it
)
}
val
sb
=
StringBuilder
()
staffInfo
.
roleList
?.
forEachIndexed
{
index
,
s
->
sb
.
append
(
s
)
if
(
index
<
staffInfo
.
roleList
.
size
-
1
)
{
sb
.
append
(
"|"
)
}
}
viewBind
.
tvCurrentRole
.
text
=
sb
}
}
private
fun
showConfirmDialog
()
{
val
dialog
=
HintDialog
(
this
,
resources
.
getString
(
R
.
string
.
dissolve_relationship
),
arrayListOf
(
HintOptionBean
(
"关闭"
),
HintOptionBean
(
"解除关系"
)),
object
:
HintDialog
.
OnHintOptionCallback
{
override
fun
onLeftOption
()
{
}
override
fun
onRightOption
()
{
// 返回员工列表并刷新
XPageManager
.
push
(
XRouterPathConstants
.
PERSONAL_MY_STAFF
,
null
)
}
})
dialog
.
setRightBtnColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FFFF3A3A
))
dialog
.
show
()
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
View file @
67014c68
...
...
@@ -47,6 +47,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
}
private
fun
initView
()
{
Hawk
.
put
(
HawkConfig
.
LoginStatus
,
false
)
setLoginButtonStatus
(
false
)
mCountDownTimerUtils
=
CountDownTimerUtils
(
viewBind
.
tvGetCode
,
60000
,
1000
)
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/dialog/HintDialog.kt
View file @
67014c68
...
...
@@ -4,6 +4,8 @@ import android.content.Context
import
android.os.Bundle
import
android.view.View
import
android.view.WindowManager
import
androidx.annotation.ColorInt
import
androidx.core.content.ContextCompat
import
androidx.core.view.isVisible
import
com.yidian.common.base.BaseDialog
import
com.yidian.shenghuoquan.newscontent.R
...
...
@@ -18,68 +20,83 @@ import com.yidian.utils.DensityUtil
* description: 提示dialog
*/
class
HintDialog
(
context
:
Context
,
val
content
:
String
,
val
options
:
ArrayList
<
HintOptionBean
>,
val
callback
:
OnHintOptionCallback
?
)
:
BaseDialog
<
DialogHintBinding
>(
context
),
View
.
OnClickListener
{
context
:
Context
,
val
content
:
String
,
val
options
:
ArrayList
<
HintOptionBean
>,
val
callback
:
OnHintOptionCallback
?
)
:
BaseDialog
<
DialogHintBinding
>(
context
),
View
.
OnClickListener
{
override
fun
createViewBinding
():
DialogHintBinding
{
return
DialogHintBinding
.
inflate
(
layoutInflater
)
}
override
fun
createViewBinding
():
DialogHintBinding
{
return
DialogHintBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
viewBinding
.
tvContent
.
text
=
content
when
(
options
.
size
)
{
1
->
{
viewBinding
.
btnRight
.
text
=
options
[
0
].
option
viewBinding
.
btnLeft
.
isVisible
=
false
viewBinding
.
viewVerticalDivider
.
isVisible
=
false
}
2
->
{
viewBinding
.
btnLeft
.
text
=
options
[
0
].
option
viewBinding
.
btnRight
.
text
=
options
[
1
].
option
}
}
override
fun
initView
()
{
viewBinding
.
tvContent
.
text
=
content
when
(
options
.
size
)
{
1
->
{
viewBinding
.
btnRight
.
text
=
options
[
0
].
option
viewBinding
.
btnLeft
.
isVisible
=
false
viewBinding
.
viewVerticalDivider
.
isVisible
=
false
}
2
->
{
viewBinding
.
btnLeft
.
text
=
options
[
0
].
option
viewBinding
.
btnRight
.
text
=
options
[
1
].
option
}
}
}
override
fun
initListener
()
{
viewBinding
.
btnLeft
.
setOnClickListener
(
this
)
viewBinding
.
btnRight
.
setOnClickListener
(
this
)
}
override
fun
initListener
()
{
viewBinding
.
btnLeft
.
setOnClickListener
(
this
)
viewBinding
.
btnRight
.
setOnClickListener
(
this
)
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
setCanceledOnTouchOutside
(
false
)
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
setCanceledOnTouchOutside
(
false
)
}
override
fun
show
()
{
super
.
show
()
val
attrs
=
window
?.
attributes
attrs
?.
width
=
DensityUtil
.
dp2px
(
269f
)
attrs
?.
height
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
window
?.
attributes
=
attrs
}
override
fun
show
()
{
super
.
show
()
val
attrs
=
window
?.
attributes
attrs
?.
width
=
DensityUtil
.
dp2px
(
269f
)
attrs
?.
height
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
window
?.
attributes
=
attrs
}
override
fun
onClick
(
v
:
View
?)
{
if
(
v
?.
id
==
R
.
id
.
btn_left
)
{
callback
?.
onLeftOption
()
}
else
if
(
v
?.
id
==
R
.
id
.
btn_right
)
{
callback
?.
onRightOption
()
}
override
fun
onClick
(
v
:
View
?)
{
if
(
v
?.
id
==
R
.
id
.
btn_left
)
{
callback
?.
onLeftOption
()
}
else
if
(
v
?.
id
==
R
.
id
.
btn_right
)
{
callback
?.
onRightOption
()
}
// 点击左右均要关闭弹框
dismiss
()
}
interface
OnHintOptionCallback
{
/**
* 左操作项
*/
fun
onLeftOption
()
interface
OnHintOptionCallback
{
/**
* 左操作项
*/
fun
onLeftOption
()
/**
* 右操作项
*/
fun
onRightOption
()
}
/**
* 右操作项
*/
fun
onRightOption
()
}
/***
* 设置左侧按钮颜色
*/
fun
setLeftBtnColor
(
@ColorInt
color
:
Int
)
{
viewBinding
.
btnLeft
.
setTextColor
(
color
)
}
/***
* 设置右侧按钮颜色
*/
fun
setRightBtnColor
(
@ColorInt
color
:
Int
)
{
viewBinding
.
btnRight
.
setTextColor
(
color
)
}
}
\ No newline at end of file
}
Components/newscontent/src/main/res/layout/activity_staff_info.xml
View file @
67014c68
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fitsSystemWindows=
"true"
android:orientation=
"vertical"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<include
android:id=
"@+id/include"
layout=
"@layout/layout_toolbar_menu"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"用户名"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_user_name"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"登录账号"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_login_account"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"当前角色"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_current_role"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"超级管理员"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/layout/activity_staff_manage.xml
View file @
67014c68
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fitsSystemWindows=
"true"
android:orientation=
"vertical"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<include
android:id=
"@+id/include"
layout=
"@layout/layout_toolbar_menu"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"用户名"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_user_name"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"登录账号"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_login_account"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"店老大"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"@dimen/dp120"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"当前角色"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_current_role"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
tools:text=
"超级管理员"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/values/strings.xml
View file @
67014c68
...
...
@@ -147,8 +147,6 @@
<string
name=
"my_staff"
>
我的员工
</string>
<string
name=
"manager_account_change_tips"
>
管理员账号替换后,原账户将无法操作生活号所有功能,同时将自动退出当前登录状态,新账号将继承原账号所有权益。
</string>
<string
name=
"manager_register_tips"
>
未注册生活圈的手机号,登录时将自动注册,且代表你已经同意《用户协议》《隐私政策》。
</string>
<string
name=
"manager_register_tips1"
>
未注册生活圈的手机号,登录时将自动注册,且代表你
</string>
<string
name=
"manager_register_tips2"
>
已经同意
</string>
<string
name=
"manager_privacy_policy"
>
《隐私政策》
</string>
<string
name=
"dissolve_relationship"
>
解除关系后此账号将不再有权限管理企业信息,账号已产生内容仍属企业
</string>
</resources>
\ No newline at end of file
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