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
6c2cfb63
Commit
6c2cfb63
authored
Jun 08, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add我的员工页面搭建
parent
bc52f167
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
546 additions
and
77 deletions
+546
-77
.editorconfig
.editorconfig
+43
-0
build.gradle
CommonLib/Common/build.gradle
+3
-0
ResultCode.kt
...on/src/main/java/com/yidian/common/constant/ResultCode.kt
+9
-0
HttpResultSubscriber.kt
.../main/java/com/yidian/common/http/HttpResultSubscriber.kt
+57
-55
colors.xml
CommonLib/Common/src/main/res/values/colors.xml
+5
-0
MyStaffListAdapter.kt
...oquan/newscontent/personnel/adapter/MyStaffListAdapter.kt
+31
-0
AccountListDto.kt
...shenghuoquan/newscontent/personnel/bean/AccountListDto.kt
+5
-5
IPersonalAccountListCallback.kt
...ewscontent/personnel/http/IPersonalAccountListCallback.kt
+8
-0
PersonalRemoteDataSource.kt
...an/newscontent/personnel/http/PersonalRemoteDataSource.kt
+38
-0
PersonalService.kt
...henghuoquan/newscontent/personnel/http/PersonalService.kt
+60
-0
MyStaffActivity.kt
.../shenghuoquan/newscontent/personnel/ui/MyStaffActivity.kt
+54
-3
SensitiveInfoUtil.kt
...idian/shenghuoquan/newscontent/utils/SensitiveInfoUtil.kt
+29
-7
shape_manage_bg.xml
...nts/newscontent/src/main/res/drawable/shape_manage_bg.xml
+15
-0
shape_person_bg.xml
...nts/newscontent/src/main/res/drawable/shape_person_bg.xml
+8
-0
activity_my_staff.xml
...nts/newscontent/src/main/res/layout/activity_my_staff.xml
+113
-7
item_staff_list.xml
...nents/newscontent/src/main/res/layout/item_staff_list.xml
+65
-0
colors.xml
Components/newscontent/src/main/res/values/colors.xml
+1
-0
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+2
-0
No files found.
.editorconfig
0 → 100644
View file @
6c2cfb63
# 当前配置文件是否为根配置,是。
root = true
# 仅对当前项目的 kotlin 文件生效
[*.kt]
# 1. 字符编码集采用 UTF-8
charset = utf-8
# 2. 缩进时使用 空格 代替 Tab
indent_style = space
# 3. 设置缩进大小为 2 个空格
indent_size = 2
# 4. 换行结束符采用 LF, 即回车并换行.
end_of_line = lf
# 5. 文件最后一行保持空行, 若无则在格式化时自动添加.
insert_final_newline = true
# 6. 文件每一行的末尾保持空白. 若存在非可见字符, 则自动清除.
trim_trailing_whitespace = true
# 7. 最大行宽 140
max_line_length = 140
# 仅对当前项目的 java 文件生效
[*.java]
# 1. 字符编码集采用 UTF-8
charset = utf-8
# 2. 缩进时使用 空格 代替 Tab
indent_style = space
# 3. 设置缩进大小为 4 个空格
indent_size = 4
# 4. 换行结束符采用 LF, 即回车并换行.
end_of_line = lf
# 5. 文件最后一行保持空行, 若无则在格式化时自动添加.
insert_final_newline = true
# 6. 文件每一行的末尾保持空白. 若存在非可见字符, 则自动清除.
trim_trailing_whitespace = true
# 7. 最大行宽 120
max_line_length = 120
[*.md]
# MarkDown 语法中,空行含有特殊语义,此处避免在最后一行添加空行。
insert_final_newline = false
# MarkDown 语法中,尾部空格存在换行语义,此处避免删除其空格。
trim_trailing_whitespace = false
CommonLib/Common/build.gradle
View file @
6c2cfb63
...
@@ -62,4 +62,7 @@ dependencies {
...
@@ -62,4 +62,7 @@ dependencies {
api
"com.yidian.xarc:xevent:0.0.3"
api
"com.yidian.xarc:xevent:0.0.3"
api
"com.yidian.xpage:xpagenative:0.0.1"
api
"com.yidian.xpage:xpagenative:0.0.1"
implementation
files
(
'libs/openDefault-10.10.0.aar'
)
implementation
files
(
'libs/openDefault-10.10.0.aar'
)
//https://github.com/CymChad/BaseRecyclerViewAdapterHelper
api
"com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4"
}
}
\ No newline at end of file
CommonLib/Common/src/main/java/com/yidian/common/constant/ResultCode.kt
0 → 100755
View file @
6c2cfb63
package
com.yidian.common.constant
/**
* 服务器返回状态码
*/
object
ResultCode
{
const
val
SUCCESS
=
0
// 成功
const
val
INVALID
=
104000
// token失效
}
CommonLib/Common/src/main/java/com/yidian/common/http/HttpResultSubscriber.kt
View file @
6c2cfb63
...
@@ -7,76 +7,78 @@ import com.google.gson.Gson
...
@@ -7,76 +7,78 @@ import com.google.gson.Gson
import
com.google.gson.JsonParseException
import
com.google.gson.JsonParseException
import
com.google.gson.reflect.TypeToken
import
com.google.gson.reflect.TypeToken
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.constant.ResultCode
import
com.yidian.utils.ToastUtil
import
com.yidian.utils.ToastUtil
import
io.reactivex.rxjava3.core.Observer
import
io.reactivex.rxjava3.core.Observer
import
io.reactivex.rxjava3.disposables.Disposable
import
io.reactivex.rxjava3.disposables.Disposable
import
java.lang.reflect.ParameterizedType
import
java.lang.reflect.ParameterizedType
import
kotlin.reflect.typeOf
import
kotlin.reflect.typeOf
abstract
class
HttpResultSubscriber
<
T
>(
private
var
showProgress
:
Boolean
=
false
):
Observer
<
HttpResult
<
Any
?
>>
{
abstract
class
HttpResultSubscriber
<
T
>(
private
var
showProgress
:
Boolean
=
false
)
:
Observer
<
HttpResult
<
Any
?
>>
{
private
var
isShowErrorMsg
=
true
private
var
isShowErrorMsg
=
true
override
fun
onSubscribe
(
d
:
Disposable
)
{
//网络请求之前
override
fun
onSubscribe
(
d
:
Disposable
)
{
//网络请求之前
if
(
showProgress
)
{
if
(
showProgress
)
{
}
}
}
}
override
fun
onComplete
()
{
//网络请求完成
override
fun
onComplete
()
{
//网络请求完成
if
(
showProgress
)
{
if
(
showProgress
)
{
}
}
}
}
override
fun
onError
(
e
:
Throwable
)
{
override
fun
onError
(
e
:
Throwable
)
{
if
(
e
.
toString
().
contains
(
"ConnectException"
)
||
e
.
toString
().
contains
(
"Unable to resolve host"
))
{
if
(
e
.
toString
().
contains
(
"ConnectException"
)
||
e
.
toString
().
contains
(
"Unable to resolve host"
))
{
if
(
isShowErrorMsg
)
{
if
(
isShowErrorMsg
)
{
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"当前网络链接不畅,请检查您的网络情况"
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"当前网络链接不畅,请检查您的网络情况"
)
}
}
}
else
if
(
"connect timed out"
==
e
.
message
)
{
}
else
if
(
"connect timed out"
==
e
.
message
)
{
if
(
isShowErrorMsg
)
{
if
(
isShowErrorMsg
)
{
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"服务器连接超时"
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"服务器连接超时"
)
}
}
}
else
if
(
e
is
JsonParseException
||
e
.
toString
().
contains
(
"Json"
)
||
e
.
toString
().
contains
(
"Gson"
))
{
}
else
if
(
e
is
JsonParseException
||
e
.
toString
().
contains
(
"Json"
)
||
e
.
toString
().
contains
(
"Gson"
))
{
if
(
isShowErrorMsg
)
{
if
(
isShowErrorMsg
)
{
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"数据解析异常"
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"数据解析异常"
)
}
}
}
else
{
}
else
{
if
(
isShowErrorMsg
)
{
if
(
isShowErrorMsg
)
{
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"网络请求异常"
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"网络请求异常"
)
}
}
}
onRequestFailure
(
Exception
(
e
.
toString
()))
}
}
onRequestFailure
(
Exception
(
e
.
toString
()))
}
override
fun
onNext
(
res
:
HttpResult
<
Any
?
>)
{
override
fun
onNext
(
res
:
HttpResult
<
Any
?
>)
{
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
ResultCode
.
SUCCESS
)
{
val
type
=
(
this
.
javaClass
.
genericSuperclass
as
ParameterizedType
).
actualTypeArguments
[
0
]
val
type
=
(
this
.
javaClass
.
genericSuperclass
as
ParameterizedType
).
actualTypeArguments
[
0
]
val
decodeResult
=
HttpParamsUtils
.
rsaDecryptResult
<
T
>(
res
,
type
)
val
decodeResult
=
HttpParamsUtils
.
rsaDecryptResult
<
T
>(
res
,
type
)
onRequestSuccess
(
decodeResult
)
onRequestSuccess
(
decodeResult
)
}
else
{
}
else
{
val
decodeResult
=
HttpResult
<
T
>()
val
decodeResult
=
HttpResult
<
T
>()
decodeResult
.
code
=
res
.
code
decodeResult
.
code
=
res
.
code
decodeResult
.
reason
=
res
.
reason
decodeResult
.
reason
=
res
.
reason
decodeResult
.
status
=
res
.
status
decodeResult
.
status
=
res
.
status
onFailer
(
decodeResult
)
onFailer
(
decodeResult
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
res
.
reason
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
res
.
reason
)
}
}
}
}
abstract
fun
onSuccess
(
result
:
HttpResult
<
T
>?)
abstract
fun
onSuccess
(
result
:
HttpResult
<
T
>?)
abstract
fun
onFailer
(
result
:
HttpResult
<
T
>?)
abstract
fun
onFailer
(
result
:
HttpResult
<
T
>?)
@SuppressLint
(
"NewApi"
)
fun
onRequestFailure
(
e
:
Throwable
?)
{
val
result
:
HttpResult
<
T
>
=
HttpResult
()
result
.
code
=
-
100
result
.
reason
=
e
?.
message
result
.
status
=
"failed"
onFailer
(
result
)
}
@SuppressLint
(
"NewApi"
)
@SuppressLint
(
"NewApi"
)
fun
onRequestSuccess
(
result
:
HttpResult
<
T
>?)
{
fun
onRequestFailure
(
e
:
Throwable
?)
{
onSuccess
(
result
)
val
result
:
HttpResult
<
T
>
=
HttpResult
()
}
result
.
code
=
-
100
}
result
.
reason
=
e
?.
message
\ No newline at end of file
result
.
status
=
"failed"
onFailer
(
result
)
}
@SuppressLint
(
"NewApi"
)
fun
onRequestSuccess
(
result
:
HttpResult
<
T
>?)
{
onSuccess
(
result
)
}
}
CommonLib/Common/src/main/res/values/colors.xml
View file @
6c2cfb63
...
@@ -27,4 +27,9 @@
...
@@ -27,4 +27,9 @@
<color
name=
"black_919191"
>
#919191
</color>
<color
name=
"black_919191"
>
#919191
</color>
<color
name=
"footer_loading_gray"
>
#a8abb1
</color>
<color
name=
"footer_loading_gray"
>
#a8abb1
</color>
<color
name=
"commentSendBtn"
>
#A7A69f
</color>
<color
name=
"commentSendBtn"
>
#A7A69f
</color>
<!--所有业务组件通用的颜色值在这定义-->
<color
name=
"color_333333"
>
#333333
</color>
<color
name=
"color_666666"
>
#666666
</color>
<color
name=
"color_999999"
>
#999999
</color>
</resources>
</resources>
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/adapter/MyStaffListAdapter.kt
0 → 100644
View file @
6c2cfb63
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.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountUser
import
com.yidian.utils.ToastUtil
/**
* 我的员工列表的适配器
*/
class
MyStaffListAdapter
:
BaseQuickAdapter
<
AccountUser
,
BaseViewHolder
>(
R
.
layout
.
item_staff_list
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
AccountUser
)
{
holder
.
getView
<
TextView
>(
R
.
id
.
tv_name
).
text
=
item
.
nickName
holder
.
getView
<
TextView
>(
R
.
id
.
tv_mobile
).
text
=
item
.
mobile
if
(!
item
.
roleList
.
isNullOrEmpty
())
{
val
sb
=
StringBuilder
()
item
.
roleList
.
forEach
{
sb
.
append
(
"$it|"
)
}
holder
.
getView
<
TextView
>(
R
.
id
.
tv_role_list
).
text
=
sb
}
// 点击管理,进入员工信息
holder
.
getView
<
TextView
>(
R
.
id
.
tv_manage
).
setOnClickListener
{
ToastUtil
.
showToast
(
context
,
"点击${item.nickName}"
)
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/bean/AccountListDto.kt
View file @
6c2cfb63
...
@@ -7,12 +7,12 @@ import com.google.gson.annotations.SerializedName
...
@@ -7,12 +7,12 @@ import com.google.gson.annotations.SerializedName
*/
*/
data class
AccountListDto
(
data class
AccountListDto
(
@SerializedName
(
"admin"
)
@SerializedName
(
"admin"
)
val
admin
:
List
<
Admin
>?
=
null
,
val
admin
:
List
<
A
ccountA
dmin
>?
=
null
,
@SerializedName
(
"users"
)
@SerializedName
(
"users"
)
val
users
:
List
<
User
>?
=
null
val
users
:
List
<
Account
User
>?
=
null
)
)
data class
Admin
(
data class
A
ccountA
dmin
(
@SerializedName
(
"life_account_id"
)
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
val
lifeAccountId
:
Long
?
=
null
,
@SerializedName
(
"merchant_id"
)
@SerializedName
(
"merchant_id"
)
...
@@ -31,7 +31,7 @@ data class Admin(
...
@@ -31,7 +31,7 @@ data class Admin(
val
userId
:
Long
?
=
null
val
userId
:
Long
?
=
null
)
)
data class
User
(
data class
Account
User
(
@SerializedName
(
"life_account_id"
)
@SerializedName
(
"life_account_id"
)
val
lifeAccountId
:
Long
?
=
null
,
val
lifeAccountId
:
Long
?
=
null
,
@SerializedName
(
"merchant_id"
)
@SerializedName
(
"merchant_id"
)
...
@@ -48,4 +48,4 @@ data class User(
...
@@ -48,4 +48,4 @@ data class User(
val
showButton
:
Int
?
=
null
,
val
showButton
:
Int
?
=
null
,
@SerializedName
(
"user_id"
)
@SerializedName
(
"user_id"
)
val
userId
:
Int
?
=
null
val
userId
:
Int
?
=
null
)
)
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/http/IPersonalAccountListCallback.kt
0 → 100644
View file @
6c2cfb63
package
com.yidian.shenghuoquan.newscontent.personnel.http
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
interface
IPersonalAccountListCallback
{
fun
getAccountListSuccess
(
response
:
AccountListDto
?)
fun
getAccountListFailure
(
message
:
String
?)
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/http/PersonalRemoteDataSource.kt
0 → 100644
View file @
6c2cfb63
package
com.yidian.shenghuoquan.newscontent.personnel.http
import
com.yidian.common.http.HttpParamsUtils
import
com.yidian.common.http.HttpResult
import
com.yidian.common.http.HttpResultSubscriber
import
com.yidian.common.http.TransformUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.newscontent.http.CommonService
import
com.yidian.shenghuoquan.newscontent.http.httpbean.IMobileLoginCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.MobileLoginBean
import
com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
/**
* 人员管理远程数据源
*/
object
PersonalRemoteDataSource
{
/**
* 获取账号列表
*/
fun
getAccountList
(
apiCallback
:
IPersonalAccountListCallback
)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
ServiceFactory
.
getInstance
().
createService
(
PersonalService
::
class
.
java
)
.
getAccountList
(
publicParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
AccountListDto
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
AccountListDto
?
>?)
{
apiCallback
.
getAccountListSuccess
(
result
?.
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
AccountListDto
?
>?)
{
apiCallback
.
getAccountListFailure
(
result
?.
reason
)
}
})
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/http/PersonalService.kt
0 → 100644
View file @
6c2cfb63
package
com.yidian.shenghuoquan.newscontent.personnel.http
import
com.yidian.common.http.HttpResult
import
io.reactivex.rxjava3.core.Observable
import
retrofit2.http.*
/**
* 人员管理相关的请求
*/
interface
PersonalService
{
private
companion
object
{
const
val
accountList
=
"/merchant/enterprise/get_account_role_list"
const
val
changeRole
=
"/merchant/enterprise/change_role"
const
val
sendMobileCode
=
"/merchant/enterprise/send_mobile_code"
const
val
checkMobileCode
=
"/merchant/enterprise/check_mobile_code"
const
val
addUser
=
"/merchant/enterprise/add_user"
const
val
disassociate
=
""
}
/**
* 获取账号列表
*/
@GET
(
accountList
)
fun
getAccountList
(
@QueryMap
commonParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
Any
?
>>
/**
* 更换生活号管理员
*/
@GET
(
changeRole
)
fun
getChangeRole
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
params
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
/**
* 变更管理员发送短信,老管理员/新管理员
*/
@GET
(
sendMobileCode
)
fun
getSendMobileCode
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
params
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
/**
* 变更管理员验证短信,老管理员/新管理员
*/
@GET
(
checkMobileCode
)
fun
getCheckMobileCode
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
params
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
/**
* 添加非管理员
*/
@Headers
(
"Content-Type: application/json"
)
@POST
(
addUser
)
fun
postAddUser
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
/**
* 解除关系
*/
@GET
(
disassociate
)
fun
getDissolveRelationship
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
params
:
Map
<
String
,
String
?
>
):
Observable
<
HttpResult
<
Any
?
>>
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/MyStaffActivity.kt
View file @
6c2cfb63
...
@@ -3,12 +3,22 @@ package com.yidian.shenghuoquan.newscontent.personnel.ui
...
@@ -3,12 +3,22 @@ package com.yidian.shenghuoquan.newscontent.personnel.ui
import
android.os.Bundle
import
android.os.Bundle
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MY_STAFF
import
com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MY_STAFF
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityMyStaffBinding
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.http.IPersonalAccountListCallback
import
com.yidian.shenghuoquan.newscontent.personnel.http.PersonalRemoteDataSource
import
com.yidian.utils.ToastUtil
import
com.yidian.xpage.XPageManager
/**
/**
* 人员管理 —— 我的员工页面
* 人员管理 —— 我的员工页面
*/
*/
class
MyStaffActivity
:
BaseActivity
<
ActivityMyStaffBinding
>()
{
class
MyStaffActivity
:
BaseActivity
<
ActivityMyStaffBinding
>(),
IPersonalAccountListCallback
{
private
val
myStaffAdapter
:
MyStaffListAdapter
by
lazy
{
MyStaffListAdapter
()
}
override
fun
createViewBinding
():
ActivityMyStaffBinding
{
override
fun
createViewBinding
():
ActivityMyStaffBinding
{
return
ActivityMyStaffBinding
.
inflate
(
layoutInflater
)
return
ActivityMyStaffBinding
.
inflate
(
layoutInflater
)
...
@@ -20,8 +30,49 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>() {
...
@@ -20,8 +30,49 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>() {
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
super
.
init
(
savedInstanceState
)
// 请求账号列表
initClick
()
initView
()
PersonalRemoteDataSource
.
getAccountList
(
this
)
}
private
fun
initView
()
{
viewBind
.
layoutCommonHeader
.
tvTitle
.
text
=
resources
.
getString
(
R
.
string
.
my_staff
)
viewBind
.
rvStaffList
.
adapter
=
myStaffAdapter
}
private
fun
initClick
()
{
viewBind
.
layoutCommonHeader
.
ivBack
.
setOnClickListener
{
XPageManager
.
pop
(
null
)
}
// 更新管理员
viewBind
.
tvChange
.
setOnClickListener
{
ToastUtil
.
showToast
(
this
,
"更换管理员"
)
}
// 点击添加
viewBind
.
tvAddStaff
.
setOnClickListener
{
ToastUtil
.
showToast
(
this
,
"管理员工"
)
}
}
override
fun
getAccountListSuccess
(
response
:
AccountListDto
?)
{
response
?.
let
{
it
.
admin
?.
get
(
0
)
?.
let
{
it1
->
initManager
(
it1
)
}
myStaffAdapter
.
setList
(
it
.
users
)
}
}
private
fun
initManager
(
admin
:
AccountAdmin
)
{
viewBind
.
tvName
.
text
=
admin
.
nickName
viewBind
.
tvMobile
.
text
=
admin
.
mobile
val
stringBuilder
=
StringBuilder
()
admin
.
roleList
?.
forEach
{
stringBuilder
.
append
(
"$it|"
)
}
viewBind
.
tvRole
.
text
=
stringBuilder
}
override
fun
getAccountListFailure
(
message
:
String
?)
{
}
}
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/utils/SensitiveInfoUtil.kt
View file @
6c2cfb63
package
com.yidian.shenghuoquan.newscontent.utils
package
com.yidian.shenghuoquan.newscontent.utils
/**
/**
* author: yinjiacheng
* author: yinjiacheng
* date: 6/6/21 2:23 PM
* date: 6/6/21 2:23 PM
...
@@ -7,11 +8,32 @@ package com.yidian.shenghuoquan.newscontent.utils
...
@@ -7,11 +8,32 @@ package com.yidian.shenghuoquan.newscontent.utils
*/
*/
object
SensitiveInfoUtil
{
object
SensitiveInfoUtil
{
/**
/**
* 身份证号码出生日期脱敏
* 身份证号码出生日期脱敏
*/
*/
fun
idCardNumEncrypt
(
content
:
String
):
String
{
fun
idCardNumEncrypt
(
content
:
String
):
String
{
val
rule
=
"(\\d{6})\\d{8}(\\d{4})"
val
rule
=
"(\\d{6})\\d{8}(\\d{4})"
return
content
.
replace
(
rule
.
toRegex
(),
"$1********$2"
)
return
content
.
replace
(
rule
.
toRegex
(),
"$1********$2"
)
}
/**
* 身份证号前三后四脱敏
*/
fun
idCardPartEncrypt
(
content
:
String
):
String
{
if
(
content
.
isBlank
()
||
content
.
length
<
18
)
{
return
content
}
}
}
return
content
.
replace
(
"(?<=\\w{3})\\w(?=\\w{4})"
,
"*"
);
\ No newline at end of file
}
/**
* 手机号前三后四脱敏
*/
fun
mobileEncrypt
(
mobile
:
String
):
String
{
if
(
mobile
.
isBlank
()
||
mobile
.
length
!=
11
)
{
return
mobile
}
return
mobile
.
replace
(
"(\\d{3})\\d{4}(\\d{4})"
,
"$1****$2"
)
}
}
Components/newscontent/src/main/res/drawable/shape_manage_bg.xml
0 → 100644
View file @
6c2cfb63
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"12dp"
/>
<padding
android:bottom=
"2dp"
android:left=
"5dp"
android:right=
"5dp"
android:top=
"2dp"
/>
<stroke
android:width=
"1dp"
android:color=
"#DDDDDD"
/>
</shape>
\ No newline at end of file
Components/newscontent/src/main/res/drawable/shape_person_bg.xml
0 → 100644
View file @
6c2cfb63
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"12dp"
/>
<solid
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
Components/newscontent/src/main/res/layout/activity_my_staff.xml
View file @
6c2cfb63
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_F5F6F7"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<include
<include
...
@@ -11,13 +12,118 @@
...
@@ -11,13 +12,118 @@
layout=
"@layout/layout_common_header"
/>
layout=
"@layout/layout_common_header"
/>
<TextView
<TextView
android:id=
"@+id/textView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"24dp"
android:gravity=
"center"
android:text=
"管理员"
android:textColor=
"@color/black_333333"
android:textSize=
"18sp"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/shape_person_bg"
android:minHeight=
"101dp"
android:padding=
"16dp"
>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_333333"
android:textSize=
"16sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"店老大"
/>
<TextView
android:id=
"@+id/tv_change"
android:layout_width=
"48dp"
android:layout_height=
"28dp"
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/shape_manage_bg"
android:gravity=
"center"
android:text=
"更换"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"1"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_mobile"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_name"
tools:text=
"188****9999"
/>
<TextView
android:id=
"@+id/tv_role"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:textColor=
"@color/color_999999"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_mobile"
tools:text=
"协作者管理|店铺管理协作者管理"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"25dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"2dp"
android:gravity=
"center_vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"员工信息"
android:textColor=
"@color/black_333333"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/tv_add_staff"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_marginEnd=
"10dp"
android:text=
"添加"
android:textColor=
"@color/black_333333"
android:textSize=
"16sp"
/>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_staff_list"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:paddingStart=
"16dp"
android:text=
"我的员工页面"
android:paddingEnd=
"16dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf=
"parent"
tools:itemCount=
"6"
app:layout_constraintStart_toStartOf=
"parent"
tools:listitem=
"@layout/item_staff_list"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/layout/item_staff_list.xml
0 → 100644
View file @
6c2cfb63
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/shape_person_bg"
android:minHeight=
"101dp"
android:padding=
"16dp"
>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_333333"
android:textSize=
"16sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"店小二"
/>
<TextView
android:id=
"@+id/tv_manage"
android:layout_width=
"48dp"
android:layout_height=
"28dp"
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/shape_manage_bg"
android:gravity=
"center"
android:text=
"管理"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"1"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_mobile"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_name"
tools:text=
"188****9999"
/>
<TextView
android:id=
"@+id/tv_role_list"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:textColor=
"@color/color_999999"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_mobile"
tools:text=
"协作者管理|店铺管理协作者管理"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Components/newscontent/src/main/res/values/colors.xml
View file @
6c2cfb63
...
@@ -41,4 +41,5 @@
...
@@ -41,4 +41,5 @@
<color
name=
"base"
>
#FF1852F1
</color>
<color
name=
"base"
>
#FF1852F1
</color>
<color
name=
"edit_text_border_blue"
>
#1852F1
</color>
<color
name=
"edit_text_border_blue"
>
#1852F1
</color>
<color
name=
"edit_text_border_gray"
>
#cccccc
</color>
<color
name=
"edit_text_border_gray"
>
#cccccc
</color>
<color
name=
"color_F5F6F7"
>
#F5F5F5
</color>
</resources>
</resources>
\ No newline at end of file
Components/newscontent/src/main/res/values/strings.xml
View file @
6c2cfb63
...
@@ -125,4 +125,6 @@
...
@@ -125,4 +125,6 @@
<string
name=
"enterprise_legal_mobile"
>
法人手机号
</string>
<string
name=
"enterprise_legal_mobile"
>
法人手机号
</string>
<string
name=
"individual_business_manager_name"
>
经营者姓名
</string>
<string
name=
"individual_business_manager_name"
>
经营者姓名
</string>
<string
name=
"my_staff"
>
我的员工
</string>
</resources>
</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