|
|
@@ -5,8 +5,13 @@
|
|
|
<div class="title p-[18px] text-white text-[26px] AlimamaShuHeiTi">{{ $t('zouma') }}.</div>
|
|
|
|
|
|
<van-swipe ref="swiperRef" class="my-swipe" :width="315" touchable :stop-propagation="false">
|
|
|
- <van-swipe-item v-for="(item, index) in banners" :key="index" class="pl-[18px]" @click="goVideo(item)">
|
|
|
- <van-image width="300" height="180" :radius="18" :src="getImg(item)" fit="cover" />
|
|
|
+ <van-swipe-item
|
|
|
+ v-for="(item, index) in banners"
|
|
|
+ :key="index"
|
|
|
+ class="pl-[18px]"
|
|
|
+ @click="bannerClick(item)"
|
|
|
+ >
|
|
|
+ <van-image width="300" height="180" :radius="18" :src="item.img" fit="cover" />
|
|
|
</van-swipe-item>
|
|
|
</van-swipe>
|
|
|
|
|
|
@@ -113,12 +118,8 @@ http.get('/api/categories').then(res => {
|
|
|
})
|
|
|
|
|
|
const banners = ref([])
|
|
|
-getSeries({ pageSize: 5 }).then(res => {
|
|
|
- banners.value = res
|
|
|
- console.log(banners.value)
|
|
|
- nextTick(() => {
|
|
|
- swiperRef.value.resize()
|
|
|
- })
|
|
|
+http.get('/api/banners').then(res => {
|
|
|
+ banners.value = res.data
|
|
|
})
|
|
|
|
|
|
function getImg(series) {
|
|
|
@@ -132,13 +133,10 @@ function getImg(series) {
|
|
|
const swiperRef = ref(null)
|
|
|
|
|
|
const router = useRouter()
|
|
|
-function goVideo(info) {
|
|
|
- router.push({
|
|
|
- name: 'video',
|
|
|
- query: {
|
|
|
- id: info.id
|
|
|
- }
|
|
|
- })
|
|
|
+function bannerClick(info) {
|
|
|
+ if (info.link) {
|
|
|
+ router.push(info.link)
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|