Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
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
向伟
educationStu
Commits
faf7b5f5
Commit
faf7b5f5
authored
Oct 09, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
94ed0d8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
10 deletions
+55
-10
index.vue
src/pages/index/index.vue
+2
-2
login.vue
src/pages/login/login.vue
+53
-8
No files found.
src/pages/index/index.vue
View file @
faf7b5f5
...
...
@@ -405,8 +405,8 @@ export default {
data
.
baseInfo
[
3
].
desc
=
res
.
Data
.
SurplusHours
+
"课时"
;
data
.
baseInfo
[
3
].
jumpUrl
=
"/pages/surplusTime/surplusTime?id="
+
res
.
Data
.
ClassId
;
data
.
baseInfo
[
4
].
desc
=
res
.
Data
.
ContractNum
;
data
.
baseInfo
[
5
].
desc
=
res
.
Data
.
TeacherName
;
//
data.baseInfo[4].desc = res.Data.ContractNum;
data
.
baseInfo
[
4
].
desc
=
res
.
Data
.
TeacherName
;
}
},
async
getActivityData
()
{
...
...
src/pages/login/login.vue
View file @
faf7b5f5
...
...
@@ -37,7 +37,7 @@
</view>
<view
class=
"flex flex_between_center btnBox"
>
<view
class=
"loginBtn flex flex_center_center"
@
click=
"login"
>
账号登录
</view>
<button
class=
"
loginBtn
"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getphonenumber"
>
手机号一键登录
</button>
<button
class=
"
phoneBtn flex flex_center_center
"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getphonenumber"
>
手机号一键登录
</button>
</view>
<!--
<view
class=
"auth"
@
click=
"authLogin"
>
授权手机号一键登录
</view>
-->
...
...
@@ -65,6 +65,10 @@ export default {
let
msg
=
reactive
({
Account
:
""
,
Password
:
""
,
});
let
data
=
reactive
({
phoneNum
:
""
,
openid
:
""
});
let
methods
=
{
usernameInput
(
val
)
{
...
...
@@ -106,35 +110,66 @@ export default {
setTimeout
(()
=>
{
let
data
=
uni
.
getStorageSync
(
"userInfo"
);
if
(
data
)
{
console
.
log
(
137
,
data
);
that
.
jumpPage
();
}
},
1000
);
}
},
//获取手机号
getphonenumber
(
e
){
console
.
log
(
117
,
e
)
if
(
e
.
detail
.
encryptedData
&&
e
.
detail
.
iv
){
let
encryptedData
=
e
.
detail
.
encryptedData
;
let
iv
=
e
.
detail
.
iv
;
uni
.
login
({
provider
:
'weixin'
,
success
:
async
(
loginRes
)
=>
{
let
code
=
loginRes
.
code
//解密手机号
let
res
=
await
parsePhone
({
encryptedData
,
iv
,
code
})
console
.
log
(
0
,
res
)
if
(
res
){
data
.
phoneNum
=
res
.
Data
.
phoneNumber
data
.
openid
=
res
.
Data
.
openid
that
.
phoneNumLogin
()
}
}
});
}
else
{
uni
.
showToast
({
title
:
'授权失败'
,
duration
:
2000
,
icon
:
"error"
,
});
}
},
//手机号授权登录
async
phoneNumLogin
(){
let
res
=
await
phoneLogin
({
Account
:
data
.
phoneNum
,
OpenId
:
data
.
openid
})
if
(
res
){
res
.
Data
.
Account
=
data
.
phoneNum
;
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
Toast
.
success
(
"登录成功"
);
setTimeout
(()
=>
{
let
data
=
uni
.
getStorageSync
(
"userInfo"
);
if
(
data
)
{
console
.
log
(
147
,
data
);
that
.
jumpPage
();
}
},
1000
);
}
}
};
onMounted
(()
=>
{});
let
that
=
methods
;
return
{
...
toRefs
(
msg
),
...
toRefs
(
data
),
...
methods
,
};
},
...
...
@@ -174,7 +209,7 @@ export default {
}
.loginBtn
{
width
:
2
6
0
rpx
;
width
:
2
8
0
rpx
;
height
:
90
rpx
;
background-color
:
#00acf9
;
border-radius
:
12
rpx
;
...
...
@@ -183,7 +218,17 @@ export default {
font-weight
:
500
;
color
:
#ffffff
;
}
.phoneBtn
{
width
:
280
rpx
;
height
:
90
rpx
;
background-color
:
#E6A23C
;
border-radius
:
12
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#ffffff
;
margin
:
0
;
}
.auth
{
text-align
:
center
;
font-size
:
26
rpx
;
...
...
@@ -201,8 +246,8 @@ export default {
.btnBox
{
width
:
600
rpx
;
height
:
90
rpx
;
/* background-color: #00acf9; */
border-radius
:
12
rpx
;
overflow
:
hidden
;
margin
:
0
auto
;
font-size
:
32
rpx
;
font-family
:
PingFang
SC
;
...
...
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