Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
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
游洁
thinkApp
Commits
a0eddf62
Commit
a0eddf62
authored
May 30, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/youjie/thinkapp
parents
b7c63260
949be250
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
211 additions
and
193 deletions
+211
-193
index.js
src/api/index.js
+1
-1
JobComponents.vue
src/components/index/JobComponents.vue
+1
-1
course-card.vue
src/components/index/course-card.vue
+7
-0
courseCard.vue
src/components/index/workSituation/courseCard.vue
+2
-0
examList.vue
src/components/index/workSituation/examList.vue
+12
-13
operation.vue
src/components/index/workSituation/operation.vue
+12
-16
studentList.vue
src/components/index/workSituation/studentList.vue
+6
-38
indexassembly.vue
src/pages/index/components/indexassembly.vue
+52
-55
workSituation.vue
src/pages/index/workSituation.vue
+50
-46
accountLogin.vue
src/pages/login/accountLogin.vue
+65
-20
request.js
src/utils/request.js
+3
-3
No files found.
src/api/index.js
View file @
a0eddf62
...
...
@@ -18,7 +18,7 @@ export function login(data) {
*/
export
function
parsePhone
(
data
)
{
return
request
({
url
:
'/
AppletLogin/GetGuestWeiXinMobil
e'
,
url
:
'/
Login/LoginByAuthoriz
e'
,
method
:
'post'
,
data
})
...
...
src/components/index/JobComponents.vue
View file @
a0eddf62
...
...
@@ -67,7 +67,7 @@
let
methods
=
{
JobDetails
()
{
uni
.
reLaunch
({
url
:
'/pages/index/
workSituation
?tabNme='
+
'作业情况'
url
:
'/pages/index/
jobDetails
?tabNme='
+
'作业情况'
});
}
}
...
...
src/components/index/course-card.vue
View file @
a0eddf62
...
...
@@ -93,6 +93,11 @@
this
.
$parent
.
getStuHomeWorkAndExam
(
item
.
courseId
);
this
.
currentCourse
=
item
;
data
.
showItems
=
false
setTimeout
(()
=>
{
uni
.
reLaunch
({
url
:
'/pages/index/workSituation?tabNme='
+
'作业情况'
+
'&courseId='
+
item
.
courseId
});
},
500
)
},
//计算完成百分比
calcPercentage
(
item
)
{
...
...
@@ -160,6 +165,8 @@
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
margin-bottom
:
20
rpx
;
height
:
80
rpx
;
overflow
:
hidden
;
}
.course-card
.course-item
.course-progress
{
...
...
src/components/index/workSituation/courseCard.vue
View file @
a0eddf62
...
...
@@ -278,6 +278,8 @@
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
margin-bottom
:
20
rpx
;
height
:
80
rpx
;
overflow
:
hidden
;
}
.course-card
.course-item
.course-progress
{
...
...
src/components/index/workSituation/examList.vue
View file @
a0eddf62
<
template
>
<view
class=
"examList-box"
>
<view
class=
"examList-import"
@
click=
"ImportInformation"
>
<view
class=
"examList-import"
@
click
.
stop
=
"ImportInformation"
>
<van-icon
name=
"plus"
/>
<text>
导入考试信息
</text>
</view>
<view
class=
"examList activeOne"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view
class=
"examList-center-box"
@
click=
"examDetails"
>
<view
class=
"examList-center-box"
@
click=
"examDetails
(item.ExamId)
"
>
<view
class=
"examList-center-line"
></view>
<view
class=
"examList-center flex"
>
<view
class=
"examList-left"
>
...
...
@@ -38,7 +38,7 @@
</view>
</view>
<view
class=
"examList-hint-right"
>
<view>
重新导入
</view>
<view
@
click=
"clickReimport(item)"
>
重新导入
</view>
</view>
</view>
</view>
...
...
@@ -109,24 +109,23 @@
});
let
methods
=
{
examDetails
(){
examDetails
(
item
){
uni
.
reLaunch
({
url
:
'/pages/index/examDetails
'
url
:
'/pages/index/examDetails
?examId='
+
item
});
},
//获取考试信息列表
getExamPageList
(){
proxy
.
$request
(
"/Exam/GetExamPageList"
,
data
.
Msg
).
then
(
res
=>
{
data
.
dataList
=
res
.
Data
;
})
},
ImportInformation
(){
this
.
show
=
true
data
.
show
=
true
},
uploadFilesBefore
(){
},
// 重新导入
clickReimport
(
item
){
},
// 添加导入
customUpload
(
event
){
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
...
...
src/components/index/workSituation/operation.vue
View file @
a0eddf62
<
template
>
<view
class=
"operation-box"
>
<view
class=
"operation activeOne"
>
<view
class=
"operation activeOne"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view
class=
"operation-center-box"
@
click=
"JobDetails"
>
<view
class=
"operation-center-line"
></view>
<view
class=
"operation-center flex"
>
<view
class=
"operation-left"
>
<view
class=
"operation-name"
>
高一作业
</view>
<view
class=
"operation-name"
>
{{
item
.
HomeWorkTitle
}}
</view>
<view
class=
"operation-state flex"
>
<view
class=
"operation-state-point"
></view>
<view
class=
"operation-state-text"
>
进行中
</view>
<view
class=
"operation-state-text"
>
{{
item
.
Status
==
0
?
'未开始'
:(
item
.
Status
==
1
?
'进行中'
:
'已结束'
)
}}
</view>
</view>
</view>
<view
class=
"operation-right flex"
>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
学生数
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
StuNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已提交
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
SubmitNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已批阅
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
ReviewNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
优 秀
</view>
<view
class=
"homework-score-num flex"
>
66
{{
item
.
ExcellentNum
}}
</view>
</view>
</view>
...
...
@@ -53,18 +54,13 @@
export
default
{
props
:
{
dataList
:[]
},
components
:
{},
setup
()
{
setup
(
props
)
{
let
data
=
reactive
({
obj
:
{
Name
:
''
,
Photo
:
''
,
},
showPhone
:
false
,
showLogin
:
true
,
//多次点击
dataList
:
props
.
dataList
});
let
methods
=
{
JobDetails
(){
...
...
@@ -77,7 +73,7 @@
...
toRefs
(
data
),
...
methods
};
}
,
}
};
</
script
>
<
style
scoped
>
...
...
src/components/index/workSituation/studentList.vue
View file @
a0eddf62
<
template
>
<view
class=
"studentList-box flex"
>
<view
class=
"studentList-content"
>
<view
class=
"studentList-content"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653
464014000_713
.png"
/>
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653
894192000_645
.png"
/>
</view>
<text>
周杰伦
</text>
</view>
</view>
<view
class=
"studentList-content"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
</view>
<text>
周杰伦
</text>
</view>
</view>
<view
class=
"studentList-content"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
</view>
<text>
周杰伦
</text>
</view>
</view>
<view
class=
"studentList-content"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
</view>
<text>
周杰伦
{{
item
.
StuName
}}
</text>
</view>
</view>
...
...
@@ -57,10 +24,10 @@
export
default
{
props
:
{
dataList
:
[]
},
components
:
{},
setup
()
{
setup
(
props
)
{
let
data
=
reactive
({
obj
:
{
...
...
@@ -69,6 +36,7 @@
},
showPhone
:
false
,
showLogin
:
true
,
//多次点击
dataList
:
props
.
dataList
});
let
methods
=
{
JobDetails
(){
...
...
src/pages/index/components/indexassembly.vue
View file @
a0eddf62
...
...
@@ -145,30 +145,27 @@
});
data
.
showLogin
=
false
;
//防止多次点击登录
let
res
=
await
parsePhone
({
code
,
encryptedData
,
iv
,
code
iv
})
if
(
res
&&
res
.
Data
.
phoneNumber
)
{
console
.
log
(
'dsadas'
,
res
)
data
.
obj
.
phoneNum
=
res
.
Data
.
phoneNumber
// data.obj.phoneNum = '18328620563'
data
.
obj
.
openid
=
res
.
Data
.
openid
data
.
obj
.
unionid
=
res
.
Data
.
unionid
that
.
phoneNumLogin
()
let
obj
=
{
Account
:
data
.
obj
.
phoneNum
,
WeChatName
:
data
.
obj
.
Name
,
WeChatPhoto
:
data
.
obj
.
Photo
,
OpenId
:
data
.
obj
.
openid
,
unionid
:
data
.
obj
.
unionid
,
}
try
{
uni
.
setStorageSync
(
"temporarydh"
,
obj
);
}
catch
(
e
)
{
console
.
log
(
e
,
'eeeeeee'
)
}
console
.
log
(
res
)
if
(
res
&&
res
.
Data
.
UserMobile
)
{
// console.log('dsadas', res)
// data.obj.phoneNum = res.Data.UserMobile
// that.phoneNumLogin()
// let obj = {
// Account: data.obj.phoneNum,
// WeChatName: data.obj.Name,
// WeChatPhoto: data.obj.Photo,
// OpenId: data.obj.openid,
// unionid: data.obj.unionid,
// }
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
uni
.
reLaunch
({
url
:
'/pages/index/index'
})
}
else
{
Toast
.
fail
(
"授权失败,请重新授权"
)
data
.
showLogin
=
true
;
//防止多次点击登录
...
...
@@ -176,40 +173,40 @@
}
},
//手机号授权登录
async
phoneNumLogin
()
{
let
res
=
await
phoneLogin
({
Account
:
data
.
obj
.
phoneNum
,
OpenId
:
data
.
obj
.
openid
,
unionid
:
data
.
obj
.
unionid
,
})
if
(
res
.
Code
==
1
)
{
uni
.
hideLoading
();
data
.
showLogin
=
true
;
//防止多次点击登录
res
.
Data
.
Account
=
data
.
obj
.
phoneNum
;
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
Toast
.
success
(
"登录成功"
);
setTimeout
(()
=>
{
emit
(
'success'
)
},
1000
)
data
.
showPhone
=
false
uni
.
showTabBar
()
}
else
{
data
.
showLogin
=
true
;
//防止多次点击登录
data
.
showPhone
=
false
if
(
currentRoute
==
"pages/index/index"
)
{
uni
.
showTabBar
()
//手机授权弹窗出现 隐藏tabbar
}
uni
.
hideLoading
();
if
(
res
.
Data
.
Error
==
-
1
)
{
//如果没找到电话号码 就跳入登录
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }, 1000);
}
//
async phoneNumLogin() {
//
let res = await phoneLogin({
//
Account: data.obj.phoneNum,
//
OpenId: data.obj.openid,
//
unionid: data.obj.unionid,
//
})
//
if (res.Code == 1) {
//
uni.hideLoading();
//
data.showLogin = true; //防止多次点击登录
//
res.Data.Account = data.obj.phoneNum;
//
uni.setStorageSync("userInfo", res.Data);
//
Toast.success("登录成功");
//
setTimeout(()=>{
//
emit('success')
//
},1000)
//
data.showPhone = false
//
uni.showTabBar()
//
} else {
//
data.showLogin = true; //防止多次点击登录
//
data.showPhone = false
//
if (currentRoute == "pages/index/index") {
//
uni.showTabBar() //手机授权弹窗出现 隐藏tabbar
//
}
//
uni.hideLoading();
//
if (res.Data.Error == -1) { //如果没找到电话号码 就跳入登录
//
// setTimeout(() => {
//
// uni.reLaunch({
//
// url: '/pages/login/login'
//
// });
//
// }, 1000);
//
}
}
}
//
}
//
}
};
onMounted
(()
=>
{
...
...
src/pages/index/workSituation.vue
View file @
a0eddf62
<
template
>
<view
class=
"workSituationpage"
>
<navbar
class=
"navbarSticky"
bg=
"#F6F6F6"
>
<view
class=
"index-header-box"
>
<view
class=
"index-header-box"
@
click=
"back"
>
<view
class=
"index-header-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
...
...
@@ -43,8 +43,8 @@
@
scrolltolower=
"lower"
v-if=
"dataList.length > 0"
>
<operation
v-if=
"tabNme=='作业情况'"
></operation>
<studentList
v-if=
"tabNme=='学生列表'"
></studentList>
<operation
v-if=
"tabNme=='作业情况'"
:dataList=
"dataList"
></operation>
<studentList
v-if=
"tabNme=='学生列表'"
:dataList=
"dataList"
></studentList>
<examList
v-if=
"tabNme=='考试信息'"
:dataList=
"dataList"
></examList>
<Loadmore
:state=
"pageState"
/>
</scroll-view>
...
...
@@ -95,20 +95,24 @@
}
=
getCurrentInstance
();
let
data
=
reactive
({
titleList
:[
{
name
:
'学生列表'
,
num
:
18
},
{
name
:
'作业情况'
,
num
:
5
},
{
name
:
'考试信息'
,
num
:
18
},
{
name
:
'学生列表'
,
num
:
0
},
{
name
:
'作业情况'
,
num
:
0
},
{
name
:
'考试信息'
,
num
:
0
},
],
tabNme
:
'
考试信息
'
,
tabNme
:
'
作业情况
'
,
Msg
:{
PageIndex
:
1
,
PageSize
:
10
,
ExamName
:
''
ExamName
:
''
,
courseId
:
''
},
OperationMsg
:{
courseId
:
''
},
pageCount
:
0
,
timer
:
null
,
//防抖
dataList
:[],
pageState
:
"more"
pageState
:
"more"
,
});
let
methods
=
{
...
...
@@ -119,49 +123,40 @@
},
toggleTitle
(
t
)
{
data
.
tabNme
=
t
if
(
this
.
tabNme
==
'学生列表'
){
this
.
GetExamStuList
()
}
else
if
(
this
.
tabNme
==
'作业情况'
){
data
.
dataList
=
[]
if
(
data
.
tabNme
==
'学生列表'
){
that
.
getCourseStuList
()
}
else
if
(
data
.
tabNme
==
'作业情况'
){
that
.
getGetCourseHomeWorkList
()
}
else
{
th
is
.
getExamPageList
()
th
at
.
getExamPageList
()
}
},
//获取学生列表
getCourseStuList
(){
proxy
.
$request
(
"/Teacher/GetCourseStu"
,
data
.
Msg
).
then
(
res
=>
{
proxy
.
$request
(
"/Teacher/GetCourseStu"
,
data
.
Operation
Msg
).
then
(
res
=>
{
if
(
res
){
if
(
data
.
timer
)
data
.
timer
=
null
;
if
(
data
.
Msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
}
else
{
data
.
dataList
=
[...
res
.
Data
.
PageData
,
...
data
.
dataList
];
}
data
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
data
.
Msg
.
PageIndex
>=
res
.
Data
.
PageCount
)
{
data
.
pageState
=
"none"
;
}
else
{
data
.
pageState
=
"more"
;
}
data
.
titleList
.
forEach
(
item
=>
{
if
(
item
.
name
==
'学生列表'
){
item
.
num
=
res
.
Data
.
length
}
});
data
.
dataList
=
res
.
Data
;
data
.
pageState
=
"none"
;
}
})
},
//获取作业情况列表
getGetCourseHomeWorkList
(){
proxy
.
$request
(
"/Teacher/GetCourseHomeWork"
,
data
.
Msg
).
then
(
res
=>
{
proxy
.
$request
(
"/Teacher/GetCourseHomeWork"
,
data
.
Operation
Msg
).
then
(
res
=>
{
if
(
res
){
if
(
data
.
timer
)
data
.
timer
=
null
;
if
(
data
.
Msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
}
else
{
data
.
dataList
=
[...
res
.
Data
.
PageData
,
...
data
.
dataList
];
}
data
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
data
.
Msg
.
PageIndex
>=
res
.
Data
.
PageCount
)
{
data
.
pageState
=
"none"
;
}
else
{
data
.
pageState
=
"more"
;
}
data
.
titleList
.
forEach
(
item
=>
{
if
(
item
.
name
==
'作业情况'
){
item
.
num
=
res
.
Data
.
length
}
});
data
.
dataList
=
res
.
Data
;
data
.
pageState
=
"none"
;
}
})
},
...
...
@@ -169,6 +164,11 @@
getExamPageList
(){
proxy
.
$request
(
"/Exam/GetExamPageList"
,
data
.
Msg
).
then
(
res
=>
{
if
(
res
){
data
.
titleList
.
forEach
(
item
=>
{
if
(
item
.
name
==
'考试信息'
){
item
.
num
=
res
.
Data
.
RowsCount
}
});
if
(
data
.
timer
)
data
.
timer
=
null
;
if
(
data
.
Msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
...
...
@@ -190,12 +190,12 @@
data
.
Msg
.
PageIndex
++
;
if
(
data
.
timer
)
clearTimeout
(
data
.
timer
);
data
.
timer
=
setTimeout
(()
=>
{
if
(
this
.
tabNme
==
'学生列表'
){
th
is
.
getCourseStuList
()
}
else
if
(
this
.
tabNme
==
'作业情况'
){
th
is
.
getGetCourseHomeWorkList
()
if
(
data
.
tabNme
==
'学生列表'
){
th
at
.
getCourseStuList
()
}
else
if
(
data
.
tabNme
==
'作业情况'
){
th
at
.
getGetCourseHomeWorkList
()
}
else
{
th
is
.
getExamPageList
()
th
at
.
getExamPageList
()
}
},
1000
);
}
else
{
...
...
@@ -207,6 +207,7 @@
onMounted
(()
=>
{
});
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
...
...
@@ -214,9 +215,11 @@
},
onLoad
(
option
)
{
this
.
tabNme
=
option
.
tabNme
this
.
OperationMsg
.
courseId
=
option
.
courseId
this
.
Msg
.
courseId
=
option
.
courseId
},
onShow
()
{
this
.
userData
=
uni
.
getStorageSync
(
'userInfo'
);
this
.
dataList
=
[]
if
(
this
.
tabNme
==
'学生列表'
){
this
.
getCourseStuList
()
}
else
if
(
this
.
tabNme
==
'作业情况'
){
...
...
@@ -224,6 +227,7 @@
}
else
{
this
.
getExamPageList
()
}
},
onShareAppMessage
()
{
return
{
...
...
src/pages/login/accountLogin.vue
View file @
a0eddf62
...
...
@@ -13,22 +13,38 @@
<view
class=
"login-title"
>
账号登录
</view>
<view
style=
"margin:60rpx auto;text-align: center;"
>
<div
style=
"display: inline-block;"
@
click=
"changeTypeHandler(1)"
>
<image
:class=
"
{'login-grey-avatar':userLoginType==2}" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653894192000_645.png" mode="widthFix" style="width:142rpx;">
</image>
<view
style=
"color: #282828;font-size: 24rpx;font-weight: 800;"
>
学员
</view>
</div>
<div
style=
"display: inline-block;margin-left:148rpx;"
@
click=
"changeTypeHandler(2)"
>
<image
:class=
"
{'login-grey-avatar':userLoginType==1}" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653894197000_691.png" mode="widthFix" style="width:142rpx;">
</image>
<view
style=
"color: #282828;font-size: 24rpx;font-weight: 800;"
>
教师
</view>
</div>
</view>
<view
class=
"main"
>
<van-cell-group>
<van-field
:value=
"Account"
placeholder=
"请输入
用户名
"
clearable
input-align=
"center"
@
input=
"usernameInput"
>
<van-field
:value=
"Account"
placeholder=
"请输入
预留手机号
"
clearable
input-align=
"center"
@
input=
"usernameInput"
>
</van-field>
<van-field
:value=
"Password"
password
placeholder=
"请输入密码"
clearable
input-align=
"center"
@
input=
"passwordInput"
>
<van-field
:value=
"Password"
v-if=
"userLoginType==2"
password
placeholder=
"请输入密码"
clearable
input-align=
"center"
@
input=
"passwordInput"
>
</van-field>
</van-cell-group>
</view>
<view
class=
"btnBox"
@
click=
"login"
>
立即登录
<van-loading
color=
"#f5f5f5"
v-if=
"loading"
/>
<text
v-else
>
立即登录
</text>
</view>
<view
class=
"login-bottom"
>
<view
class=
"login-bottom-text"
@
click=
"back"
>
返回
</view>
<!--
<view
class=
"login-bottom-text"
>
忘记密码
</view>
-->
</view>
</view>
<van-toast
id=
"van-toast"
/>
</view>
</
template
>
...
...
@@ -71,9 +87,17 @@
openid
:
""
,
code
:
""
,
show
:
false
,
userLoginType
:
1
,
//1为学员,2为老师
loading
:
false
});
let
methods
=
{
changeTypeHandler
(
t
){
data
.
userLoginType
=
t
if
(
t
==
1
){
msg
.
Password
=
''
}
},
usernameInput
(
val
)
{
msg
.
Account
=
val
.
detail
;
},
...
...
@@ -87,31 +111,43 @@
},
jumpPage
()
{
uni
.
reLaunch
({
url
:
"/pages/index/index"
,
url
:
data
.
userLoginType
==
1
?
"/pages/index/index"
:
'/pages/index/workSituation'
,
});
clearTimeout
();
//
clearTimeout();
},
async
login
()
{
if
(
data
.
loading
)
return
;
data
.
loading
=
true
if
(
msg
.
Account
==
""
||
!
msg
.
Account
)
{
Toast
.
fail
(
"请输入账号"
);
data
.
loading
=
true
return
;
}
if
(
msg
.
Password
==
""
||
!
msg
.
Password
)
{
if
(
(
msg
.
Password
==
""
||
!
msg
.
Password
)
&&
data
.
userLoginType
==
2
)
{
Toast
.
fail
(
"请输入密码"
);
data
.
loading
=
true
return
;
}
let
res
=
await
this
.
$request
(
'/Login/Login'
,
msg
).
then
(
res
=>
{
let
url
=
data
.
userLoginType
==
2
?
'/Login/Login'
:
'/Login/LoginByAccount'
let
res
=
await
this
.
$request
(
url
,
msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
){
res
.
Data
.
Account
=
msg
.
Account
;
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
Toast
.
success
(
"登录成功"
);
setTimeout
(()
=>
{
let
data
=
uni
.
getStorageSync
(
"userInfo"
);
if
(
data
)
{
that
.
jumpPage
();
}
},
1000
);
if
((
res
.
Data
.
AccountType
==
1
&&
data
.
userLoginType
==
2
)
||
res
.
Data
.
AccountType
==
2
&&
data
.
userLoginType
==
1
){
res
.
Data
.
Account
=
msg
.
Account
;
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
Toast
.
success
(
"登录成功"
);
setTimeout
(()
=>
{
let
data
=
uni
.
getStorageSync
(
"userInfo"
);
if
(
data
)
{
that
.
jumpPage
();
}
},
1000
);
}
else
{
data
.
loading
=
false
Toast
.
fail
(
"账号类型选择错误,请根据真实身份选择"
)
}
}
}).
catch
(
e
=>
{
data
.
loading
=
false
})
},
};
...
...
@@ -166,7 +202,7 @@
display
:
inline-block
;
}
.login-bottom
{
margin-bottom
:
1
36
rpx
;
margin-bottom
:
1
00
rpx
;
text-align
:
center
;
}
.login-title
{
...
...
@@ -198,11 +234,17 @@
background
:
-ms-linear-gradient
(
top
,
#C41726
0%
,
#831D1C
100%
);
background
:
linear-gradient
(
top
bottom
,
#C41726
0%
,
#831D1C
100%
);
}
.login-grey-avatar
{
-webkit-filter
:
grayscale
(
100%
);
}
.main
{
height
:
250
rpx
;
box-sizing
:
border-box
;
vertical-align
:
middle
;
padding
:
0
0
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
/
deep
/
.van-cell
{
height
:
88
rpx
;
...
...
@@ -217,12 +259,15 @@
overflow
:
hidden
;
margin
:
0
auto
;
margin-top
:
26
rpx
;
margin-bottom
:
11
0
rpx
;
margin-bottom
:
3
0
rpx
;
background-color
:
#C91727
;
font-size
:
30
rpx
;
font-weight
:
500
;
color
:
#FFFFFF
;
text-align
:
center
;
line-height
:
88
rpx
;
/* line-height: 88rpx; */
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
</
style
>
src/utils/request.js
View file @
a0eddf62
...
...
@@ -32,9 +32,9 @@ let request = (param) => {
icon
:
"none"
,
});
uni
.
removeStorageSync
(
'userInfo'
);
//
uni.reLaunch({
//
url:"/pages/login/login"
//
})
uni
.
reLaunch
({
url
:
"/pages/login/login"
})
reject
()
}
else
{
uni
.
showToast
({
...
...
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