Skip to content
项目
Groups
代码片段
帮助
正在加载...
Sign in / Register
Toggle navigation
W
workoffice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图表
统计图
Create a new issue
作业
提交
议题看板
Open sidebar
冷广德
workoffice
Commits
410c0ed2
提交
410c0ed2
authored
3月 27, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.setting 退出登录
2.//TODO erp用户激活,忘记密码测试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级
3e4dde66
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
480 行增加
和
4 行删除
+480
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+16
-0
UserInfoBean.java
app/src/main/java/com/wd/workoffice/bean/UserInfoBean.java
+3
-3
UserInfoActivity.java
.../com/wd/workoffice/ui/activity/user/UserInfoActivity.java
+65
-0
UserSettingActivity.java
...m/wd/workoffice/ui/activity/user/UserSettingActivity.java
+124
-0
MyFragment.java
app/src/main/java/com/wd/workoffice/ui/fg/MyFragment.java
+6
-0
UserKeeper.java
app/src/main/java/com/wd/workoffice/util/UserKeeper.java
+0
-1
activity_user_info.xml
app/src/main/res/layout/activity_user_info.xml
+143
-0
activity_user_setting.xml
app/src/main/res/layout/activity_user_setting.xml
+123
-0
没有找到文件。
app/src/main/AndroidManifest.xml
浏览文件 @
410c0ed2
...
...
@@ -544,6 +544,22 @@
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.user.UserInfoActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"个人资料"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.user.UserSettingActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"系统设置"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<provider
android:name=
"androidx.core.content.FileProvider"
...
...
app/src/main/java/com/wd/workoffice/bean/UserInfoBean.java
浏览文件 @
410c0ed2
...
...
@@ -65,7 +65,7 @@ public class UserInfoBean {
private
String
access
;
private
String
ofDeptRuler
;
private
Object
roleNames
;
private
Object
deptName
;
private
String
deptName
;
private
Object
roleId
;
private
Object
deptId
;
private
List
<
RolesBean
>
roles
;
...
...
@@ -223,11 +223,11 @@ public class UserInfoBean {
this
.
roleNames
=
roleNames
;
}
public
Object
getDeptName
()
{
public
String
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
Object
deptName
)
{
public
void
setDeptName
(
String
deptName
)
{
this
.
deptName
=
deptName
;
}
...
...
app/src/main/java/com/wd/workoffice/ui/activity/user/UserInfoActivity.java
0 → 100644
浏览文件 @
410c0ed2
package
com
.
wd
.
workoffice
.
ui
.
activity
.
user
;
import
android.text.TextUtils
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.PermissionBean
;
import
com.wd.workoffice.bean.UserInfoBean
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.util.UserKeeper
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.disposables.Disposable
;
/**
* 我的 - 信息
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
UserInfoActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_name
)
TextView
tvName
;
@BindView
(
R
.
id
.
tv_phone
)
TextView
tvPhone
;
@BindView
(
R
.
id
.
tv_no
)
TextView
tvNo
;
@BindView
(
R
.
id
.
tv_dep
)
TextView
tvDep
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
String
userInfo
=
UserKeeper
.
getInstance
().
getUserInfo
();
if
(!
TextUtils
.
isEmpty
(
userInfo
))
{
UserInfoBean
userInfoBean
=
JSON
.
parseObject
(
userInfo
,
UserInfoBean
.
class
);
tvName
.
setText
(
userInfoBean
.
getUserName
());
tvPhone
.
setText
(
userInfoBean
.
getPhone
());
tvNo
.
setText
(
userInfoBean
.
getOfDept
().
getName
());
tvDep
.
setText
(
userInfoBean
.
getDeptName
());
}
}
@Override
protected
void
initData
()
{
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_user_info
;
}
}
app/src/main/java/com/wd/workoffice/ui/activity/user/UserSettingActivity.java
0 → 100644
浏览文件 @
410c0ed2
package
com
.
wd
.
workoffice
.
ui
.
activity
.
user
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.PermissionBean
;
import
com.wd.workoffice.bean.UserInfoBean
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.activity.MainActivity
;
import
com.wd.workoffice.ui.activity.login.LoginActivity
;
import
com.wd.workoffice.util.UserKeeper
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.disposables.Disposable
;
/**
* 我的 - 设置
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
UserSettingActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_name
)
TextView
tvName
;
@BindView
(
R
.
id
.
rl_account
)
RelativeLayout
rlAccount
;
@BindView
(
R
.
id
.
tv_phone
)
TextView
tvPhone
;
@BindView
(
R
.
id
.
rl_phone
)
RelativeLayout
rlPhone
;
@BindView
(
R
.
id
.
rl_pwd
)
RelativeLayout
rlPwd
;
@BindView
(
R
.
id
.
rl_about
)
RelativeLayout
rlAbout
;
@BindView
(
R
.
id
.
btn_logout
)
Button
btnLogout
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
String
userInfo
=
UserKeeper
.
getInstance
().
getUserInfo
();
if
(!
TextUtils
.
isEmpty
(
userInfo
))
{
UserInfoBean
userInfoBean
=
JSON
.
parseObject
(
userInfo
,
UserInfoBean
.
class
);
tvName
.
setText
(
userInfoBean
.
getUserName
());
tvPhone
.
setText
(
userInfoBean
.
getPhone
());
}
}
@Override
protected
void
initData
()
{
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_user_setting
;
}
@OnClick
({
R
.
id
.
rl_account
,
R
.
id
.
rl_phone
,
R
.
id
.
rl_pwd
,
R
.
id
.
rl_about
,
R
.
id
.
btn_logout
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
rl_account
:
break
;
case
R
.
id
.
rl_phone
:
break
;
case
R
.
id
.
rl_pwd
:
break
;
case
R
.
id
.
rl_about
:
break
;
case
R
.
id
.
btn_logout
:
logout
();
break
;
}
}
private
void
logout
()
{
RtfUtils
.
getRtf
().
logout
().
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
toast
(
"退出成功"
);
Intent
intent
=
new
Intent
(
UserSettingActivity
.
this
,
LoginActivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
UserKeeper
.
getInstance
().
clearAll
();
startActivity
(
intent
);
}
});
}
}
app/src/main/java/com/wd/workoffice/ui/fg/MyFragment.java
浏览文件 @
410c0ed2
...
...
@@ -6,6 +6,9 @@ import android.widget.TextView;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.WorkBaseFg
;
import
com.wd.workoffice.ui.activity.user.UserInfoActivity
;
import
com.wd.workoffice.ui.activity.user.UserPermissionActivity
;
import
com.wd.workoffice.ui.activity.user.UserSettingActivity
;
import
com.wd.workoffice.util.UserKeeper
;
import
butterknife.BindView
;
...
...
@@ -58,10 +61,13 @@ public class MyFragment extends WorkBaseFg {
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
ll_role
:
startActivity
(
UserPermissionActivity
.
class
);
break
;
case
R
.
id
.
ll_info
:
startActivity
(
UserInfoActivity
.
class
);
break
;
case
R
.
id
.
ll_setting
:
startActivity
(
UserSettingActivity
.
class
);
break
;
}
}
...
...
app/src/main/java/com/wd/workoffice/util/UserKeeper.java
浏览文件 @
410c0ed2
...
...
@@ -18,7 +18,6 @@ public class UserKeeper {
private
SPUtils
sp
=
SPUtils
.
getInstance
(
"UserKeeper"
);
private
final
String
LOGIN_INFO
=
"_LOGIN_INFO"
;
private
final
String
USER_INFO
=
"_USER_INFO"
;
private
final
String
ACCOUNT
=
"_ACCOUNT"
;
private
UserKeeper
()
{
}
...
...
app/src/main/res/layout/activity_user_info.xml
0 → 100644
浏览文件 @
410c0ed2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"头像"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"40mm"
android:layout_height=
"40mm"
android:layout_alignParentRight=
"true"
android:src=
"@mipmap/my_head"
android:textStyle=
"bold"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"用户姓名"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"联系电话"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_phone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"员工编号"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_no"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"所属部门"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_dep"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_user_setting.xml
0 → 100644
浏览文件 @
410c0ed2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:id=
"@+id/rl_account"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"账号"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:id=
"@+id/rl_phone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"手机号"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_phone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/flexible_text_gray"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:id=
"@+id/rl_pwd"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"修改密码"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:src=
"@mipmap/arrow_right_my"
/>
</RelativeLayout>
<View
style=
"@style/dividerX"
/>
<RelativeLayout
android:id=
"@+id/rl_about"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"关于软件"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:src=
"@mipmap/arrow_right_my"
/>
</RelativeLayout>
<Button
android:id=
"@+id/btn_logout"
android:text=
"退出登录"
android:background=
"@color/input_background"
android:layout_width=
"match_parent"
android:layout_height=
"50mm"
android:layout_marginHorizontal=
"40mm"
android:layout_marginTop=
"20mm"
/>
</LinearLayout>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论