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
506666c1
Commit
506666c1
authored
Apr 25, 2021
by
zhengzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
7a4ee397
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
143 deletions
+78
-143
index.vue
src/pages/learn/index.vue
+78
-143
No files found.
src/pages/learn/index.vue
View file @
506666c1
...
...
@@ -189,12 +189,14 @@
courselist
:
null
,
loadStatus
:
"loading"
,
//加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore
:
false
,
//是否加载中
course_id
:
"course_id_=173"
course_id
:
"course_id_=173"
,
exam
:
null
};
},
onLoad
()
{
this
.
getList
();
this
.
getCourseList
();
this
.
getUserExamInfo
();
},
computed
:{
bannerImage
()
{
...
...
@@ -358,150 +360,83 @@
},
});
},
},
};
=======
export
default
{
data
()
{
return
{
banner
:
[
{
image
:
"https://cdn.uviewui.com/uview/swiper/1.jpg"
,
title
:
"昨夜星辰昨夜风,画楼西畔桂堂东"
,
},
{
image
:
"https://cdn.uviewui.com/uview/swiper/2.jpg"
,
title
:
"身无彩凤双飞翼,心有灵犀一点通"
,
},
{
image
:
"https://cdn.uviewui.com/uview/swiper/3.jpg"
,
title
:
"谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳"
,
},
],
tabs
:
[
{
name
:
"交付规范"
,
},
{
name
:
"培训通知"
,
},
{
name
:
"在线学习"
,
},
{
name
:
"考核认证"
,
},
],
current
:
0
,
swiperCurrent
:
0
,
params
:
{
start
:
0
,
},
list
:
[],
loadStatus
:
"loading"
,
//加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore
:
false
,
//是否加载中
};
},
onLoad
()
{
this
.
getList
();
this
.
$u
.
mpShare
.
path
=
''
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo
()
{
methods
:
{
getList
()
{
this
.
$u
.
api
.
getTrainingNoticeList
(
this
.
params
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
)
{
this
.
list
=
this
.
list
.
concat
(
res
.
data
);
if
(
res
.
data
.
length
<
5
)
{
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this
.
isLoadMore
=
true
;
this
.
loadStatus
=
"nomore"
;
}
else
{
this
.
isLoadMore
=
false
;
}
}
else
{
this
.
isLoadMore
=
true
;
this
.
loadStatus
=
"nomore"
;
uni
.
showLoading
({
title
:
'请稍候'
})
let
that
=
this
uni
.
request
({
url
:
'http://192.168.1.22'
+
'/wxh-worker-rest/rest/exam'
+
'/serviceRule/userExamInfo/'
+
'RTOKENe83309bff5846d2ff0949d58a0c0f643d60d107d'
+
'?examId='
+
2
,
method
:
'POST'
,
data
:
{
//examId:this.examId,
},
header
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
success
:
(
res
)
=>
{
console
.
log
(
res
.
data
)
uni
.
hideLoading
()
if
(
!
res
.
data
)
{
return
}
if
(
res
.
data
.
code
==
401
||
res
.
data
.
code
==
403
)
{
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
console
.
log
(
'洪塘张学友'
)
}
if
(
res
.
data
.
code
==
200
)
{
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
that
.
exam
=
res
.
data
.
data
console
.
log
(
that
.
exam
)
if
(
res
.
data
.
data
.
examStatus
==
2
)
{
that
.
applyExam
()
return
}
if
(
res
.
data
.
data
.
examStatus
==
1
){
console
.
log
(
'111111111111111111111111111'
)
that
.
isComplete
=
true
that
.
examScore
=
res
.
data
.
data
.
examScore
that
.
postResult
()
return
}
if
(
res
.
data
.
data
.
examStatus
==
0
)
{
that
.
userExamId
=
res
.
data
.
data
.
id
that
.
getNext
()
}
}
else
{
//接口请求失败的处理
uni
.
showToast
({
title
:
res
.
message
,
icon
:
"none"
});
this
.
isLoadMore
=
false
;
if
(
this
.
params
.
start
>
0
)
{
this
.
page
-=
5
;
}
}
})
.
catch
((
err
)
=>
{
uni
.
showToast
({
title
:
err
,
icon
:
"none"
,
});
this
.
isLoadMore
=
false
;
if
(
this
.
params
.
start
>
0
)
{
this
.
page
-=
5
;
icon
:
'none'
,
title
:
res
.
data
.
message
})
}
});
},
//tabs通知swiper切换
tabsChange
(
index
)
{
this
.
swiperCurrent
=
index
;
},
//swiper-item左右移动,通知tabs的滑块跟随移动
transition
(
e
)
{
let
dx
=
e
.
detail
.
dx
;
this
.
$refs
.
uTabs
.
setDx
(
dx
);
},
animationfinish
(
e
)
{
let
current
=
e
.
detail
.
current
;
this
.
$refs
.
uTabs
.
setFinishCurrent
(
current
);
this
.
swiperCurrent
=
current
;
this
.
current
=
current
;
},
//跳转到assessment页面
aaa
()
{
wx
.
navigateTo
({
url
:
"./assessment"
,
});
},
//跳转到
bbb
()
{
wx
.
navigateTo
({
url
:
"./news-details"
,
});
},
//scroll-view到底部加载更多
onreachBottom
()
{
console
.
log
(
"上拉触底函数"
);
//上拉触底函数
if
(
!
this
.
isLoadMore
)
{
this
.
isLoadMore
=
true
;
this
.
params
.
start
+=
5
;
if
(
this
.
loadStatus
!==
"nomore"
)
{
this
.
getList
();
}
fail
:
(
e
)
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
'获取考试信息失败'
})
}
},
//跳转到拍照小程序首页
goToPrint
()
{
console
.
log
(
"111111"
);
uni
.
navigateToMiniProgram
({
appId
:
"wxd1d6eede324b0465"
,
success
(
res
)
{
//打开成功
console
.
log
(
"success"
,
res
);
},
fail
(
err
)
{
console
.
log
(
"err"
,
err
);
},
});
})
},
},
};
>>>>>>>
.
merge_file_a11812
};
</
script
>
<
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