修复:查看图书详情后返回首页屏幕定位问题、及选择的图书标签返回后会重置选择第一个
This commit is contained in:
@@ -120,13 +120,13 @@
|
||||
|
||||
<scroll-view class="ProTabsBox">
|
||||
<view class="New_ProTabs flexbox">
|
||||
<text v-for="(item, index) in catTagList" :key="item.splId" :class="[tabsid == item.id ? 'cur' : '']"
|
||||
<text v-for="(item, index) in catTagList" :key="item.splId" :class="[catTagIndex == index ? 'cur' : '']"
|
||||
@click="tabsChange(item, index)">{{ item.title }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="children_cate_box" v-if="childrenCatList && childrenCatList.length > 0">
|
||||
<view class="children_cate flexbox">
|
||||
<view @click="childrenChange(item, index)" :class="['item', curChildrenId == item.id ? 'cur' : '']"
|
||||
<view @click="childrenChange(item, index)" :class="['item', curChildrenIndex == index ? 'cur' : '']"
|
||||
v-for="(item, index) in childrenCatList" :key="item.id">
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
@@ -347,6 +347,8 @@
|
||||
yxCurIndex: 0, // 当前营销标签序号
|
||||
SystemInfoSync: {}, // 屏幕尺寸
|
||||
newsList: [], // 播报新闻列表
|
||||
catTagIndex: 0,
|
||||
curChildrenIndex: 0
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -471,7 +473,7 @@
|
||||
},
|
||||
requestAll() {
|
||||
this.getUserInfo();
|
||||
this.tjProList = [];
|
||||
// this.tjProList = [];
|
||||
uni.hideTabBar();
|
||||
// this.getData();
|
||||
this.getTags();
|
||||
@@ -584,9 +586,11 @@
|
||||
if (this.catTagList[0].isLast == 1) {
|
||||
this.getJtData(this.catTagList[0].id);
|
||||
} else {
|
||||
this.childrenCatList = this.catTagList[0].children;
|
||||
this.curChildrenId = this.childrenCatList[0].id;
|
||||
this.getJtData(this.childrenCatList[0].id);
|
||||
const currentCatTag = this.catTagList?.[this.catTagIndex];
|
||||
this.childrenCatList = currentCatTag.children.length > 0 ? currentCatTag.children : currentCatTag;
|
||||
this.curChildrenId = this.childrenCatList[this.curChildrenIndex]?.id || this.childrenCatList.id;
|
||||
//this.getJtData(this.childrenCatList[this.curChildrenIndex]?.id);
|
||||
this.getJtData(this.curChildrenId);
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -597,11 +601,13 @@
|
||||
// 二级分类点击
|
||||
childrenChange(item, index) {
|
||||
// console.log(item,this.curChildrenId,'点击')
|
||||
this.curChildrenIndex = index;
|
||||
this.curChildrenId = this.childrenCatList[index].id;
|
||||
this.getJtData(this.childrenCatList[index].id);
|
||||
},
|
||||
tabsChange(item, cindex) {
|
||||
// this.tjProList = []
|
||||
this.catTagIndex = cindex;
|
||||
this.tabsid = item.id;
|
||||
this.childrenCatList = [];
|
||||
if (this.catTagList[cindex].isLast == 1) {
|
||||
@@ -610,6 +616,7 @@
|
||||
this.childrenCatList = this.catTagList[cindex].children;
|
||||
this.curChildrenId = this.childrenCatList[0].id;
|
||||
this.getJtData(this.childrenCatList[0].id);
|
||||
this.curChildrenIndex = 0
|
||||
}
|
||||
// this.getJtData()
|
||||
// if (this.tabsid == 15) {
|
||||
@@ -1214,7 +1221,7 @@
|
||||
color: #0e583a;
|
||||
font-size: 34rpx;
|
||||
line-height: 42rpx;
|
||||
padding: 5px 10px;
|
||||
padding: 10rpx 0 14rpx 10rpx;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
width: 100%;
|
||||
@@ -1223,6 +1230,7 @@
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
letter-spacing: 10rpx;
|
||||
width: 3.5em;
|
||||
}
|
||||
|
||||
text:last-child {
|
||||
|
||||
Reference in New Issue
Block a user