Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6ccaabf0
authored
4 years ago
by
mReturn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 认证资质
parent
86060592
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
8 deletions
userCenter/src/main/java/com/dayu/usercenter/adapter/SelfLicenceAdapter.java
userCenter/src/main/java/com/dayu/usercenter/api/UserService2.java
userCenter/src/main/java/com/dayu/usercenter/model/UploadSelfLicenceData.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/UploadSelfLicenceActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/SelfLicenceFragment.java
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/UserLicenceFragment.java
userCenter/src/main/res/layout/activity_licence_detail.xml
userCenter/src/main/res/layout/item_user_licence.xml
userCenter/src/main/java/com/dayu/usercenter/adapter/SelfLicenceAdapter.java
View file @
6ccaabf0
...
...
@@ -22,7 +22,11 @@ public class SelfLicenceAdapter extends CoreAdapter<SelfLicenceBean, ItemUserLic
GlideImageLoader
.
load
(
mContext
,
holder
.
ivImg
,
item
.
getUrl
(),
R
.
drawable
.
icon_img_default
);
holder
.
tvTitle
.
setText
(
item
.
getName
());
holder
.
tvCompany
.
setText
(
getStatusDesc
(
item
.
getStatus
()));
if
(
item
.
getStatus
()
==
3
){
holder
.
tvCompany
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
common_red
));
}
else
{
holder
.
tvCompany
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
color_69
));
}
holder
.
ivArrow
.
setVisibility
(
View
.
GONE
);
holder
.
btnApply
.
setVisibility
(
View
.
GONE
);
}
...
...
@@ -34,7 +38,7 @@ public class SelfLicenceAdapter extends CoreAdapter<SelfLicenceBean, ItemUserLic
case
2
:
return
"审核通过"
;
case
3
:
return
"
审核未通过
"
;
return
"
被拒绝
"
;
default
:
return
""
;
}
...
...
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/api/UserService2.java
View file @
6ccaabf0
...
...
@@ -309,4 +309,10 @@ public interface UserService2 {
@POST
(
Constants
.
API_7100
+
"/engineerCertificate"
)
Observable
<
BaseResponse
<
Boolean
>>
uploadSelfLicence
(
@Body
UploadSelfLicenceData
data
);
/**
* 重新上传个人认证
*/
@PUT
(
Constants
.
API_7100
+
"/engineerCertificate"
)
Observable
<
BaseResponse
<
Boolean
>>
reUploadSelfLicence
(
@Body
UploadSelfLicenceData
data
);
}
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/model/UploadSelfLicenceData.java
View file @
6ccaabf0
...
...
@@ -7,6 +7,7 @@ public class UploadSelfLicenceData {
public
String
name
;
public
String
url
;
public
int
status
=
1
;
public
int
id
;
public
UploadSelfLicenceData
()
{
}
...
...
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/UploadSelfLicenceActivity.java
View file @
6ccaabf0
...
...
@@ -7,6 +7,7 @@ import com.dayu.base.api.Api;
import
com.dayu.base.api.BaseApiFactory
;
import
com.dayu.base.ui.activity.BaseActivity
;
import
com.dayu.base.ui.presenter.SImplePresenter
;
import
com.dayu.common.Constants
;
import
com.dayu.usercenter.R
;
import
com.dayu.usercenter.api.UserService2
;
import
com.dayu.usercenter.databinding.ActivityUploadSelfLicenceBinding
;
...
...
@@ -30,7 +31,10 @@ import okhttp3.RequestBody;
public
class
UploadSelfLicenceActivity
extends
BaseActivity
<
SImplePresenter
,
ActivityUploadSelfLicenceBinding
>
{
private
String
imgPath
;
private
String
imgUrl
;
private
String
imgEditUrl
;
private
String
content
;
private
boolean
isEdit
;
int
lid
;
@Override
public
void
setPresenter
()
{
...
...
@@ -47,19 +51,37 @@ public class UploadSelfLicenceActivity extends BaseActivity<SImplePresenter, Act
@Override
public
void
initView
()
{
initUser
();
if
(
getIntent
().
hasExtra
(
Constants
.
TITLE
)){
isEdit
=
true
;
lid
=
getIntent
().
getIntExtra
(
Constants
.
ID
,
0
);
String
title
=
getIntent
().
getStringExtra
(
Constants
.
TITLE
);
imgEditUrl
=
getIntent
().
getStringExtra
(
Constants
.
URL
);
mBind
.
edtContent
.
setText
(
title
);
GlideImageLoader
.
loadFit
(
UploadSelfLicenceActivity
.
this
,
mBind
.
ivImg
,
imgEditUrl
);
}
mBind
.
titleBack
.
setOnClickListener
(
view
->{
dumpBack
();
});
mBind
.
btnUpload
.
setOnClickListener
(
view
->
toUplad
());
mBind
.
btnUpload
.
setOnClickListener
(
view
->
preSubmit
());
mBind
.
rlImg
.
setOnClickListener
(
view
->
MediaChooseUtils
.
chooseSigleImg
(
this
));
}
private
void
toUplad
()
{
private
void
preSubmit
()
{
content
=
mBind
.
edtContent
.
getText
().
toString
();
if
(
TextUtils
.
isEmpty
(
content
.
trim
()))
{
showToast
(
"请输入认证名称"
);
return
;
}
if
(
isEdit
&&
!
TextUtils
.
isEmpty
(
imgEditUrl
)){
imgUrl
=
imgEditUrl
;
reUpload
();
}
else
{
toUplad
();
}
}
private
void
toUplad
()
{
if
(
TextUtils
.
isEmpty
(
imgPath
))
{
showToast
(
"请选择图片"
);
return
;
...
...
@@ -71,7 +93,11 @@ public class UploadSelfLicenceActivity extends BaseActivity<SImplePresenter, Act
BaseApiFactory
.
uploadPhoto
(
body
).
subscribe
(
mPresenter
.
baseObserver
(
list
->
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
imgUrl
=
list
.
get
(
0
);
if
(
isEdit
){
reUpload
();
}
else
{
upload
();
}
}
else
{
showToast
(
"图片上传失败"
);
}
...
...
@@ -90,6 +116,19 @@ public class UploadSelfLicenceActivity extends BaseActivity<SImplePresenter, Act
}
}));
}
//上传认证资料
private
void
reUpload
()
{
UploadSelfLicenceData
data
=
new
UploadSelfLicenceData
(
mUserId
,
mUserInfo
.
getAccountName
(),
mUserInfo
.
getMobile
(),
content
,
imgUrl
);
data
.
id
=
lid
;
Api
.
getService
(
UserService2
.
class
).
reUploadSelfLicence
(
data
).
compose
(
Api
.
applySchedulers
())
.
subscribe
(
mPresenter
.
baseObserver
(
success
->
{
if
(
success
)
{
showToast
(
"上传成功"
);
EventBus
.
getDefault
().
post
(
new
UploadSelfLicenceEvent
());
finish
();
}
}));
}
@Override
...
...
@@ -100,6 +139,7 @@ public class UploadSelfLicenceActivity extends BaseActivity<SImplePresenter, Act
case
PictureConfig
.
CHOOSE_REQUEST
:
List
<
LocalMedia
>
mSelectList
=
PictureSelector
.
obtainMultipleResult
(
data
);
if
(
mSelectList
!=
null
)
{
imgEditUrl
=
""
;
for
(
int
a
=
0
;
a
<
mSelectList
.
size
();
a
++)
{
if
(!
TextUtils
.
isEmpty
(
mSelectList
.
get
(
a
).
getCompressPath
()))
{
imgPath
=
mSelectList
.
get
(
a
).
getCompressPath
();
...
...
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/SelfLicenceFragment.java
View file @
6ccaabf0
package
com
.
dayu
.
usercenter
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
com.dayu.base.ui.fragment.BaseFragment
;
import
com.dayu.common.Constants
;
import
com.dayu.usercenter.R
;
import
com.dayu.usercenter.adapter.SelfLicenceAdapter
;
import
com.dayu.usercenter.databinding.FragmentUserLicenceBinding
;
import
com.dayu.usercenter.event.UploadSelfLicenceEvent
;
import
com.dayu.usercenter.presenter.userlicence.UserLicenceContract
;
import
com.dayu.usercenter.presenter.userlicence.UserLicencePresent
;
import
com.dayu.usercenter.ui.activity2.UploadSelfLicenceActivity
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -48,6 +51,16 @@ public class SelfLicenceFragment extends BaseFragment<UserLicencePresent, Fragme
mAdapter
.
setPresent
(
mPresenter
);
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
setOnItemClickListener
((
item
,
bind
)
->
{
if
(
item
.
getStatus
()
==
3
){
Intent
intent
=
new
Intent
(
getContext
(),
UploadSelfLicenceActivity
.
class
);
intent
.
putExtra
(
Constants
.
ID
,
item
.
getId
());
intent
.
putExtra
(
Constants
.
TITLE
,
item
.
getName
());
intent
.
putExtra
(
Constants
.
URL
,
item
.
getUrl
());
startActivity
(
intent
);
}
});
showDialog
();
mPresenter
.
refresh
();
...
...
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/UserLicenceFragment.java
View file @
6ccaabf0
...
...
@@ -49,13 +49,13 @@ public class UserLicenceFragment extends BaseFragment<UserLicencePresent, Fragme
mAdapter
.
setViewType
(
R
.
layout
.
item_user_licence
);
mAdapter
.
setPresent
(
mPresenter
);
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
if
(
type
==
1
){
//
if (type == 1){
mAdapter
.
setOnItemClickListener
((
item
,
bind
)
->
{
Bundle
bundleDetail
=
new
Bundle
();
bundleDetail
.
putInt
(
Constants
.
ID
,
item
.
getId
());
startActivity
(
LicenceDetailActivity
.
class
,
bundleDetail
);
});
}
//
}
showDialog
();
...
...
This diff is collapsed.
Click to expand it.
userCenter/src/main/res/layout/activity_licence_detail.xml
View file @
6ccaabf0
...
...
@@ -45,9 +45,9 @@
<ImageView
imageUrl=
"@{presenter.mItem.url}"
android:layout_width=
"
@dimen/dp_60
"
android:layout_height=
"
@dimen/dp_60
"
android:layout_marginBottom=
"2
2.2
dp"
android:layout_width=
"
150dp
"
android:layout_height=
"
150dp
"
android:layout_marginBottom=
"2
0
dp"
android:layout_marginTop=
"28dp"
android:src=
"@drawable/ic_camera"
/>
...
...
@@ -60,6 +60,7 @@
android:textSize=
"16sp"
/>
<TextView
android:visibility=
"gone"
android:id=
"@+id/certificaiton_authority"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -70,6 +71,7 @@
android:textSize=
"14sp"
/>
<TextView
android:layout_marginTop=
"5dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
...
...
This diff is collapsed.
Click to expand it.
userCenter/src/main/res/layout/item_user_licence.xml
View file @
6ccaabf0
...
...
@@ -2,6 +2,7 @@
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<LinearLayout
android:id=
"@+id/ll_root"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
...
...
This diff is collapsed.
Click to expand it.
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