Commit 8f03831f by zhangxw

学习中心我的课程新增推荐学习tab

1 parent 73484c65
......@@ -60,4 +60,8 @@ module.exports = {
getStaffStudyRank(data) {
return api.post('dj.pad.api.recommended.staff.study.duration.rank', data, [], '/rop-dj-pad/router')
},
// 获取我的课程-推荐学习
getRecommendListAPI(data) {
return api.post("dj.api.pad.learning.center.myself.course.recommend", data, [], "/rop-dj-pad/router")
}
}
......@@ -19,7 +19,10 @@ Page({
}, {
label: '已学完',
num: 0
}],
}, {
label: '推荐学习',
num: 0
}],
tabIndex: 0,
pageNum: 1,
pageSize: 10,
......@@ -52,7 +55,7 @@ Page({
*/
onShow() {
this.getStaticData()
this.getResidueTime()
this.getResidueTime()
this.getList()
},
......@@ -90,7 +93,8 @@ Page({
this.setData({
['tabList[0].num']: data.unLearnCount,
['tabList[1].num']: data.learningCount,
['tabList[2].num']: data.completedCount
['tabList[2].num']: data.completedCount,
['tabList[3].num']: data.recommendCount
})
} else {
wx.$util.showToast(message)
......@@ -105,8 +109,8 @@ Page({
pageNum: 1,
dataList: []
}, () => {
this.getList(true)
this.getStaticData()
this.getList(true)
this.getStaticData()
})
},
......@@ -132,7 +136,7 @@ Page({
learnStatus: tabIndex,
pageNum,
pageSize
}
}
this.setData({
loading: true
})
......@@ -140,8 +144,9 @@ Page({
this.setData({
loadingList: true
})
}
const res = await api.getMyCourseList(params)
}
let eventApi = tabIndex == 3 ? 'getRecommendListAPI' : 'getMyCourseList'
const res = await api[eventApi](params)
switch (tabIndex) {
case 0:
formItems = [{
......
......@@ -9,14 +9,19 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--fontSize24) var(--fontSize28);
padding: var(--fontSize24) var(--fontSize28);
.tab-scroll {
width: 100%;
white-space: nowrap;
}
.tab-box {
display: flex;
align-items: center;
display: inline-flex;
gap: var(--fontSize16);
.tab-item {
text-align: center;
padding: 0 var(--fontSize32);
text-align: center;
flex: 0 0 auto;
white-space: nowrap;
padding: 0 var(--fontSize24);
height: var(--fontSize72);
line-height: var(--fontSize72);
border-radius: var(--fontSize16);
......
<!--packageStudyCenter/pages/myCourse/myCourse.wxml-->
<view class="container">
<view class="top-box">
<view class="tab-box">
<view class="tab-item {{tabIndex == index ? 'active' : ''}}" wx:for="{{tabList}}" wx:key="index" bindtap="changeTab" data-index="{{index}}">{{item.label}}<text>{{item.num != null ? item.num : '-'}}</text></view>
</view>
<scroll-view class="tab-scroll" scroll-x show-scrollbar="{{false}}" enhanced="{{true}}">
<view class="tab-box">
<view class="tab-item {{tabIndex == index ? 'active' : ''}}" wx:for="{{tabList}}" wx:key="index" bindtap="changeTab" data-index="{{index}}">{{item.label}}<text>{{item.num != null ? item.num : ''}}</text></view>
</view>
</scroll-view>
</view>
<view class="tips-box" wx:if="{{residueObj.remindType == 1 || residueObj.remindType == 2}}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!