初始化黄果短剧 H5 客户端
对接后端 hgmjapi.mfcg.me: - 接口解密 key 更新为 resKey360 - 登录 sysType 使用原生 getDevType(后端已放开 pc/android) - 修正榜单接口路径 /vid/rangking → /vid/ranking,方法改为 GET Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,258 @@
|
||||
<template>
|
||||
<div class="banner-wrap">
|
||||
<swiper :loop="true" ref="swiperDom"
|
||||
:autoplay="{ delay: 5000, disableOnInteraction: false, pauseOnMouseEnter: true, }" :modules="[Autoplay]"
|
||||
@slideChange="onSlideChange">
|
||||
<swiper-slide v-for="(item, index) in swiperList" :key="index" @click="toMoivePlay(item.id)">
|
||||
<DecryptImg class="banner-img" :src="item.cover" />
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
<div class="btn-list">
|
||||
<img @click="toMoivePlay(swiperList[currentIndex]?.id)" src="@/assets/images/pc/play.png" alt="">
|
||||
<img @click="toMoivePlay(swiperList[currentIndex]?.id)" src="@/assets/images/pc/like1.png" alt="">
|
||||
</div>
|
||||
<img @click="slideNext" class="left-arrow" src="@/assets/images/pc/left_arrow.png" alt="">
|
||||
<img @click="slidePrev" class="right-arrow" src="@/assets/images/pc/left_arrow.png" alt="">
|
||||
<div class="point-list">
|
||||
<i @click="changeSlideTo(i)" v-for="i in swiperList.length" :key="i"
|
||||
:class="{ active: currentIndex === i - 1 }"></i>
|
||||
</div>
|
||||
<div class="mask"></div>
|
||||
<div class="slide-wrap" v-if="bannerList.length">
|
||||
<swiper ref="swiperDom1" :modules="[Pagination, FreeMode]" free-mode :slides-per-view="3.2" :space-between="24">
|
||||
<swiper-slide v-for="(item, index) in bannerList" :key="index">
|
||||
<div class="card-item" @click="jumpPage('/moviePlay?page=1&vid=' + item.id + '&topindex=' + (index + 1))">
|
||||
<div class="item-mask"></div>
|
||||
<div :class="'top-img' + index"></div>
|
||||
<DecryptImg class="cover" :src="item.cover" />
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
<img @click="slidePrev1" class="left-arrow1" src="@/assets/images/pc/left_arrow.png" alt="">
|
||||
<div class="rigth-mask">
|
||||
<img @click="slideNext1" class="right-arrow1" src="@/assets/images/pc/left_arrow.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { Autoplay, Pagination, FreeMode } from 'swiper'
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue'
|
||||
import 'swiper/swiper.min.css';
|
||||
import { useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
|
||||
withDefaults(defineProps<{
|
||||
swiperList: Array<any>;
|
||||
bannerList: Array<any>;
|
||||
}>(), {
|
||||
swiperList: () => <Array<any>>[],
|
||||
bannerList: () => <Array<any>>[]
|
||||
})
|
||||
|
||||
const currentIndex = ref(0)
|
||||
const onSlideChange = (swiper: any) => {
|
||||
console.log(swiper.realIndex);
|
||||
|
||||
currentIndex.value = swiper.realIndex;
|
||||
}
|
||||
|
||||
const swiperDom = ref(null)
|
||||
const slideNext = () => {
|
||||
swiperDom.value && swiperDom.value.$el.swiper.slideNext()
|
||||
}
|
||||
|
||||
const slidePrev = () => {
|
||||
swiperDom.value && swiperDom.value.$el.swiper.slidePrev()
|
||||
}
|
||||
const changeSlideTo = (i: number) => {
|
||||
swiperDom.value && swiperDom.value.$el.swiper.slideTo(i, 500);
|
||||
}
|
||||
|
||||
const swiperDom1 = ref(null)
|
||||
const slideNext1 = () => {
|
||||
swiperDom1.value && swiperDom1.value.$el.swiper.slideNext()
|
||||
}
|
||||
|
||||
const slidePrev1 = () => {
|
||||
swiperDom1.value && swiperDom1.value.$el.swiper.slidePrev()
|
||||
}
|
||||
const toMoivePlay = (id: string) => {
|
||||
router.push({
|
||||
path: '/moviePlay',
|
||||
query: {
|
||||
vid: id,
|
||||
page: 1
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const jumpPage = (path: string) => {
|
||||
router.push(path)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@media (min-width: 768px) {
|
||||
.banner-wrap {
|
||||
width: 100%;
|
||||
height: 830px;
|
||||
margin-bottom: 190px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
.banner-img {
|
||||
width: 100%;
|
||||
height: 830px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.left-arrow {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: 34px;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.right-arrow {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%) rotate(180deg);
|
||||
transform-origin: center;
|
||||
left: 34px;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.point-list {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
bottom: 102px;
|
||||
right: 56px;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 1.5px;
|
||||
background: rgba(255, 255, 255, 0.30);
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: #fff;
|
||||
width: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
width: 100%;
|
||||
height: 217px;
|
||||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.80) 1.8%, rgba(0, 0, 0, 0.00) 78.8%);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.slide-wrap {
|
||||
width: 1516px;
|
||||
height: 260px;
|
||||
position: absolute;
|
||||
bottom: -190px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 3;
|
||||
|
||||
.card-item {
|
||||
width: 462px;
|
||||
height: 260px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
.item-mask {
|
||||
width: 100%;
|
||||
height: 130px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.60) 83%);
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 462px;
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
.left-arrow1 {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%) rotate(180deg);
|
||||
transform-origin: center;
|
||||
left: -40px;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.rigth-mask {
|
||||
width: 100px;
|
||||
height: 260px;
|
||||
background: linear-gradient(90deg, rgba(0, 0, 0, 0.01) 0%, #000 80%);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.right-arrow1 {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: 0px;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.btn-list {
|
||||
width: 152px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
bottom: 123px;
|
||||
left: 206px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
@for $i from 0 through 19 {
|
||||
.top-img#{$i} {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
left: 20px;
|
||||
z-index: 2;
|
||||
width: 170px;
|
||||
height: 68px;
|
||||
background: url('@/assets/images/pc/top/top#{$i + 1}.png') center no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user