Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
HBHAndroid
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
1
Merge Requests
1
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
杨秀秀
HBHAndroid
Commits
c329aeb3
Commit
c329aeb3
authored
Aug 18, 2023
by
david
Committed by
杨秀秀
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成注销功能
parent
05387797
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
37 deletions
+89
-37
ApiService.kt
.../src/main/java/com/xx/hbhconsumer/data/http/ApiService.kt
+6
-0
LogoffRequest.kt
...java/com/xx/hbhconsumer/data/http/requst/LogoffRequest.kt
+32
-0
LogoffFirstStepActivity.java
...com/xx/hbhconsumer/ui/logoff/LogoffFirstStepActivity.java
+2
-2
LogoffFirstStepViewModel.java
...om/xx/hbhconsumer/ui/logoff/LogoffFirstStepViewModel.java
+6
-5
LogoffSecondStepActivity.java
...om/xx/hbhconsumer/ui/logoff/LogoffSecondStepActivity.java
+5
-3
LogoffSecondStepViewModel.java
...m/xx/hbhconsumer/ui/logoff/LogoffSecondStepViewModel.java
+38
-27
No files found.
consumer/src/main/java/com/xx/hbhconsumer/data/http/ApiService.kt
View file @
c329aeb3
...
@@ -374,5 +374,11 @@ interface ApiService {
...
@@ -374,5 +374,11 @@ interface ApiService {
@Headers
(
"Content-type:application/json"
)
@Headers
(
"Content-type:application/json"
)
@POST
(
"app/activity/queryAppActivityList"
)
@POST
(
"app/activity/queryAppActivityList"
)
fun
getActivityList
(
@Body
requestBody
:
RequestBody
):
Observable
<
BaseResponse
<
List
<
ActivityCenterBean
>>>
fun
getActivityList
(
@Body
requestBody
:
RequestBody
):
Observable
<
BaseResponse
<
List
<
ActivityCenterBean
>>>
/**
* 查询活动列表信息
*/
@Headers
(
"Content-type:application/json"
)
@POST
(
"app/user/closure-with-reason"
)
fun
logoff
(
@Body
requestBody
:
RequestBody
):
Observable
<
BaseResponse
<
Boolean
>>
}
}
\ No newline at end of file
consumer/src/main/java/com/xx/hbhconsumer/data/http/requst/LogoffRequest.kt
0 → 100644
View file @
c329aeb3
package
com.xx.hbhconsumer.data.http.requst
import
com.xx.hbhconsumer.data.http.BaseRespons
import
io.reactivex.rxjava3.core.Observable
import
me.goldze.mvvmhabit.http.ApiParams
import
me.goldze.mvvmhabit.http.BaseResponse
class
LogoffRequest
:
BaseRespons
()
{
/**
* 获取验证码
*/
fun
logoff
(
accountClosureMark
:
String
,
accountClosureReason
:
String
):
Observable
<
BaseResponse
<
Boolean
>>
{
return
apiService
.
logoff
(
ApiParams
<
LogoffRequestBody
>().
setParams
(
LogoffRequestBody
(
accountClosureMark
,
accountClosureReason
)
));
}
/**
* 忘记密码入参
*
*/
class
LogoffRequestBody
(
var
accountClosureMark
:
String
,
var
accountClosureReason
:
String
)
}
\ No newline at end of file
consumer/src/main/java/com/xx/hbhconsumer/ui/logoff/LogoffFirstStepActivity.java
View file @
c329aeb3
...
@@ -25,12 +25,12 @@ public class LogoffFirstStepActivity extends BaseActivity<ActivityLogoffFirstSte
...
@@ -25,12 +25,12 @@ public class LogoffFirstStepActivity extends BaseActivity<ActivityLogoffFirstSte
public
void
initData
()
{
public
void
initData
()
{
super
.
initData
();
super
.
initData
();
viewModel
.
logoffType
.
observe
(
this
,
logoffType
->
{
viewModel
.
logoffType
.
observe
(
this
,
logoffType
->
{
if
(
logoffType
==
0
)
{
if
(
logoffType
==
1
)
{
binding
.
rgSecurityReason
.
clearCheck
();
binding
.
rgSecurityReason
.
clearCheck
();
binding
.
rgOther
.
clearCheck
();
binding
.
rgOther
.
clearCheck
();
binding
.
rbUnbindPhone
.
setChecked
(
true
);
binding
.
rbUnbindPhone
.
setChecked
(
true
);
binding
.
etOtherReason
.
setEnabled
(
false
);
binding
.
etOtherReason
.
setEnabled
(
false
);
}
else
if
(
logoffType
==
1
)
{
}
else
if
(
logoffType
==
2
)
{
binding
.
rgUnbindPhone
.
clearCheck
();
binding
.
rgUnbindPhone
.
clearCheck
();
binding
.
rgOther
.
clearCheck
();
binding
.
rgOther
.
clearCheck
();
binding
.
rbSecurityReason
.
setChecked
(
true
);
binding
.
rbSecurityReason
.
setChecked
(
true
);
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/logoff/LogoffFirstStepViewModel.java
View file @
c329aeb3
...
@@ -15,7 +15,7 @@ import me.goldze.mvvmhabit.binding.command.BindingCommand;
...
@@ -15,7 +15,7 @@ import me.goldze.mvvmhabit.binding.command.BindingCommand;
public
class
LogoffFirstStepViewModel
extends
BaseViewModel
<
ForgetPwdRequest
>
{
public
class
LogoffFirstStepViewModel
extends
BaseViewModel
<
ForgetPwdRequest
>
{
public
ObservableField
<
String
>
otherReason
=
new
ObservableField
<>(
""
);
public
ObservableField
<
String
>
otherReason
=
new
ObservableField
<>(
""
);
public
MutableLiveData
<
Integer
>
logoffType
=
new
MutableLiveData
<>(
0
);
public
MutableLiveData
<
Integer
>
logoffType
=
new
MutableLiveData
<>(
1
);
public
LogoffFirstStepViewModel
(
@NonNull
Application
application
)
{
public
LogoffFirstStepViewModel
(
@NonNull
Application
application
)
{
super
(
application
);
super
(
application
);
}
}
...
@@ -29,7 +29,8 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
...
@@ -29,7 +29,8 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
@Override
@Override
public
void
call
()
{
public
void
call
()
{
Bundle
bundle
=
new
Bundle
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"pageStep"
,
""
);
bundle
.
putString
(
"accountClosureReason"
,
logoffType
.
toString
());
bundle
.
putString
(
"accountClosureMark"
,
otherReason
.
get
());
startActivity
(
LogoffSecondStepActivity
.
class
,
bundle
);
startActivity
(
LogoffSecondStepActivity
.
class
,
bundle
);
}
}
...
@@ -40,7 +41,7 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
...
@@ -40,7 +41,7 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
public
BindingCommand
selectUnbindPhone
=
new
BindingCommand
(
new
BindingAction
()
{
public
BindingCommand
selectUnbindPhone
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
@Override
public
void
call
()
{
public
void
call
()
{
logoffType
.
postValue
(
0
);
logoffType
.
postValue
(
1
);
}
}
});
});
...
@@ -48,7 +49,7 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
...
@@ -48,7 +49,7 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
public
BindingCommand
selectSecurityReason
=
new
BindingCommand
(
new
BindingAction
()
{
public
BindingCommand
selectSecurityReason
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
@Override
public
void
call
()
{
public
void
call
()
{
logoffType
.
postValue
(
1
);
logoffType
.
postValue
(
2
);
}
}
});
});
...
@@ -56,7 +57,7 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
...
@@ -56,7 +57,7 @@ public class LogoffFirstStepViewModel extends BaseViewModel<ForgetPwdRequest> {
public
BindingCommand
selectOther
=
new
BindingCommand
(
new
BindingAction
()
{
public
BindingCommand
selectOther
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
@Override
public
void
call
()
{
public
void
call
()
{
logoffType
.
postValue
(
2
);
logoffType
.
postValue
(
3
);
}
}
});
});
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/logoff/LogoffSecondStepActivity.java
View file @
c329aeb3
...
@@ -4,7 +4,7 @@ import android.os.Bundle;
...
@@ -4,7 +4,7 @@ import android.os.Bundle;
import
com.xx.hbhconsumer.BR
;
import
com.xx.hbhconsumer.BR
;
import
com.xx.hbhconsumer.R
;
import
com.xx.hbhconsumer.R
;
import
com.xx.hbhconsumer.data.http.requst.
ForgetPwd
Request
;
import
com.xx.hbhconsumer.data.http.requst.
Logoff
Request
;
import
com.xx.hbhconsumer.databinding.ActivityLogoffSecondStepBinding
;
import
com.xx.hbhconsumer.databinding.ActivityLogoffSecondStepBinding
;
import
me.goldze.mvvmhabit.base.BaseActivity
;
import
me.goldze.mvvmhabit.base.BaseActivity
;
...
@@ -32,7 +32,9 @@ public class LogoffSecondStepActivity extends BaseActivity<ActivityLogoffSecondS
...
@@ -32,7 +32,9 @@ public class LogoffSecondStepActivity extends BaseActivity<ActivityLogoffSecondS
@Override
@Override
public
LogoffSecondStepViewModel
initViewModel
()
{
public
LogoffSecondStepViewModel
initViewModel
()
{
ForgetPwdRequest
lm
=
new
ForgetPwdRequest
();
LogoffRequest
lm
=
new
LogoffRequest
();
return
new
LogoffSecondStepViewModel
(
getApplication
(),
lm
);
String
accountClosureMark
=
getIntent
().
getStringExtra
(
"accountClosureMark"
);
String
accountClosureReason
=
getIntent
().
getStringExtra
(
"accountClosureReason"
);
return
new
LogoffSecondStepViewModel
(
getApplication
(),
lm
,
accountClosureReason
,
accountClosureMark
);
}
}
}
}
consumer/src/main/java/com/xx/hbhconsumer/ui/logoff/LogoffSecondStepViewModel.java
View file @
c329aeb3
package
com
.
xx
.
hbhconsumer
.
ui
.
logoff
;
package
com
.
xx
.
hbhconsumer
.
ui
.
logoff
;
import
static
me
.
goldze
.
mvvmhabit
.
utils
.
Utils
.
Interceptor_TOKEN
;
import
android.app.Application
;
import
android.app.Application
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
com.xx.hbhconsumer.data.http.requst.ForgetPwdRequest
;
import
com.xx.hbhconsumer.data.http.requst.LogoffRequest
;
import
com.xx.hbhconsumer.ui.login.LoginActivity
;
import
io.reactivex.rxjava3.disposables.Disposable
;
import
io.reactivex.rxjava3.functions.Consumer
;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.http.ApiDisposableObserver
;
import
me.goldze.mvvmhabit.utils.RxUtils
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
public
class
LogoffSecondStepViewModel
extends
BaseViewModel
<
ForgetPwdRequest
>
{
public
class
LogoffSecondStepViewModel
extends
BaseViewModel
<
LogoffRequest
>
{
String
accountClosureMark
;
String
accountClosureReason
;
public
LogoffSecondStepViewModel
(
@NonNull
Application
application
)
{
public
LogoffSecondStepViewModel
(
@NonNull
Application
application
)
{
super
(
application
);
super
(
application
);
}
}
public
LogoffSecondStepViewModel
(
@NonNull
Application
application
,
ForgetPwdRequest
model
)
{
public
LogoffSecondStepViewModel
(
@NonNull
Application
application
,
LogoffRequest
model
,
String
accountClosureReason
,
String
accountClosureMark
)
{
super
(
application
,
model
);
super
(
application
,
model
);
this
.
accountClosureReason
=
accountClosureReason
;
this
.
accountClosureMark
=
accountClosureMark
;
}
}
// 触发确认按钮
// 触发确认按钮
...
@@ -25,29 +36,29 @@ public class LogoffSecondStepViewModel extends BaseViewModel<ForgetPwdRequest> {
...
@@ -25,29 +36,29 @@ public class LogoffSecondStepViewModel extends BaseViewModel<ForgetPwdRequest> {
@Override
@Override
public
void
call
()
{
public
void
call
()
{
// model.ForegetPwd(phone.get().toString(), password.get().toString(),code.get().toString()
)
model
.
logoff
(
accountClosureReason
,
accountClosureReason
)
//
.compose(RxUtils.schedulersTransformer()) //线程调度
.
compose
(
RxUtils
.
schedulersTransformer
())
//线程调度
//
//
.compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle
// .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle
//
.doOnSubscribe(LogoffSecondStepViewModel.this)
.
doOnSubscribe
(
LogoffSecondStepViewModel
.
this
)
//
.doOnSubscribe(new Consumer<Disposable>() {
.
doOnSubscribe
(
new
Consumer
<
Disposable
>()
{
//
@Override
@Override
//
public void accept(Disposable disposable) throws Exception {
public
void
accept
(
Disposable
disposable
)
throws
Exception
{
// showDialog("正在请求...");
//
}
}
// }).subscribe(new ApiDisposableObserver<String
>() {
}).
subscribe
(
new
ApiDisposableObserver
<
Boolean
>()
{
//
@Override
@Override
// public void onSuccess(String
resultBean) {
public
void
onSuccess
(
Boolean
resultBean
)
{
// //是指token
ToastUtils
.
showShort
(
"注销成功"
);
// Interceptor_TOKEN = "Bearer " + resultBean
;
startActivity
(
LoginActivity
.
class
)
;
// startActivity(LoginActivity.class
);
finish
(
);
//
}
}
//
//
@Override
@Override
//
public void onError(String Error) {
public
void
onError
(
String
Error
)
{
//
dismissDialog();
dismissDialog
();
//
}
}
//
//
});
});
}
}
...
...
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