Commit 8f03831f by zhangxw

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

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