This commit is contained in:
@fawn-nine
2024-05-30 14:52:46 +08:00
parent 629c59989c
commit a91d21553a
2 changed files with 19 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="pageTitle"></z-nav-bar>
<u-tabs v-if="tabList.length > 0" class="tabList" @click="fatherClick" :activeStyle="activeStyle"
<u-tabs v-if="tabList.length > 0" class="tabList" @click="fatherClick" :current="curTagId" :activeStyle="activeStyle"
:scrollable="scrollable" :list="tabList"
itemStyle="padding-left: 15px; background-color:#fff; padding-right: 15px; height: 50px;"></u-tabs>
<view class="containerBg">
@@ -77,6 +77,7 @@
name: 111,
id: 1
}],
curTagId:0,
courseList: [],
status: 0, // 0 不显示, 1 加载中2 加载全部完成3 暂无数据
page: 1,
@@ -148,14 +149,15 @@
}
}
if (this.subTabId) {
console.log(this.subTabId, this.subList[0].title, '初始进入')
// console.log(this.subTabId, this.subList[0].title, '初始进入')
this.courseList = []
this.status = 1
this.getData(this.subTabId)
}
}
}
console.log(this.curTagId, '当前高亮')
}
}).catch(e => {
console.log(e, '获取子分类报错')

View File

@@ -333,22 +333,22 @@
getMedicalTags(id) {
var ftag = null
id ? ftag = id : ftag = 0
$http.request({
url: "curseTagList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// data: {
// 'id': ftag
// },
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
this.$http
.post('medical/home/getCourseMedicalTree')
.then(res => {
console.log(res)
if (res.code == 0) {
if (res.labels.length > 0) {
this.curseTagList = res.labels
this.tabsid = res.labels[0].id
this.curseClick(res.labels[0])
// this.curseClick(res.labels[0])
if (res.labels[0].isLast == 0) { // 非终极
if (res.labels[0].children && res.labels[0].children.length > 0) {
this.sbuMedicalTagsList = res.labels[0].children
} else {
this.sbuMedicalTagsList = []
}
}
} else {
this.tabsid = null
this.curseTagList = []
@@ -497,7 +497,7 @@
},
curseClick(item) {
this.tabsid = item.id
if (item.isLast == 1) { // 终极
if (item.isLast == 0) { // 终极
if (item.children && item.children.length > 0) {
this.sbuMedicalTagsList = item.children
} else {
@@ -511,7 +511,7 @@
},
curseClickJump(item){
uni.navigateTo({
url: `/pages/course/index?id=33&title=中医学`
url: `/pages/course/index?id=${item.id}&title=中医学`
// url: `/pages/course/index?id=${item.id}&title=${item.title}`
});
},