Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
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
Damon
study
Commits
2b3c3363
Commit
2b3c3363
authored
Aug 03, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-v1.0.0' of
https://git.banshouhui.com/wuzhenzhe/study
into dev-v1.0.0
parents
831ec110
cf72d855
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
40 deletions
+69
-40
mine.vue
src/pages/index/mine.vue
+1
-1
info.vue
src/pages/mine/info.vue
+68
-39
No files found.
src/pages/index/mine.vue
View file @
2b3c3363
...
@@ -258,6 +258,6 @@ page {
...
@@ -258,6 +258,6 @@ page {
}
}
}
}
::v-deep
u-cell-item
.u-cell
{
::v-deep
u-cell-item
.u-cell
{
padding
:
35
rpx
32rpx
!
important
;
padding
:
50
rpx
32rpx
!
important
;
}
}
</
style
>
</
style
>
src/pages/mine/info.vue
View file @
2b3c3363
...
@@ -40,9 +40,16 @@
...
@@ -40,9 +40,16 @@
<button
<button
open-type=
"getPhoneNumber"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhonenumber"
@
getphonenumber=
"getPhonenumber"
style=
"background: none;font-size: 26rpx;padding-right: 0;"
style=
"
background: none;
font-size: 26rpx;
padding-right: 0;
padding-right: 0;
text-align: right;
width: 300rpx;
height: 150rpx;"
>
>
<text
v-if=
"getMobile"
>
{{
getMobile
}}
</text>
<text
v-if=
"getMobile"
class=
"fill-value"
>
{{
getMobile
}}
</text>
<text
v-else
class=
"empty-value"
>
去绑定
</text>
<text
v-else
class=
"empty-value"
>
去绑定
</text>
</button>
</button>
</view>
</view>
...
@@ -81,6 +88,7 @@ export default {
...
@@ -81,6 +88,7 @@ export default {
},
},
token
:
null
,
token
:
null
,
code
:
''
,
code
:
''
,
count
:
0
,
}
}
},
},
computed
:
{
computed
:
{
...
@@ -171,47 +179,58 @@ export default {
...
@@ -171,47 +179,58 @@ export default {
that
.
$u
.
toast
(
'授权失败,请重新授权'
)
that
.
$u
.
toast
(
'授权失败,请重新授权'
)
return
return
}
}
if
(
that
.
code
)
{
that
.
syncUserinfo
(
params
)
console
.
log
(
'走的第一个'
)
uni
.
checkSession
({
success
()
{
console
.
log
(
'走的第一个1'
)
//session_key 未过期,并且在本生命周期一直有效
params
.
code
=
that
.
code
that
.
syncUserinfo
(
params
)
},
fail
()
{
console
.
log
(
'走的第一个2'
)
// session_key 已经失效,需要重新执行登录流程
that
.
toLogin
()
},
})
}
else
{
console
.
log
(
'走的第二个'
)
uni
.
login
({
provider
:
'weixin'
,
success
:
(
code_res
)
=>
{
if
(
code_res
.
errMsg
==
'login:ok'
)
{
that
.
code
=
code_res
.
code
params
.
code
=
code_res
.
code
that
.
syncUserinfo
(
params
)
}
},
})
}
},
},
syncUserinfo
(
params
)
{
syncUserinfo
(
params
)
{
this
.
$u
.
api
.
loginWechatAuth
(
params
).
then
((
res
)
=>
{
let
that
=
this
this
.
student
.
phoneNumber
=
res
.
phoneNumber
uni
.
checkSession
({
this
.
$u
.
api
.
updateUserInfo
({
success
()
{
phoneNumber
:
res
.
phoneNumber
,
console
.
log
(
'走的第一个1'
)
})
//session_key 未过期,并且在本生命周期一直有效
uni
.
login
({
provider
:
'weixin'
,
success
:
(
code_res
)
=>
{
if
(
code_res
.
errMsg
==
'login:ok'
)
{
console
.
log
(
'走的第一个2'
)
params
.
code
=
code_res
.
code
that
.
$u
.
api
.
loginWechatAuth
(
params
)
.
then
((
res
)
=>
{
that
.
student
.
phoneNumber
=
res
.
phoneNumber
that
.
$u
.
api
.
updateUserInfo
({
phoneNumber
:
res
.
phoneNumber
,
})
.
then
((
ret
)
=>
{
that
.
$u
.
toast
(
'绑定成功!'
)
})
})
.
catch
((
err
)
=>
{
that
.
toLogin
()
})
}
},
})
},
fail
()
{
console
.
log
(
'走的第二个1'
,
params
)
// session_key 已经失效,需要重新执行登录流程
that
.
count
++
if
(
that
.
count
>
1
)
{
console
.
log
(
'重试次数大于1'
)
that
.
toLogin
()
}
that
.
syncUserinfo
(
params
)
},
})
})
},
},
toLogin
()
{
toLogin
()
{
uni
.
navigateTo
({
that
.
$u
.
toast
(
'登录信息失效,请重新登录后重试'
)
url
:
'pages/login/index'
,
setTimeout
(()
=>
{
})
uni
.
navigateTo
({
url
:
'pages/login/index'
,
})
},
800
)
},
},
changeHead
()
{
changeHead
()
{
//获取图片
//获取图片
...
@@ -328,8 +347,18 @@ button::after {
...
@@ -328,8 +347,18 @@ button::after {
border-right-width
:
0
;
border-right-width
:
0
;
border-top-width
:
0
;
border-top-width
:
0
;
}
}
.fill-value
{
color
:
#191c27
;
line-height
:
150rpx
;
}
.empty-value
{
.empty-value
{
color
:
#2953ff
;
color
:
#2953ff
;
line-height
:
150rpx
;
}
::v-deep
u-cell-item
.u-cell
{
padding
:
50rpx
0rpx
!
important
;
}
::v-deep
u-cell-item
:nth-child
(
3
)
.u-cell
{
padding
:
0
!
important
;
}
}
</
style
>
</
style
>
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