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
2c729a1a
Commit
2c729a1a
authored
Apr 29, 2021
by
林文清
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学习
parent
6feded7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
145 additions
and
93 deletions
+145
-93
learn.js
src/common/api/learn.js
+5
-1
index.vue
src/pages/learn/index.vue
+140
-92
No files found.
src/common/api/learn.js
View file @
2c729a1a
const
globalUrl
=
process
.
uniEnv
||
{}
const
ucenterApiUrl
=
globalUrl
.
ucenterUrl
.
apiUrl
const
collegeApiUrl
=
globalUrl
.
ucenterUrl
.
xueUrl
const
sysApiUrl
=
globalUrl
.
systemUrl
.
apiUrl
let
learnApiFun
=
function
(
vm
){
/* 通知消息基本信息 */
...
...
@@ -14,8 +15,11 @@ let learnApiFun = function(vm){
let
CourseSection
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
collegeApiUrl
+
'/v1/section-details'
,
params
);
/* 更新学习情况*/
let
updateLearnCourses
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
collegeApiUrl
+
'/v1/update-learn-courses'
,
params
);
/* 获取考试结果 */
let
getExamResult
=
async
(
examId
,
params
=
{})
=>
await
vm
.
$u
.
post
(
sysApiUrl
+
'/wxh-worker-rest/rest/exam/serviceRule/userExamInfo/'
+
vm
.
vuex_token
+
'?examId='
+
examId
,
params
);
const
learnApi
=
{
getTrainingNoticeList
,
CourseList
,
ChapterDetails
,
CourseSection
,
updateLearnCourses
getTrainingNoticeList
,
CourseList
,
ChapterDetails
,
CourseSection
,
updateLearnCourses
,
getExamResult
}
return
learnApi
}
...
...
src/pages/learn/index.vue
View file @
2c729a1a
...
...
@@ -25,8 +25,9 @@
《
{{
item
.
title
}}
》
</view>
<view
class=
"news"
v-html=
"item.body"
>
{{
item
.
body
}}
<u-parse
:html=
"item.body"
></u-parse>
</view>
<u-line
color=
"#F4F5F7"
class=
"content-line"
/>
</view>
<view
v-shou=
"isLoadMore"
>
<u-loadmore
:status=
"loadStatus"
/>
...
...
@@ -110,51 +111,58 @@
<view
class=
"top"
>
<view
class=
"title u-margin-top-10 u-margin-bottom-30"
>
通用认证
</view>
<view
class=
"currency-class"
>
<view
class=
"class1"
@
click=
"aaa"
>
<image
class=
"img"
src=
"../../static/logo.png
"
mode=
""
></image>
<view
class=
"class1"
@
click=
"aaa
(0)
"
>
<image
class=
"img"
:src=
"examList[0].pic
"
mode=
""
></image>
<view
class=
"right"
>
<view
class=
"u-font-32 font-bold"
>
服务规范
{{
examList
[
0
].
title
}}
</view>
<view
class=
"u-font-24"
>
通过本认证,是接单的前提条件
{{
examList
[
0
].
desc
}}
</view>
<view
class=
""
style=
"display:flex;justify-content: space-between;"
>
<text
style=
"color: #a69999;"
>
随机20题,及格20题
</text>
<text>
通过
</text>
<view
class=
"u-font-24"
style=
"display:flex;justify-content: space-between;"
>
<text
class=
"font-color-999999"
>
{{
examList
[
0
].
condition
}}
</text>
<text
class=
"font-default-exam-color"
:class=
"
{'font-active-color':examList[0].isComplete}">
{{
examList
[
0
].
status
}}
</text>
</view>
</view>
</view>
<view
class=
"class1 u-margin-top-40"
@
click=
"aaa"
>
<image
class=
"img"
src=
"../../static/logo.png
"
mode=
""
></image>
<view
class=
"class1 u-margin-top-40"
@
click=
"aaa
(1)
"
>
<image
class=
"img"
:src=
"examList[1].pic
"
mode=
""
></image>
<view
class=
"right"
>
<view
class=
"u-font-32 font-bold"
>
接单操作
{{
examList
[
1
].
title
}}
</view>
<view
class=
"u-font-24"
>
快速认证,是否具备接单操作能力
{{
examList
[
1
].
desc
}}
</view>
<view
class=
""
style=
"display:flex;justify-content: space-between;"
>
<text
style=
"color: #a69999"
>
随机20题,及格16题
</text>
<text>
未通过
</text>
<view
class=
"u-font-24"
style=
"display:flex;justify-content: space-between;"
>
<text
class=
"font-color-999999"
>
{{
examList
[
1
].
condition
}}
</text>
<text
class=
"font-default-exam-color"
:class=
"
{'font-active-color':examList[1].isComplete}">
{{
examList
[
1
].
status
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"title u-margin-top-50 u-margin-bottom-30"
>
技能认证
</view>
<view
class=
"currency-class"
>
<view
class=
"class1"
@
click=
"aaa"
>
<image
class=
"img"
src=
"../../static/logo.png
"
mode=
""
></image>
<view
class=
"class1"
@
click=
"aaa
(2)
"
>
<image
class=
"img"
:src=
"examList[2].pic
"
mode=
""
></image>
<view
class=
"right"
>
<view
class=
"u-font-32 font-bold"
>
从0-1学习充电桩安装服务
{{
examList
[
2
].
title
}}
</view>
<view
class=
"u-font-24"
>
通过本认证后,可接充电桩业务单
{{
examList
[
2
].
desc
}}
</view>
<view
class=
""
style=
"display:flex;justify-content: space-between;"
>
<text
style=
"color: #a69999;"
>
随机30题,及格25题
</text>
<text>
未通过
</text>
<view
class=
"u-font-24"
style=
"display:flex;justify-content: space-between;"
>
<text
class=
"font-color-999999"
>
{{
examList
[
2
].
condition
}}
</text>
<text
class=
"font-default-exam-color"
:class=
"
{'font-active-color':examList[2].isComplete}">
{{
examList
[
2
].
status
}}
</text>
</view>
</view>
</view>
...
...
@@ -216,6 +224,40 @@
id
:
173
}
],
examList
:
[{
title
:
'服务规范'
,
desc
:
'通过本认证,是接单的必要条件'
,
condition
:
'随机20题,及格20题'
,
status
:
''
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"guifan1@3x.png"
,
id
:
2
,
examId
:
''
,
examStatus
:
''
,
isComplete
:
false
},
{
title
:
'接单操作'
,
desc
:
'快速认证,是否具备接单操作能力'
,
condition
:
'随机20题,及格16题'
,
status
:
''
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"guifan2@3x.png"
,
id
:
2
,
examId
:
''
,
examStatus
:
''
,
isComplete
:
false
},
{
title
:
'从0-1学习充电桩安装服务'
,
desc
:
'通过本认证后,可接充电桩业务单'
,
condition
:
'随机30题,及格25题'
,
status
:
''
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"kecehng1@3x.png"
,
id
:
2
,
examId
:
''
,
examStatus
:
''
,
isComplete
:
false
}
],
loadStatus
:
"loading"
,
//加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore
:
false
,
//是否加载中
course_id
:
"course_id_=173"
,
...
...
@@ -339,19 +381,19 @@
this
.
current
=
current
;
},
//跳转到assessment页面
aaa
()
{
var
id
=
this
.
exam
.
id
;
if
(
this
.
exam
.
examStatus
==
0
)
{
console
.
log
(
"这是
个标识符"
,
this
.
exam
.
i
d
);
aaa
(
index
)
{
var
examInfo
=
this
.
examList
[
index
]
;
if
(
examInfo
.
examStatus
==
0
)
{
console
.
log
(
"这是
申请的考试id"
,
examInfo
.
examI
d
);
wx
.
navigateTo
({
url
:
"./answer?userExamId="
+
i
d
,
url
:
"./answer?userExamId="
+
examInfo
.
examI
d
,
});
}
else
if
(
this
.
exam
.
examStatus
==
1
)
{
}
else
if
(
examInfo
.
examStatus
==
1
)
{
wx
.
navigateTo
({
url
:
"./result?userExamId="
+
i
d
,
url
:
"./result?userExamId="
+
examInfo
.
examI
d
,
});
}
else
if
(
this
.
exam
.
examStatus
==
2
)
{
}
else
if
(
examInfo
.
examStatus
==
2
)
{
wx
.
navigateTo
({
url
:
"./assessment"
,
});
...
...
@@ -415,69 +457,56 @@
});
let
that
=
this
;
let
token
=
uni
.
getStorageSync
(
'lifeData'
).
vuex_token
;
uni
.
request
({
url
:
"http://192.168.1.22"
+
"/wxh-worker-rest/rest/exam"
+
"/serviceRule/userExamInfo/"
+
token
+
"?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
();
let
token
=
that
.
vuex_token
;
let
length
=
this
.
examList
.
length
;
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
let
examId
=
this
.
examList
[
i
].
id
;
this
.
$u
.
api
.
getExamResult
(
examId
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
examList
[
i
].
examId
=
res
.
data
.
id
;
let
examResult
=
res
.
data
.
examLevelResult
;
this
.
examList
[
i
].
status
=
examResult
!=
''
?
examResult
:
'未通过'
;
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that
.
exam
=
res
.
data
;
console
.
log
(
that
.
exam
);
if
(
res
.
data
.
examStatus
==
2
)
{
console
.
log
(
"examStatus "
+
i
+
" 2"
);
that
.
applyExam
();
return
;
}
if
(
res
.
data
.
examStatus
==
1
)
{
console
.
log
(
"examStatus "
+
i
+
" 1"
);
that
.
examList
[
i
].
isComplete
=
true
;
that
.
examScore
=
res
.
data
.
examScore
;
that
.
postResult
();
return
;
}
if
(
res
.
data
.
examStatus
==
0
)
{
console
.
log
(
"examStatus "
+
i
+
" 0"
);
that
.
userExamId
=
res
.
data
.
id
;
// that.getNext();
}
}
else
{
console
.
log
(
'getUserExamInfo 200 err'
);
uni
.
showToast
({
icon
:
"none"
,
title
:
'获取考试信息失败'
,
});
}
}
else
{
})
.
catch
((
err
)
=>
{
console
.
log
(
'getUserExamInfo err'
+
err
);
uni
.
hideLoading
();
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
data
.
message
,
title
:
"获取考试信息失败"
,
});
}
},
fail
:
(
e
)
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
icon
:
"none"
,
title
:
"获取考试信息失败"
,
});
},
}
);
}
,
}
}
},
};
</
script
>
...
...
@@ -513,19 +542,26 @@
/* //培训通知 */
.notice
{
border
:
#808080
solid
2
rpx
;
/* border: #808080 solid 2rpx; */
width
:
100%
;
height
:
400
rpx
;
margin-top
:
36
rpx
;
overflow
:
hidden
;
background-color
:
#ffffff
;
border-radius
:
12
rpx
;
}
.n-head
{
text-align
:
center
;
margin
:
32
rpx
0
;
text-align
:
left
;
/* margin: 30rpx 30rpx 0 30rpx;
*/
margin-left
:
30
rpx
;
}
.news
{}
.news
{
height
:
168
rpx
;
overflow
:
hidden
;
/* margin: 30rpx 30rpx 0 30rpx; */
}
/* //在线学习 */
.currency-class
{
...
...
@@ -613,8 +649,20 @@
.font-default-color
{
color
:
#999999
;
}
.font-default-exam-color
{
color
:
#FA5A49
;
}
.font-active-color
{
color
:
#2272FF
;
}
.font-color-999999
{
color
:
#99999
;
}
.content-line
{
margin-top
:
30
rpx
;
}
</
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