139 lines
2.5 KiB
Vue
139 lines
2.5 KiB
Vue
<script setup>
|
|
/**
|
|
* 选择举报视频
|
|
*/
|
|
import {
|
|
reactive,
|
|
ref
|
|
} from 'vue';
|
|
import {
|
|
onLoad,
|
|
onPullDownRefresh,
|
|
onReachBottom
|
|
} from '@dcloudio/uni-app'
|
|
// 工具库
|
|
import util from '@/common/js/util';
|
|
// api
|
|
import api from '@/api/index.js'
|
|
// 视频菜单
|
|
import videoMenu from '@/components/index/videoMenu.vue';
|
|
|
|
// 用户id
|
|
const userId = ref('')
|
|
// 已选择的视频ids
|
|
const videoIds = reactive([])
|
|
// 列表数据
|
|
const list = reactive({
|
|
data: [],
|
|
pageSize: 10,
|
|
pageNum: 1,
|
|
total: 0,
|
|
})
|
|
|
|
onLoad((option) => {
|
|
// 被举报的用户id
|
|
if (option.userId) userId.value = option.userId
|
|
// 已选择的视频id
|
|
if (option.videoIds) videoIds.value = option.videoIds.split(',')
|
|
// 获取列表
|
|
getList()
|
|
})
|
|
|
|
onPullDownRefresh(() => {
|
|
// 刷新列表
|
|
refreshList()
|
|
})
|
|
|
|
onReachBottom(() => {
|
|
// 获取更多列表
|
|
getMoreList()
|
|
})
|
|
|
|
// 刷新列表
|
|
function refreshList() {
|
|
list.pageNum = 1
|
|
list.total = 0
|
|
getList()
|
|
}
|
|
|
|
// 获取更多列表
|
|
function getMoreList() {
|
|
if (list.data.length >= list.rows) return
|
|
list.pageNum++
|
|
getList()
|
|
}
|
|
|
|
// 获取列表
|
|
function getList() {
|
|
//
|
|
api.video.myVideoList({
|
|
query: {
|
|
isDraft: 0,
|
|
userId: 16,
|
|
pageSize: list.pageSize,
|
|
pageNum: list.pageNum,
|
|
}
|
|
}).then(rs => {
|
|
if (rs.code == 200) {
|
|
if (list.pageNum == 1) list.data.length = []
|
|
list.data.push(...rs.rows.map(item => {
|
|
item.format_videoUrl = util.format_url(item.videoUrl, 'video')
|
|
item.format_imageUrl = util.format_url(item.imageUrl, 'img')
|
|
return item
|
|
}))
|
|
list.total = rs.total
|
|
return
|
|
}
|
|
util.alert({
|
|
content: rs.msg,
|
|
showCancel: false,
|
|
})
|
|
})
|
|
}
|
|
|
|
function callBack(){
|
|
console.log(videoIds)
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<view class="appbw">
|
|
<view class="product mt30">
|
|
<view class="title plr30 c333 f32">
|
|
<text>作品</text>
|
|
<text class="ml10">{{list.total}}</text>
|
|
</view>
|
|
<view class="title plr70 c333 f32">
|
|
<text @click="callBack">确认</text>
|
|
</view>
|
|
<!-- 视频菜单 -->
|
|
<videoMenu :list="list.data" v-model:ids="videoIds" mode="checkbox" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
// 产品
|
|
.product {
|
|
.list {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
grid-gap: 5rpx;
|
|
|
|
.item {
|
|
height: 360rpx;
|
|
}
|
|
|
|
.window {
|
|
background-color: rgba(0, 0, 0, .1);
|
|
}
|
|
|
|
// 播放量
|
|
.amount {
|
|
.txt {
|
|
opacity: .5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style> |