提交 5051f4ba 编写于 作者: H hdx

fix(long-list): 第二次进入同一个tab白屏问题

上级 98b14364
<template> <template>
<list-view class="list" ref="listView" @scrolltolower="loadData"> <list-view class="list" ref="listView" @scrolltolower="loadData">
<!-- TODO 暂时这样写才能保证 loading 在 list 底部 -->
<template v-for="(item, index) in dataList" :key="index"> <template v-for="(item, index) in dataList" :key="index">
<list-item class="list-item"> <list-item class="list-item">
<view class="list-item-icon"> <view class="list-item-icon">
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
</view> </view>
</view> </view>
</list-item> </list-item>
<!-- TODO 暂时这样写才能保证 loading 在 list 底部 -->
<list-item key="loading" v-if="index==dataList.length-1"> <list-item key="loading" v-if="index==dataList.length-1">
<text class="loading">{{loadingText}}</text> <text class="loading">{{loadingText}}</text>
</list-item> </list-item>
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
} }
.icon-star { .icon-star {
font-family: "UtsIconsFontFamily" !important; font-family: "UtsIconsFontFamily";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
color: #ffca3e; color: #ffca3e;
......
...@@ -43,26 +43,6 @@ ...@@ -43,26 +43,6 @@
init : Boolean, init : Boolean,
} }
// 测试数据
const CategoryData = [
{
type: 'UpdatedDate',
name: '最新上架'
} as SwiperViewItem,
{
type: 'FreeHot',
name: '免费热榜'
} as SwiperViewItem,
{
type: 'PaymentHot',
name: '付费热榜'
} as SwiperViewItem,
{
type: 'HotList',
name: '热门总榜'
} as SwiperViewItem
]
export default { export default {
components: { components: {
longPage longPage
...@@ -70,7 +50,24 @@ ...@@ -70,7 +50,24 @@
data() { data() {
return { return {
pageScrollTop: 0, pageScrollTop: 0,
swiperList: [] as SwiperViewItem[], swiperList: [
{
type: 'UpdatedDate',
name: '最新上架'
} as SwiperViewItem,
{
type: 'FreeHot',
name: '免费热榜'
} as SwiperViewItem,
{
type: 'PaymentHot',
name: '付费热榜'
} as SwiperViewItem,
{
type: 'HotList',
name: '热门总榜'
} as SwiperViewItem
] as SwiperViewItem[],
swiperIndex: -1, swiperIndex: -1,
tabsScrollLeft: 0, tabsScrollLeft: 0,
swiperIndicatorLineLeft: 0, swiperIndicatorLineLeft: 0,
...@@ -82,11 +79,6 @@ ...@@ -82,11 +79,6 @@
$isTap: false $isTap: false
} }
}, },
onLoad() {
CategoryData.forEach((item) => {
this.swiperList.push(item)
})
},
onReady() { onReady() {
this.$headerHeight = (this.$refs["header"] as INode)?.offsetHeight as number this.$headerHeight = (this.$refs["header"] as INode)?.offsetHeight as number
this.$swiperWidth = (this.$refs["swiper"] as INode)?.offsetWidth as number this.$swiperWidth = (this.$refs["swiper"] as INode)?.offsetWidth as number
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册