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
0bf99ddf
Commit
0bf99ddf
authored
Apr 25, 2021
by
zhengzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冲突
parent
10fa606f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
365 additions
and
370 deletions
+365
-370
.env.dev.js
.env.dev.js
+2
-2
.env.js
.env.js
+1
-1
index.vue
src/pages/learn/index.vue
+362
-367
No files found.
.env.dev.js
View file @
0bf99ddf
const
UNI_APP
=
{
ucenterUrl
:
{
apiUrl
:
'http://
rest-u.yunya.com
'
,
//php端域名请求头
// xueUrl: 'https://xue.banshouhui.com
', //学院
apiUrl
:
'http://
192.168.1.46
'
,
//php端域名请求头
xueUrl
:
'http://192.168.1.46:8088
'
,
//学院
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl
:
{
...
...
.env.js
View file @
0bf99ddf
;
(
function
()
{
let
NODE_ENV
=
'
test
'
;
// dev:开发环境 | test:测试环境
let
NODE_ENV
=
'
dev
'
;
// dev:开发环境 | test:测试环境
let
ENV_VAR
=
null
;
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
...
...
src/pages/learn/index.vue
View file @
0bf99ddf
...
...
@@ -162,383 +162,378 @@
</
template
>
<
script
>
<<<<<<<
.
merge_file_a10028
export
default
{
data
()
{
return
{
msg
:
"赣南吴彦祖"
,
tabs
:
[{
name
:
"交付规范"
,
},
{
name
:
"培训通知"
,
},
{
name
:
"在线学习"
,
},
{
name
:
"考核认证"
,
},
],
current
:
0
,
swiperCurrent
:
0
,
params
:
{
start
:
0
,
},
list
:
[],
courselist
:
null
,
loadStatus
:
"loading"
,
//加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore
:
false
,
//是否加载中
course_id
:
"course_id_=173"
,
exam
:
null
};
},
onLoad
()
{
this
.
getList
();
this
.
getCourseList
();
this
.
getUserExamInfo
();
},
computed
:{
bannerImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'banner-xx.png'
},
},
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"
;
}
}
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
;
}
});
},
//在线学习通用课程信息
getCourseList
()
{
this
.
$u
.
api
.
CourseList
()
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
)
{
this
.
courselist
=
res
.
data
;
console
.
log
(
"--------"
)
console
.
log
(
this
.
courselist
)
if
(
res
.
data
.
length
<
5
)
{
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this
.
isLoadMore
=
true
;
this
.
loadStatus
=
"nomore"
;
}
else
{
this
.
isLoadMore
=
false
;
}
}
else
{
this
.
isLoadMore
=
true
;
this
.
loadStatus
=
"nomore"
;
}
}
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
;
}
});
},
//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"
,
});
},
//跳转到课程介绍
ccc
(
id
){
uni
.
navigateTo
({
url
:
"./curriculum?course_id="
+
id
})
},
//跳转到
bbb
(
e
)
{
var
news
=
{
body
:
e
.
body
,
id
:
e
.
id
,
level
:
e
.
level
,
title
:
e
.
title
};
// console.log(news)
uni
.
navigateTo
({
url
:
"./news-details"
});
setTimeout
(()
=>
{
uni
.
$emit
(
'news'
,
news
),
console
.
log
(
'发送数据'
)},
500
)
console
.
log
(
'跳转结束11111111'
)
},
//scroll-view到底部加载更多
onreachBottom
()
{
console
.
log
(
"上拉触底函数"
);
//上拉触底函数
if
(
!
this
.
isLoadMore
)
{
this
.
isLoadMore
=
true
;
this
.
params
.
start
+=
5
;
if
(
this
.
loadStatus
!==
"nomore"
)
{
this
.
getList
();
}
}
},
//跳转到拍照小程序首页
goToPrint
()
{
console
.
log
(
"111111"
);
uni
.
navigateToMiniProgram
({
appId
:
"wxd1d6eede324b0465"
,
success
(
res
)
{
//打开成功
console
.
log
(
"success"
,
res
);
},
fail
(
err
)
{
console
.
log
(
"err"
,
err
);
},
});
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo
()
{
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
({
icon
:
'none'
,
title
:
res
.
data
.
message
})
}
},
fail
:
(
e
)
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
'获取考试信息失败'
})
}
})
},
},
};
export
default
{
data
()
{
return
{
msg
:
"赣南吴彦祖"
,
tabs
:
[
{
name
:
"交付规范"
,
},
{
name
:
"培训通知"
,
},
{
name
:
"在线学习"
,
},
{
name
:
"考核认证"
,
},
],
current
:
0
,
swiperCurrent
:
0
,
params
:
{
start
:
0
,
},
list
:
[],
courselist
:
null
,
loadStatus
:
"loading"
,
//加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore
:
false
,
//是否加载中
course_id
:
"course_id_=173"
,
exam
:
null
,
};
},
onLoad
()
{
this
.
getList
();
this
.
getCourseList
();
this
.
getUserExamInfo
();
},
computed
:
{
bannerImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
"banner-xx.png"
;
},
},
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"
;
}
}
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
;
}
});
},
//在线学习通用课程信息
getCourseList
()
{
this
.
$u
.
api
.
CourseList
()
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
)
{
this
.
courselist
=
res
.
data
;
console
.
log
(
"--------"
);
console
.
log
(
this
.
courselist
);
if
(
res
.
data
.
length
<
5
)
{
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this
.
isLoadMore
=
true
;
this
.
loadStatus
=
"nomore"
;
}
else
{
this
.
isLoadMore
=
false
;
}
}
else
{
this
.
isLoadMore
=
true
;
this
.
loadStatus
=
"nomore"
;
}
}
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
;
}
});
},
//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"
,
});
},
//跳转到课程介绍
ccc
(
id
)
{
uni
.
navigateTo
({
url
:
"./curriculum?course_id="
+
id
,
});
},
//跳转到
bbb
(
e
)
{
var
news
=
{
body
:
e
.
body
,
id
:
e
.
id
,
level
:
e
.
level
,
title
:
e
.
title
,
};
// console.log(news)
uni
.
navigateTo
({
url
:
"./news-details"
,
});
setTimeout
(()
=>
{
uni
.
$emit
(
"news"
,
news
),
console
.
log
(
"发送数据"
);
},
500
);
console
.
log
(
"跳转结束11111111"
);
},
//scroll-view到底部加载更多
onreachBottom
()
{
console
.
log
(
"上拉触底函数"
);
//上拉触底函数
if
(
!
this
.
isLoadMore
)
{
this
.
isLoadMore
=
true
;
this
.
params
.
start
+=
5
;
if
(
this
.
loadStatus
!==
"nomore"
)
{
this
.
getList
();
}
}
},
//跳转到拍照小程序首页
goToPrint
()
{
console
.
log
(
"111111"
);
uni
.
navigateToMiniProgram
({
appId
:
"wxd1d6eede324b0465"
,
success
(
res
)
{
//打开成功
console
.
log
(
"success"
,
res
);
},
fail
(
err
)
{
console
.
log
(
"err"
,
err
);
},
});
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo
()
{
uni
.
showLoading
({
title
:
"请稍候"
,
});
let
that
=
this
;
uni
.
request
({
url
:
"http://192.168.1.22"
+
"/wxh-worker-rest/rest/exam"
+
"/serviceRule/userExamInfo/"
+
getApp
().
globalData
.
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
();
}
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
data
.
message
,
});
}
},
fail
:
(
e
)
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
icon
:
"none"
,
title
:
"获取考试信息失败"
,
});
},
});
},
},
};
</
script
>
<
style
>
.study
{
height
:
100vh
;
background-color
:
#f4f5f7
;
padding
:
0
rpx
30
rpx
0
30
rpx
;
}
.title-view
{
color
:
#333333
;
font-weight
:
bold
;
font-size
:
40
rpx
;
}
.study
{
height
:
100vh
;
background-color
:
#f4f5f7
;
padding
:
0
rpx
30
rpx
0
30
rpx
;
}
.title-view
{
color
:
#333333
;
font-weight
:
bold
;
font-size
:
40
rpx
;
}
.banner
{
width
:
690
rpx
;
height
:
240
rpx
;
/* margin-left: -15rpx; */
}
.banner
{
width
:
690
rpx
;
height
:
240
rpx
;
/* margin-left: -15rpx; */
}
//
交付规范
.standard
{
width
:
656
rpx
;
display
:
flex
;
justify-content
:
space-between
;
border-bottom
:
1
rpx
solid
#82848a
;
padding
:
0
34
rpx
;
margin
:
72
rpx
auto
;
}
/* //交付规范 */
.standard
{
width
:
656
rpx
;
display
:
flex
;
justify-content
:
space-between
;
border-bottom
:
1
rpx
solid
#82848a
;
padding
:
0
34
rpx
;
margin
:
72
rpx
auto
;
}
//
培训通知
.notice
{
border
:
#808080
solid
2
rpx
;
width
:
100%
;
height
:
400
rpx
;
margin-top
:
36
rpx
;
overflow
:
hidden
;
}
/* //培训通知 */
.notice
{
border
:
#808080
solid
2
rpx
;
width
:
100%
;
height
:
400
rpx
;
margin-top
:
36
rpx
;
overflow
:
hidden
;
}
.n-head
{
text-align
:
center
;
margin
:
32
rpx
0
;
}
.news
{
}
//
在线学习
.currency-class
{
width
:
100%
;
background
:
#ffffff
;
padding
:
18
rpx
;
margin-bottom
:
11px
;
border-radius
:
12
rpx
;
}
.title
{
font-size
:
32
rpx
;
font-weight
:
bold
;
font-family
:
PingFang-SC-Bold
,
PingFang-SC
;
}
.class1
{
display
:
flex
;
justify-content
:
space-between
;
padding-top
:
22
rpx
;
margin-top
:
28
rpx
;
border-top
:
1
rpx
solid
#808080
;
}
.n-head
{
text-align
:
center
;
margin
:
32
rpx
0
;
}
.news
{
}
/* //在线学习 */
.currency-class
{
width
:
100%
;
background
:
#ffffff
;
padding
:
18
rpx
;
margin-bottom
:
11px
;
border-radius
:
12
rpx
;
}
.title
{
font-size
:
32
rpx
;
font-weight
:
bold
;
font-family
:
PingFang-SC-Bold
,
PingFang-SC
;
}
.class1
{
display
:
flex
;
justify-content
:
space-between
;
padding-top
:
22
rpx
;
margin-top
:
28
rpx
;
border-top
:
1
rpx
solid
#808080
;
}
.img
{
width
:
201
rpx
;
height
:
201
rpx
;
display
:
block
;
margin-right
:
0
rpx
;
}
.img
{
width
:
201
rpx
;
height
:
201
rpx
;
display
:
block
;
margin-right
:
0
rpx
;
}
.right
{
width
:
428
rpx
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
}
.intro
{
color
:
#9999a6
;
}
.tab
{
background
:
#fff
;
height
:
82
rpx
;
margin
:
0
0
;
}
.right
{
width
:
428
rpx
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
}
.intro
{
color
:
#9999a6
;
}
.tab
{
background
:
#fff
;
height
:
82
rpx
;
margin
:
0
0
;
}
.text
{
margin
:
0
40
rpx
;
line-height
:
82
rpx
;
color
:
#667eb5
;
}
.text
{
margin
:
0
40
rpx
;
line-height
:
82
rpx
;
color
:
#667eb5
;
}
.content
{
margin
:
5px
0
;
height
:
485
rpx
;
background
:
#fff
;
}
.content
{
margin
:
5px
0
;
height
:
485
rpx
;
background
:
#fff
;
}
swiper
{
height
:
691
rpx
;
}
swiper
{
height
:
691
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