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
f0c9da6222f16ab7e44d3a22862222b6235963bd
1 parent
ea4f09fa
自动验证功能添加
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
app/common/login.js
app/pages/account/bindMobile.js
app/pages/account/bindMobile.wxml
app/common/login.js
View file @
f0c9da6
...
...
@@ -233,7 +233,7 @@ function decodePhoneNumber(iv, encryptedData) {
* 获取微信手机号码
* @param e
*/
function
getPhoneNumber
(
e
,
invalidJump
)
{
function
getPhoneNumber
(
e
,
{
disFailJump
,
sucCb
}
=
{}
)
{
const
app
=
getApp
();
let
router
=
global
.
router
;
...
...
@@ -269,6 +269,10 @@ function getPhoneNumber(e, invalidJump) {
event
.
emit
(
'user-login-success'
);
if
(
sucCb
)
{
sucCb
();
}
if
(
res
.
data
&&
res
.
data
.
is_register
===
0
)
{
event
.
emit
(
'bind-auto-register-type-report'
,
{
YB_REGISTER_SUCCESS
:
5
});
}
...
...
@@ -281,6 +285,10 @@ function getPhoneNumber(e, invalidJump) {
})
.
then
(
res
=>
{
if
(
disFailJump
)
{
return
;
}
if
(
res
&&
res
.
confirm
)
{
router
.
go
(
'bindMobile'
,
{
phone
:
phoneNumber
,
area
:
countryCode
});
}
...
...
@@ -289,7 +297,7 @@ function getPhoneNumber(e, invalidJump) {
router
.
go
(
'bindMobile'
,
{
phone
:
phoneNumber
,
area
:
countryCode
});
});
}
else
{
if
(
invalid
Jump
)
{
if
(
disFail
Jump
)
{
return
;
}
router
.
go
(
'bindMobile'
);
...
...
app/pages/account/bindMobile.js
View file @
f0c9da6
...
...
@@ -25,7 +25,6 @@ Page({
autoBtnText
:
'自动验证'
,
isNeedImgCheck
:
false
},
getUserInfoLogin
,
onLoad
:
function
(
query
)
{
const
{
phone
,
area
}
=
query
||
{};
...
...
@@ -67,9 +66,14 @@ Page({
yas
.
pageOpenReport
();
},
getPhoneNumber
:
function
(
e
)
{
const
invalidJump
=
false
;
const
sucCb
=
()
=>
{
wx
.
navigateBack
({
delta
:
1
});
};
getPhoneNumber
(
e
,
invalidJump
);
getPhoneNumber
(
e
,
{
disFailJump
:
true
,
sucCb
});
},
getUserInfoLogin
:
function
(
e
)
{
getUserInfoLogin
(
e
);
},
phoneInput
:
function
(
e
)
{
this
.
setData
({
...
...
app/pages/account/bindMobile.wxml
View file @
f0c9da6
...
...
@@ -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
wx:if="{{false}}"
class="btn auto-bind" open-type="{{hasUnionID?'getPhoneNumber':'getUserInfo'}}"
<button 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