初始化黄果短剧 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,154 @@
|
||||
|
||||
<template>
|
||||
<div class="history">
|
||||
<h1 class="title">
|
||||
<span>观看历史</span>
|
||||
<span class="edit-btn" v-if="!state.isEdit" @click="state.isEdit = true">编辑</span>
|
||||
<div class="list-btn" v-else>
|
||||
<span class="btn1" @click="state.isEdit = false">取消</span>
|
||||
<span class="edit-btn btn2" @click="deleteHistory">删除</span>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
<div class="movie-list">
|
||||
<div class="all-select" v-if="state.isEdit" @click="allSelectFn">
|
||||
<img v-if="!state.allSelect" src="@/assets/images/pc/select1.png" alt="">
|
||||
<img v-else src="@/assets/images/pc/select2.png" alt="">
|
||||
全选
|
||||
</div>
|
||||
<div class="item-wrap" v-for="(item, index) in historyList" :key="index">
|
||||
<movieCard :itemData="item" />
|
||||
<div class="mask" v-if="state.isEdit" @click="item.check = !item.check">
|
||||
<img v-if="!item.check" src="@/assets/images/pc/select1.png" alt="">
|
||||
<img v-else src="@/assets/images/pc/select2.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="mine-history">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { HistoryVideoType } from '@/enums/app';
|
||||
import { queryHistoryVideo, deletePost } from '@/utils';
|
||||
|
||||
const historyList = ref([])
|
||||
const getHistoryList = async () => {
|
||||
const list: any = await queryHistoryVideo(1, 999, HistoryVideoType.VIDEO)
|
||||
list.forEach((item: any) => {
|
||||
item.check = false
|
||||
})
|
||||
historyList.value = list
|
||||
};
|
||||
getHistoryList()
|
||||
|
||||
const state = reactive({
|
||||
isEdit: false,
|
||||
select: false,
|
||||
allSelect: false
|
||||
})
|
||||
|
||||
const deleteHistory = () => {
|
||||
// 选中删除
|
||||
const filterDeleteData = historyList.value.filter(item => item.check)
|
||||
filterDeleteData.forEach((item => {
|
||||
deletePost(item.id, HistoryVideoType.VIDEO)
|
||||
}))
|
||||
setTimeout(() => {
|
||||
getHistoryList()
|
||||
}, 300)
|
||||
}
|
||||
|
||||
const allSelectFn = () => {
|
||||
state.allSelect = !state.allSelect
|
||||
historyList.value.forEach(item => {
|
||||
item.check = state.allSelect
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.history {
|
||||
margin: 70px 0 0 250px;
|
||||
width: 1120px;
|
||||
.title {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
line-height: 61px;
|
||||
border-bottom: 1px solid #fff2;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.edit-btn {
|
||||
@include flexCenter;
|
||||
width: 72px;
|
||||
height: 30px;
|
||||
border-radius: 4px;
|
||||
background: linear-gradient(270deg, #FFC303 0%, #FFDD01 100%);
|
||||
color: #FFF;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
}
|
||||
.list-btn {
|
||||
@include flexCenter;
|
||||
gap: 16px;
|
||||
.btn1 {
|
||||
@include flexCenter;
|
||||
width: 72px;
|
||||
height: 30px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #FFC303;
|
||||
color: #FFC303;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.movie-list {
|
||||
padding-top: 50px;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
flex-wrap: wrap;
|
||||
.all-select {
|
||||
height: 52px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
.item-wrap {
|
||||
width: 360px;
|
||||
height: 320px;
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
.mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(26, 28, 34, 0.5);
|
||||
cursor: pointer;
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 11;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user