Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
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
杨凯
YDL-Component-Medical
Commits
bd81936d
Commit
bd81936d
authored
Feb 01, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:微信登录分享账号升级
parent
c1c8667b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
6 deletions
+83
-6
config.gradle
config.gradle
+1
-1
AccountSettingActivity.java
m-user/src/main/java/com/yidianling/user/mine/AccountSettingActivity.java
+82
-5
No files found.
config.gradle
View file @
bd81936d
...
...
@@ -8,7 +8,7 @@ ext {
"m-confide"
:
"0.0.48.91"
,
"m-consultant"
:
"0.0.59.40"
,
"m-fm"
:
"0.0.30.00"
,
"m-user"
:
"0.0.60.
38
"
,
"m-user"
:
"0.0.60.
41
"
,
"m-home"
:
"0.0.22.51"
,
"m-im"
:
"0.0.18.30"
,
"m-dynamic"
:
"0.0.7.13"
,
...
...
m-user/src/main/java/com/yidianling/user/mine/AccountSettingActivity.java
View file @
bd81936d
...
...
@@ -341,9 +341,9 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
}
/**
/* */
/**
* 绑定微信
*/
*/
/*
private void bindWx() {
showProgressDialog("绑定微信中...");
UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
...
...
@@ -393,8 +393,60 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
dismissProgressDialog();
}
});
}
}*/
/**
* 绑定微信
*/
private
void
bindWx
()
{
showProgressDialog
(
"绑定微信中..."
);
UMShareAPI
.
get
(
this
).
getPlatformInfo
(
this
,
SHARE_MEDIA
.
WEIXIN
,
new
UMAuthListener
()
{
@Override
public
void
onStart
(
SHARE_MEDIA
share_media
)
{
}
@SuppressLint
(
"CheckResult"
)
@Override
public
void
onComplete
(
SHARE_MEDIA
share_media
,
int
i
,
Map
<
String
,
String
>
map
)
{
if
(
map
==
null
||
map
.
size
()==
0
)
{
return
;
}
String
openid
=
map
.
get
(
"openid"
);
String
unionid
=
map
.
get
(
"unionid"
);
userHttp
.
bindWX
(
new
BindWX
(
openid
,
unionid
))
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
o
->
{
dismissProgressDialog
();
if
(
o
.
code
==
0
)
{
UserHelper
.
INSTANCE
.
getUserInfo
().
getUserInfo
().
setBind_weixin
(
1
);
jtv_wechat
.
setRightText
(
"已绑定"
);
ToastUtil
.
toastShort
(
"绑定成功"
);
}
else
{
ToastHelper
.
Companion
.
show
(
o
.
msg
);
}
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
dismissProgressDialog
();
}
});
UMShareAPI
.
get
(
AccountSettingActivity
.
this
).
deleteOauth
(
AccountSettingActivity
.
this
,
SHARE_MEDIA
.
WEIXIN
,
this
);
}
@Override
public
void
onError
(
SHARE_MEDIA
share_media
,
int
i
,
Throwable
throwable
)
{
dismissProgressDialog
();
ToastUtil
.
toastShort
(
throwable
.
getMessage
());
}
@Override
public
void
onCancel
(
SHARE_MEDIA
share_media
,
int
i
)
{
dismissProgressDialog
();
}
});
}
/**
* 确认弹窗
*
...
...
@@ -418,6 +470,30 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
.
show
();
}
/* *//**
* 判断是否满足解绑条件
*
* @param type 1-微信 2-qq
*//*
private void checkUnbind(int type) {
//没有绑定手机号,且微信和qq只有一个绑定了,解绑前需要再次弹窗确认
if (TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone())) {
int flag = 0;
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_weixin() == 1) {
flag++;
}
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_qq() == 1) {
flag++;
}
if (flag != 2) {
//满足再次弹窗确认条件
noticeDialog(type);
}
} else {
unbindThirdLogin(type);
}
}*/
/**
* 判断是否满足解绑条件
*
...
...
@@ -433,16 +509,17 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
if
(
UserHelper
.
INSTANCE
.
getUserInfo
().
getUserInfo
().
getBind_qq
()
==
1
)
{
flag
++;
}
if
(
flag
!=
2
)
{
//满足再次弹窗确认条件
noticeDialog
(
type
);
}
else
{
unbindThirdLogin
(
type
);
}
}
else
{
unbindThirdLogin
(
type
);
}
}
}
/**
* 再次弹窗确认提示
*
...
...
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