Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-miniapp-eshop
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李奇
7 years ago
Commit
5cf9e769c9d288dd660361fcc24564c4908e1086
1 parent
f0c9da62
未绑定开放平台、无法获取unionId、无法自动验证
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
app/common/login.js
app/pages/account/bindMobile.js
app/pages/account/bindMobile.wxml
app/common/login.js
View file @
5cf9e76
...
...
@@ -164,11 +164,16 @@ function wechatAuthLogin() { // showMsg: 是否显示拒绝授权提示
/**
* open-type获取用户信息登录绑定
*/
function
getUserInfoLogin
(
e
)
{
function
getUserInfoLogin
(
e
,
{
disFailJump
,
sucCb
}
=
{}
)
{
let
app
=
getApp
();
let
router
=
global
.
router
;
if
(
e
.
detail
.
errMsg
!==
'getUserInfo:ok'
)
{
if
(
disFailJump
)
{
return
;
}
return
router
.
go
(
'bindMobile'
);
}
...
...
@@ -179,6 +184,12 @@ function getUserInfoLogin(e) {
.
then
(
data
=>
{
if
(
data
.
data
.
union_id
)
{
app
.
setUnionID
(
data
.
data
.
union_id
);
if
(
sucCb
)
{
sucCb
();
return
{};
}
return
wechatUserIsBind
(
data
.
data
.
union_id
,
nickName
);
}
else
{
return
router
.
go
(
'bindMobile'
);
...
...
app/pages/account/bindMobile.js
View file @
5cf9e76
...
...
@@ -73,7 +73,13 @@ Page({
getPhoneNumber
(
e
,
{
disFailJump
:
true
,
sucCb
});
},
getUserInfoLogin
:
function
(
e
)
{
getUserInfoLogin
(
e
);
const
sucCb
=
()
=>
{
this
.
setData
({
hasUnionID
:
true
});
};
getUserInfoLogin
(
e
,
{
disFailJump
:
true
,
sucCb
});
},
phoneInput
:
function
(
e
)
{
this
.
setData
({
...
...
app/pages/account/bindMobile.wxml
View file @
5cf9e76
...
...
@@ -18,6 +18,6 @@
</view>
<image-check wx:if="{{isNeedImgCheck}}" class="image-check" bindrefreshCode="onRefreshCode"></image-check>
<view bindtap="submitTap" class="{{'btn confirm ' + completeClass}}">完成</view>
<button class="btn auto-bind" open-type="{{hasUnionID?'getPhoneNumber':'getUserInfo'}}"
<button
wx:if="{{false}}"
class="btn auto-bind" open-type="{{hasUnionID?'getPhoneNumber':'getUserInfo'}}"
bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfoLogin'>{{autoBtnText}}</button>
</view>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment