Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
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
李俊赕
self-support
Commits
f9d816ec
Commit
f9d816ec
authored
Aug 11, 2021
by
linwenqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:授权手机
parent
1b04b30b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
index.vue
src/pages/login/index.vue
+7
-9
No files found.
src/pages/login/index.vue
View file @
f9d816ec
...
...
@@ -27,9 +27,8 @@
</button>
</view>
<view
@
click
.
capture=
"getCode"
v-else
>
<button
class=
"loginBtn"
:class=
"
{disable:isClickGetPhone}"
open-type="getPhoneNumber" throttle-time="1000"
@getphonenumber="signupLogin" :disabled="isClickGetPhone">
<button
class=
"loginBtn"
open-type=
"getPhoneNumber"
throttle-time=
"1000"
@
getphonenumber=
"signupLogin"
>
<text
class=
"u-font-32 white"
>
{{
bindTitle
}}
</text>
</button>
</view>
...
...
@@ -51,7 +50,6 @@ export default {
bindPhone
:
'绑定手机'
,
bindTips
:
'首次登录的用户需绑定手机才可接单'
,
code
:
''
,
isClickGetPhone
:
false
,
}
},
computed
:
{
...
...
@@ -76,8 +74,6 @@ export default {
return
process
.
uniEnv
.
qn_base_url
+
src
},
async
getCode
()
{
this
.
isClickGetPhone
=
true
this
.
inGetAuth
()
login
.
appLogin
().
then
(
res
=>
{
this
.
code
=
res
.
code
})
...
...
@@ -104,6 +100,7 @@ export default {
}
},
fail
:
function
(
res
)
{
uni
.
hideLoading
()
uni
.
showModal
({
title
:
'授权失败'
,
content
:
'请允许获取用户信息的授权'
,
...
...
@@ -112,6 +109,7 @@ export default {
}
})
}
else
{
uni
.
hideLoading
()
// 可能由于账号配置,或者其他原因导致无法调起微信用户授权
uni
.
showModal
({
title
:
'授权失败'
,
...
...
@@ -152,7 +150,6 @@ export default {
});
},
signupLogin
(
e
)
{
this
.
inGetAuth
()
var
that
=
this
if
(
e
&&
e
.
detail
)
{
if
(
e
.
detail
.
errMsg
.
indexOf
(
'user deny'
)
>
-
1
)
{
...
...
@@ -169,6 +166,7 @@ export default {
iv
:
e
.
detail
.
iv
,
}
if
(
that
.
code
)
{
that
.
inGetAuth
()
uni
.
checkSession
({
success
()
{
//session_key 未过期,并且在本生命周期一直有效
...
...
@@ -176,7 +174,6 @@ export default {
that
.
inGetAuth
()
login
.
signup
(
params
).
then
(
res
=>
{
that
.
inGetAuth
()
that
.
isClickGetPhone
=
false
if
(
res
)
{
login
.
setUserData
(
res
.
data
,
that
)
app
.
track
(
'signup_login'
,
{
mobile
:
res
.
data
.
mobile
});
...
...
@@ -194,7 +191,6 @@ export default {
that
.
setLoginStatus
(
false
)
}
}).
catch
(
res
=>
{
that
.
isClickGetPhone
=
false
uni
.
hideLoading
()
that
.
setLoginStatus
(
false
)
})
...
...
@@ -208,6 +204,7 @@ export default {
that
.
toLogin
(
params
)
}
}
else
{
uni
.
hideLoading
()
uni
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
...
...
@@ -215,6 +212,7 @@ export default {
});
}
}
else
{
uni
.
hideLoading
()
uni
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
...
...
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