@ -19,12 +19,19 @@
enter - active - class = "animate__faster animate__animated animate__fadeInRight"
enter - active - class = "animate__faster animate__animated animate__fadeInRight"
leave - active - class = "animate__animated animate__fadeOutDown"
leave - active - class = "animate__animated animate__fadeOutDown"
>
>
< ScrollView ref = "actScroll" :list ="actList" :refresh-delay ="200" :scroll-x ="true" :scrollbar ="true" class = "act-scroll" >
< ScrollView
v - if = "actList.length"
ref = "actScroll"
: list = "actList"
: refresh - delay = "200"
: scroll - x = "true"
: scrollbar = "true"
class = "act-scroll"
>
< ul class = "act-list" >
< ul class = "act-list" >
< ActivityItem v-for ="(item, index) in actList" :key="index" :act-info="item" @click="clickItem" > < / ActivityItem >
< ActivityItem v-for ="(item, index) in actList" :key="index" :act-info="item" @click="clickItem" > < / ActivityItem >
< / ul >
< / ul >
< / ScrollView >
< / ScrollView >
<!-- -- >
<!-- < swiper
<!-- < swiper
v - if = "showList"
v - if = "showList"
class = "act-scroll"
class = "act-scroll"
@ -57,6 +64,7 @@
< / s w i p e r - s l i d e >
< / s w i p e r - s l i d e >
< / swiper > -- >
< / swiper > -- >
< / transition >
< / transition >
< img v -if = " showEmpty " class = "tra" src = "@/assets/images/empty_big_tra.svg" alt = "" / >
< activityDetail v-if ="showDetail" :act-info="currentItem" @close="showDetail = false" > < / activityDetail >
< activityDetail v-if ="showDetail" :act-info="currentItem" @close="showDetail = false" > < / activityDetail >
< / div >
< / div >
< / template >
< / template >
@ -123,6 +131,8 @@ function handleSwitch(index: number) {
/ / l i s t [ i n d e x ] . f u n ( )
/ / l i s t [ i n d e x ] . f u n ( )
}
}
/ / 展 示 敬 请 期 待
const showEmpty = ref ( false )
function getData ( type : 'mall' | 'shop' ) {
function getData ( type : 'mall' | 'shop' ) {
const fun = type === 'mall' ? getMallActivity ( ) : getShopActivity ( )
const fun = type === 'mall' ? getMallActivity ( ) : getShopActivity ( )
fun . then ( res => {
fun . then ( res => {
@ -130,6 +140,9 @@ function getData(type: 'mall' | 'shop') {
for ( let t = 0 ; t < res . data . length ; t ++ ) {
for ( let t = 0 ; t < res . data . length ; t ++ ) {
actList . value . push ( { id : res . data [ t ] . id , ... res . data [ t ] . content } )
actList . value . push ( { id : res . data [ t ] . id , ... res . data [ t ] . content } )
}
}
if ( ! res . data . length ) {
showEmpty . value = true
}
showList . value = true
showList . value = true
} )
} )
}
}
@ -181,4 +194,13 @@ getData('mall')
}
}
}
}
}
}
. tra {
position : fixed ;
top : 268 px ;
left : 56 px ;
width : 1808 px ;
height : 576 px ;
border - radius : 16 px ;
}
< / style >
< / style >