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
8de260c2
提交
8de260c2
authored
3月 04, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.新用戶注册
上级
6263b182
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
85 行增加
和
44 行删除
+85
-44
ApiService.java
app/src/main/java/com/wd/workoffice/app/ApiService.java
+3
-2
BaseBean.java
app/src/main/java/com/wd/workoffice/app/BaseBean.java
+8
-13
UserRegisterThreeModel.java
.../java/com/wd/workoffice/model/UserRegisterThreeModel.java
+3
-1
UserRegisterOnePresenter.java
...com/wd/workoffice/presenter/UserRegisterOnePresenter.java
+2
-2
UserRegisterThreePresenter.java
...m/wd/workoffice/presenter/UserRegisterThreePresenter.java
+2
-1
ErpActivationOneActivity.java
.../com/wd/workoffice/ui/login/ErpActivationOneActivity.java
+2
-5
UserRegisterOneActivity.java
...a/com/wd/workoffice/ui/login/UserRegisterOneActivity.java
+2
-2
UserRegisterThreeActivity.java
...com/wd/workoffice/ui/login/UserRegisterThreeActivity.java
+29
-4
UserRegisterTwoActivity.java
...a/com/wd/workoffice/ui/login/UserRegisterTwoActivity.java
+1
-1
WorkUtils.java
app/src/main/java/com/wd/workoffice/util/WorkUtils.java
+16
-1
activity_user_register_three.xml
app/src/main/res/layout/activity_user_register_three.xml
+13
-11
activity_user_register_two.xml
app/src/main/res/layout/activity_user_register_two.xml
+4
-1
没有找到文件。
app/src/main/java/com/wd/workoffice/app/ApiService.java
浏览文件 @
8de260c2
...
...
@@ -6,6 +6,7 @@ import org.json.JSONObject;
import
java.util.Map
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
import
retrofit2.http.POST
;
...
...
@@ -124,7 +125,7 @@ public interface ApiService {
* @return
*/
@POST
(
"/open/sys/user/register"
)
Observable
<
BaseBean
>
register
(
@
QueryMap
Map
<
String
,
Object
>
param
);
Observable
<
BaseBean
>
register
(
@
Body
RequestBody
requestBody
);
/**
...
...
@@ -178,6 +179,6 @@ public interface ApiService {
*
* @return
*/
@
POS
T
(
"/open/sys/dept/list"
)
@
GE
T
(
"/open/sys/dept/list"
)
Observable
<
BaseBean
>
depList
();
}
app/src/main/java/com/wd/workoffice/app/BaseBean.java
浏览文件 @
8de260c2
...
...
@@ -8,10 +8,10 @@ package com.wd.workoffice.app;
public
class
BaseBean
{
public
Integer
code
;
public
Object
data
;
p
rivate
String
message
;
p
rivate
int
httpStatus
;
p
rivate
String
path
;
p
rivate
String
ext
;
p
ublic
String
message
;
p
ublic
int
httpStatus
;
p
ublic
String
path
;
p
ublic
String
ext
;
public
Integer
getCode
()
{
return
code
;
...
...
@@ -21,6 +21,10 @@ public class BaseBean {
return
data
;
}
public
String
getMessage
()
{
return
message
;
}
public
int
getHttpStatus
()
{
return
httpStatus
;
}
...
...
@@ -32,13 +36,4 @@ public class BaseBean {
public
String
getExt
()
{
return
ext
;
}
public
String
getMessage
()
{
return
message
;
}
public
Integer
getStatus
()
{
return
code
;
}
}
app/src/main/java/com/wd/workoffice/model/UserRegisterThreeModel.java
浏览文件 @
8de260c2
...
...
@@ -3,6 +3,7 @@ package com.wd.workoffice.model;
import
com.wd.workoffice.app.ApiService
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.contract.UserRegisterThreeContract
;
import
com.wd.workoffice.util.WorkUtils
;
import
java.util.Map
;
...
...
@@ -17,7 +18,8 @@ import io.reactivex.Observable;
public
class
UserRegisterThreeModel
implements
UserRegisterThreeContract
.
Model
{
@Override
public
Observable
<
BaseBean
>
register
(
Map
<
String
,
Object
>
param
)
{
return
RtfHelper
.
getInstance
().
getApiService
(
ApiService
.
class
).
register
(
param
);
return
RtfHelper
.
getInstance
().
getApiService
(
ApiService
.
class
).
register
(
WorkUtils
.
convertMapToBody
(
param
));
}
@Override
...
...
app/src/main/java/com/wd/workoffice/presenter/UserRegisterOnePresenter.java
浏览文件 @
8de260c2
...
...
@@ -41,7 +41,7 @@ public class UserRegisterOnePresenter extends BasePresenter<UserRegisterOneContr
public
void
onSuccess
(
BaseBean
data
)
{
mView
.
hideLoading
();
if
(
data
.
getStatus
()
!=
0
)
{
mView
.
onError
(
data
.
getM
sg
());
mView
.
onError
(
data
.
getM
essage
());
return
;
}
mView
.
codeSuccess
();
...
...
@@ -68,7 +68,7 @@ public class UserRegisterOnePresenter extends BasePresenter<UserRegisterOneContr
public
void
onSuccess
(
BaseBean
data
)
{
mView
.
hideLoading
();
if
(
data
.
getStatus
()
!=
0
)
{
mView
.
onError
(
data
.
getM
sg
());
mView
.
onError
(
data
.
getM
essage
());
return
;
}
mView
.
verifySuccess
();
...
...
app/src/main/java/com/wd/workoffice/presenter/UserRegisterThreePresenter.java
浏览文件 @
8de260c2
package
com
.
wd
.
workoffice
.
presenter
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.bean.DepBean
;
import
com.wd.workoffice.contract.UserRegisterThreeContract
;
...
...
@@ -69,7 +70,7 @@ public class UserRegisterThreePresenter extends BasePresenter<UserRegisterThreeC
mView
.
onError
(
data
.
getMessage
());
return
;
}
mView
.
depSuccess
(
(
List
<
DepBean
>)
data
.
getData
(
));
mView
.
depSuccess
(
JSON
.
parseArray
(
data
.
getData
().
toString
(),
DepBean
.
class
));
}
});
}
...
...
app/src/main/java/com/wd/workoffice/ui/login/ErpActivationOneActivity.java
浏览文件 @
8de260c2
package
com
.
wd
.
workoffice
.
ui
.
login
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.util.
Search
Utils
;
import
com.wd.workoffice.util.
Work
Utils
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
...
...
@@ -64,7 +61,7 @@ public class ErpActivationOneActivity extends WorkToolBarActivity {
case
R
.
id
.
tv_discover
:
break
;
case
R
.
id
.
tv_code
:
Search
Utils
.
timerSeckill
(
tvCode
,
60
*
1000
,
1000
,
0
);
Work
Utils
.
timerSeckill
(
tvCode
,
60
*
1000
,
1000
,
0
);
ToastUtil
.
showLong
(
"验证码发送成功,请注意查收!"
);
break
;
case
R
.
id
.
btn_next
:
...
...
app/src/main/java/com/wd/workoffice/ui/login/UserRegisterOneActivity.java
浏览文件 @
8de260c2
...
...
@@ -12,7 +12,7 @@ import com.wd.workoffice.R;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.contract.UserRegisterOneContract
;
import
com.wd.workoffice.presenter.UserRegisterOnePresenter
;
import
com.wd.workoffice.util.
Search
Utils
;
import
com.wd.workoffice.util.
Work
Utils
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
...
...
@@ -132,7 +132,7 @@ public class UserRegisterOneActivity extends WorkToolBarActivity implements User
@Override
public
void
codeSuccess
()
{
Search
Utils
.
timerSeckill
(
tvCode
,
60
*
1000
,
1000
,
0
);
Work
Utils
.
timerSeckill
(
tvCode
,
60
*
1000
,
1000
,
0
);
ToastUtil
.
showLong
(
"验证码发送成功,请注意查收!"
);
}
...
...
app/src/main/java/com/wd/workoffice/ui/login/UserRegisterThreeActivity.java
浏览文件 @
8de260c2
...
...
@@ -17,8 +17,11 @@ import com.wd.workoffice.bean.DepBean;
import
com.wd.workoffice.contract.UserRegisterThreeContract
;
import
com.wd.workoffice.presenter.UserRegisterThreePresenter
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
androidx.appcompat.app.AlertDialog
;
import
butterknife.BindView
;
...
...
@@ -45,8 +48,10 @@ public class UserRegisterThreeActivity extends WorkToolBarActivity implements Us
Button
btnSubmit
;
private
UserRegisterThreePresenter
userRegisterThreePresenter
;
private
List
<
DepBean
>
depList
;
private
List
<
String
>
depNameList
;
private
int
chooseDep
=-
1
;
private
List
<
String
>
depNameList
=
new
ArrayList
<>();
private
int
chooseDep
=
-
1
;
private
AlertDialog
.
Builder
builder
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
...
...
@@ -111,18 +116,37 @@ public class UserRegisterThreeActivity extends WorkToolBarActivity implements Us
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
ll_product
:
if
(
builder
==
null
)
{
toast
(
"正在加载部门,请稍等"
);
return
;
}
builder
.
show
();
break
;
case
R
.
id
.
btn_submit
:
if
(
chooseDep
==
-
1
)
{
toast
(
"请选择部门"
);
return
;
}
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"userName"
,
etName
.
getText
().
toString
());
param
.
put
(
"password"
,
getIntent
().
getStringExtra
(
"pwd"
));
param
.
put
(
"nickName"
,
getIntent
().
getStringExtra
(
"name"
));
param
.
put
(
"email"
,
etEmail
.
getText
().
toString
());
param
.
put
(
"phone"
,
getIntent
().
getStringExtra
(
"phone"
));
// param.put("erpId", "");
param
.
put
(
"deptId"
,
depList
.
get
(
chooseDep
).
getId
());
param
.
put
(
"verifyCode"
,
getIntent
().
getStringExtra
(
"code"
));
userRegisterThreePresenter
.
register
(
param
);
break
;
}
}
private
void
initDialog
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
=
new
AlertDialog
.
Builder
(
this
);
String
[]
stringArray
=
new
String
[
depNameList
.
size
()];
builder
.
setItems
(
depNameList
.
toArray
(
stringArray
),
(
dialog
,
which
)
->
{
tvProductContent
.
setText
(
depNameList
.
get
(
which
));
chooseDep
=
which
;
chooseDep
=
which
;
});
// normalDialog = builder.setView(dialogView).setPositiveButton("确定", (dialog, which) -> clientPresenter.changeClient(id, status + ""))
// .setNegativeButton("取消", (dialog, which) -> dialog.dismiss()).create();
...
...
@@ -141,5 +165,6 @@ public class UserRegisterThreeActivity extends WorkToolBarActivity implements Us
for
(
DepBean
dep
:
dataList
)
{
depNameList
.
add
(
dep
.
getName
());
}
initDialog
();
}
}
app/src/main/java/com/wd/workoffice/ui/login/UserRegisterTwoActivity.java
浏览文件 @
8de260c2
...
...
@@ -127,7 +127,7 @@ public class UserRegisterTwoActivity extends WorkToolBarActivity {
toast
(
"账号名称数字和字母4-16位"
);
return
;
}
if
(!
RegexUtils
.
isMatch
(
Config
.
REGEX_
USERNAME
,
name
)){
if
(!
RegexUtils
.
isMatch
(
Config
.
REGEX_
PASSWORD
,
name
)){
toast
(
"设置密码数字或字母6-16位"
);
return
;
}
...
...
app/src/main/java/com/wd/workoffice/util/
Search
Utils.java
→
app/src/main/java/com/wd/workoffice/util/
Work
Utils.java
浏览文件 @
8de260c2
...
...
@@ -8,17 +8,32 @@ import android.os.CountDownTimer;
import
android.provider.MediaStore
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.WorkApp
;
import
java.io.File
;
import
java.util.Map
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
SearchUtils
{
public
class
WorkUtils
{
/**
* 将map数据转换为 普通的 json RequestBody
* @param map 以前的请求参数
* @return
*/
public
static
RequestBody
convertMapToBody
(
Map
<?,?>
map
)
{
return
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
JSON
.
toJSONString
(
map
));
}
// public static Map<String, Object> pageKey() {
// Map<String, Object> param = new HashMap<>();
// param.put("size", Config.SIZE);
...
...
app/src/main/res/layout/activity_user_register_three.xml
浏览文件 @
8de260c2
...
...
@@ -27,13 +27,14 @@
<EditText
android:id=
"@+id/et_code"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10mm"
android:background=
"@null"
android:text=
"YG22015444"
android:gravity=
"right"
android:paddingVertical=
"8mm"
android:textColor=
"@color/flexible_text_sup"
android:textSize=
"16sp"
/>
</RelativeLayout>
...
...
@@ -55,13 +56,14 @@
<EditText
android:id=
"@+id/et_name"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10mm"
android:background=
"@null"
android:text=
"YG22015444"
android:gravity=
"right"
android:paddingVertical=
"8mm"
android:textColor=
"@color/flexible_text_sup"
android:textSize=
"16sp"
/>
</RelativeLayout>
...
...
@@ -88,7 +90,6 @@
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10mm"
android:text=
"YG22015444"
android:textColor=
"@color/flexible_text_sup"
android:textSize=
"16sp"
/>
</RelativeLayout>
...
...
@@ -117,7 +118,6 @@
android:layout_marginLeft=
"10mm"
android:layout_weight=
"1"
android:gravity=
"right"
android:text=
"YG22015444"
android:textSize=
"16sp"
/>
<ImageView
...
...
@@ -144,13 +144,15 @@
<EditText
android:id=
"@+id/et_email"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10mm"
android:background=
"@null"
android:text=
"YG22015444"
android:gravity=
"right"
android:inputType=
"textEmailAddress"
android:paddingVertical=
"8mm"
android:textColor=
"@color/flexible_text_sup"
android:textSize=
"16sp"
/>
</RelativeLayout>
...
...
@@ -168,10 +170,10 @@
android:layout_width=
"256mm"
android:layout_height=
"53mm"
android:layout_centerHorizontal=
"true"
android:background=
"@mipmap/btn_main_bg"
android:text=
"提交"
android:layout_marginTop=
"30mm"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"30mm"
android:background=
"@drawable/selector_btn"
android:text=
"提交"
android:textColor=
"@color/white"
android:textSize=
"24sp"
/>
</LinearLayout>
...
...
app/src/main/res/layout/activity_user_register_two.xml
浏览文件 @
8de260c2
...
...
@@ -51,6 +51,7 @@
android:layout_weight=
"1"
android:background=
"@null"
android:hint=
"账号名称数字和字母4-16位"
android:inputType=
"textVisiblePassword"
android:textSize=
"12sp"
/>
</LinearLayout>
...
...
@@ -79,6 +80,7 @@
android:layout_marginLeft=
"10mm"
android:layout_weight=
"1"
android:background=
"@null"
android:inputType=
"textPassword"
android:hint=
"设置密码数字或字母6- 16位"
android:textSize=
"12sp"
/>
...
...
@@ -105,6 +107,7 @@
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"10mm"
android:layout_weight=
"1"
android:inputType=
"textPassword"
android:background=
"@null"
android:hint=
"再次确认密码"
android:textSize=
"12sp"
/>
...
...
@@ -119,7 +122,7 @@
android:layout_height=
"50mm"
android:layout_marginHorizontal=
"58mm"
android:layout_marginTop=
"40mm"
android:background=
"@
mipmap/btn_main_bg
"
android:background=
"@
drawable/selector_btn
"
android:text=
"激活"
android:textColor=
"@color/white"
android:textSize=
"20sp"
/>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论