举报 拉黑 查看评论
This commit is contained in:
parent
a8684b1956
commit
4e88cbdefc
|
@ -352,6 +352,30 @@ const mine = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解锁他人评论
|
||||||
|
* @param {Object} param
|
||||||
|
*/
|
||||||
|
unlockComment(param) {
|
||||||
|
return util.request({
|
||||||
|
url: `/video/comment/unlockOthersComment`,
|
||||||
|
data: param,
|
||||||
|
method: 'POST',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉黑
|
||||||
|
* @param {Object} param
|
||||||
|
*/
|
||||||
|
blockUser(param) {
|
||||||
|
return util.request({
|
||||||
|
url: `/video/statistics/block`,
|
||||||
|
data: param,
|
||||||
|
method: 'POST',
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default mine
|
export default mine
|
|
@ -426,7 +426,7 @@ const video = {
|
||||||
*/
|
*/
|
||||||
reportVideo(param) {
|
reportVideo(param) {
|
||||||
return util.request({
|
return util.request({
|
||||||
url: `/report/reportVideo`,
|
url: `/video/videoReport`,
|
||||||
data: param.data,
|
data: param.data,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,9 +6,9 @@ const config = {
|
||||||
// host: 'h5api',
|
// host: 'h5api',
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
host: 'http://91f.xyz:8080',
|
// host: 'http://91f.xyz:8080',
|
||||||
// host: 'https://1a880cd5.r24.cpolar.top/',
|
// host: 'https://1a880cd5.r24.cpolar.top/',
|
||||||
// host: 'http://6mkwby.natappfree.cc',
|
host: 'http://aere2w.natappfree.cc',
|
||||||
// #endif
|
// #endif
|
||||||
// 支付方式配置
|
// 支付方式配置
|
||||||
payType: {
|
payType: {
|
||||||
|
|
|
@ -1,138 +1,138 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 视频菜单组件
|
* 视频菜单组件
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
onMounted
|
onMounted
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import video from '../../api/video';
|
import video from '../../api/video';
|
||||||
import util from '../../common/js/util';
|
import util from '../../common/js/util';
|
||||||
|
|
||||||
// 传参
|
// 传参
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 列表数据
|
// 列表数据
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
},
|
},
|
||||||
// 模式 list列表展示 点击播放视频 menu菜单模式 点击触发回调事件 checkbox多选
|
// 模式 list列表展示 点击播放视频 menu菜单模式 点击触发回调事件 checkbox多选
|
||||||
mode: {
|
mode: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'list',
|
default: 'list',
|
||||||
},
|
},
|
||||||
// 多选模式下的 选择数量限制 0为不限制
|
// 多选模式下的 选择数量限制 0为不限制
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
// 是否我自己 0不是 1是
|
// 是否我自己 0不是 1是
|
||||||
isMine: {
|
isMine: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
// 是否显示统计 0不显示 1显示
|
// 是否显示统计 0不显示 1显示
|
||||||
statistic: {
|
statistic: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// 子触发父
|
// 子触发父
|
||||||
const emit = defineEmits(['item'])
|
const emit = defineEmits(['item'])
|
||||||
// 已选择的视频id
|
// 已选择的视频id
|
||||||
const ids = defineModel('ids')
|
const videoInfo = reactive({
|
||||||
// 视频上下文对象
|
videoId: '',
|
||||||
const videoContext = ref(null)
|
coverUrl: '',
|
||||||
// 视频播放路径
|
})
|
||||||
const videoUrl = ref('')
|
// 视频上下文对象
|
||||||
|
const videoContext = ref(null)
|
||||||
|
// 视频播放路径
|
||||||
|
const videoUrl = ref('')
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 创建视频上下文对象
|
// 创建视频上下文对象
|
||||||
videoContext.value = uni.createVideoContext('video')
|
videoContext.value = uni.createVideoContext('video')
|
||||||
})
|
})
|
||||||
|
|
||||||
// 进入全屏
|
// 进入全屏
|
||||||
function requestFullScreen() {
|
function requestFullScreen() {
|
||||||
videoContext.value.requestFullScreen()
|
videoContext.value.requestFullScreen()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暂停
|
// 暂停
|
||||||
function pause() {
|
function pause() {
|
||||||
// 暂停当前视频
|
// 暂停当前视频
|
||||||
videoContext.value.pause()
|
videoContext.value.pause()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击视频播放
|
* 点击视频播放
|
||||||
* @param {Object} item
|
* @param {Object} item
|
||||||
*/
|
*/
|
||||||
function handleVideo(item) {
|
function handleVideo(item) {
|
||||||
// 列表模式
|
// 列表模式
|
||||||
if (props.mode == 'list') {
|
if (props.mode == 'list') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: util.setUrl('/pages/index/videoDetail', {
|
url: util.setUrl('/pages/index/videoDetail', {
|
||||||
videoId: item.id,
|
videoId: item.id,
|
||||||
isMine: props.isMine,
|
isMine: props.isMine,
|
||||||
statistic: props.statistic,
|
statistic: props.statistic,
|
||||||
})
|
|
||||||
})
|
})
|
||||||
// videoUrl.value = item.format_videoUrl
|
})
|
||||||
// 进入全屏
|
// videoUrl.value = item.format_videoUrl
|
||||||
// requestFullScreen()
|
// 进入全屏
|
||||||
}
|
// requestFullScreen()
|
||||||
// 菜单模式
|
|
||||||
else if (props.mode == 'menu') {
|
|
||||||
emit('item', item)
|
|
||||||
}
|
|
||||||
// 多选模式
|
|
||||||
else if (props.mode == 'checkbox') {
|
|
||||||
const findIndex = ids.value.findIndex(node => node == item.videoId)
|
|
||||||
if (findIndex >= 0) ids.value.splice(findIndex, 1)
|
|
||||||
else {
|
|
||||||
// 如果有限制 且 数量到达上限
|
|
||||||
if (props.limit != 0 && props.limit <= ids.value.length) return
|
|
||||||
ids.value.push(item.videoId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 菜单模式
|
||||||
/**
|
else if (props.mode == 'menu') {
|
||||||
* 视频进入退出全屏
|
emit('item', item)
|
||||||
* @param {Object} ev
|
|
||||||
*/
|
|
||||||
function videoFullscreenchange(ev) {
|
|
||||||
// 根据全屏状态决定是否播放盒暂停
|
|
||||||
if (ev.detail.fullScreen) videoContext.value.play()
|
|
||||||
else pause()
|
|
||||||
}
|
}
|
||||||
|
// 单选模式
|
||||||
|
else if (props.mode == 'checkbox') {
|
||||||
|
videoInfo.videoId = item.id
|
||||||
|
videoInfo.coverUrl = item.coverUrl
|
||||||
|
videoUrl.value = item.videoUrl
|
||||||
|
emit('videoInfo', videoInfo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
/**
|
||||||
videoContext,
|
* 视频进入退出全屏
|
||||||
pause,
|
* @param {Object} ev
|
||||||
requestFullScreen,
|
*/
|
||||||
})
|
function videoFullscreenchange(ev) {
|
||||||
|
// 根据全屏状态决定是否播放盒暂停
|
||||||
|
if (ev.detail.fullScreen) videoContext.value.play()
|
||||||
|
else pause()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
videoContext,
|
||||||
|
pause,
|
||||||
|
requestFullScreen,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<!-- 视频菜单 -->
|
<!-- 视频菜单 -->
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item pr" v-for="(item,index) in list" :key="index" @click="handleVideo(item)">
|
<view class="item pr" v-for="(item, index) in list" :key="index" @click="handleVideo(item)">
|
||||||
<image :src="item.coverUrl" mode="aspectFill" />
|
<image :src="item.coverUrl" mode="aspectFill" />
|
||||||
|
|
||||||
<view class="window pfull"></view>
|
<view class="window pfull"></view>
|
||||||
|
|
||||||
<!-- 选项 -->
|
<!-- 选项 -->
|
||||||
<view class="amount pa r0 t0 df ptb10 plr10" v-if="mode == 'checkbox'">
|
<view class="amount pa r0 t0 df ptb10 plr10" v-if="mode == 'checkbox'">
|
||||||
<uni-icons type="circle-filled" size="50rpx" color="#20D200" v-if="ids.includes(item.videoId)" />
|
<uni-icons type="circle-filled" size="50rpx" color="#20D200" v-if="videoInfo.videoId == item.id" />
|
||||||
<uni-icons type="circle" color="#fff" size="50rpx" v-else />
|
<uni-icons type="circle" color="#fff" size="50rpx" v-else />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="amount pa l0 r0 b0 df ptb10 plr10" v-if="item.play">
|
<view class="amount pa l0 r0 b0 df ptb10 plr10" v-if="item.play">
|
||||||
<image class="wh24" src="/static/amount.png" mode="aspectFit" />
|
<image class="wh24" src="/static/amount.png" mode="aspectFit" />
|
||||||
<view class="txt f1 ml10 cfff f20">{{item.play}}</view>
|
<view class="txt f1 ml10 cfff f20">{{ item.play }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -145,37 +145,37 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
//
|
//
|
||||||
.list {
|
.list {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-gap: 5rpx;
|
grid-gap: 5rpx;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
height: 360rpx;
|
height: 360rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.window {
|
|
||||||
background-color: rgba(0, 0, 0, .1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 播放量
|
|
||||||
.amount {
|
|
||||||
.txt {
|
|
||||||
opacity: .5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 视频上下文对象
|
.window {
|
||||||
.videoContext {
|
background-color: rgba(0, 0, 0, .1);
|
||||||
position: absolute;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 播放量
|
||||||
|
.amount {
|
||||||
|
.txt {
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 视频上下文对象
|
||||||
|
.videoContext {
|
||||||
|
position: absolute;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,203 +1,204 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 视频举报
|
* 视频举报
|
||||||
*/
|
*/
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
computed,
|
computed,
|
||||||
getCurrentInstance
|
getCurrentInstance
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
// 工具库
|
// 工具库
|
||||||
import util from '@/common/js/util';
|
import util from '@/common/js/util';
|
||||||
// api
|
// api
|
||||||
import api from '@/api/index.js'
|
import api from '@/api/index.js'
|
||||||
// 视频菜单
|
// 视频菜单
|
||||||
import videoMenu from '@/components/index/videoMenu.vue';
|
import videoMenu from '@/components/index/videoMenu.vue';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
proxy
|
proxy
|
||||||
} = getCurrentInstance()
|
} = getCurrentInstance()
|
||||||
// 举报列表
|
// 举报列表
|
||||||
const reportList = reactive([{
|
const reportList = reactive([{
|
||||||
name: '发布不正当的内容或信息',
|
name: '发布不正当的内容或信息',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '传播涩情资源',
|
name: '传播涩情资源',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '冒充他人',
|
name: '冒充他人',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '涉嫌诈骗',
|
name: '涉嫌诈骗',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '侵犯权益',
|
name: '侵犯权益',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '其他',
|
name: '其他',
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
// 举报下标
|
// 举报下标
|
||||||
const reportIndex = ref('')
|
const reportIndex = ref('')
|
||||||
// 表单
|
// 表单
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
userId: '',
|
userId: '',
|
||||||
videoId: [],
|
videoId: '',
|
||||||
reason: '',
|
reasonForReporting: '',
|
||||||
context: '',
|
particulars: '',
|
||||||
pic: [],
|
videoPictureUrl: '',
|
||||||
})
|
coverUrl: ''
|
||||||
// 列表数据
|
})
|
||||||
const list = reactive({
|
// 列表数据
|
||||||
data: [],
|
const list = reactive({
|
||||||
pageSize: 10,
|
data: [],
|
||||||
pageNum: 1,
|
pageSize: 10,
|
||||||
total: 0,
|
pageNum: 1,
|
||||||
})
|
total: 0,
|
||||||
// 已选择的视频列表
|
})
|
||||||
const videos = computed(() => {
|
// 已选择的视频列表
|
||||||
let result = form.videoId.map(item => {
|
const videos = computed(() => {
|
||||||
return list.data.find(node => node.videoId == item) || {}
|
let result = form.videoId.map(item => {
|
||||||
})
|
return list.data.find(node => node.videoId == item) || {}
|
||||||
return result
|
|
||||||
})
|
})
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
// 被举报的用户id
|
// 被举报的用户id
|
||||||
if (option.userId) form.userId = option.userId
|
if (option.userId) form.userId = option.userId
|
||||||
// 获取列表
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择举报列表
|
|
||||||
* @param {Object} ev 携带参数
|
|
||||||
*/
|
|
||||||
function handleReportList(ev) {
|
|
||||||
const index = ev.detail.value
|
|
||||||
if (reportIndex.value === index) return
|
|
||||||
reportIndex.value = index
|
|
||||||
}
|
|
||||||
|
|
||||||
// 刷新列表
|
|
||||||
function refreshList() {
|
|
||||||
list.pageNum = 1
|
|
||||||
list.total = 0
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取更多列表
|
|
||||||
function getMoreList() {
|
|
||||||
if (list.data.length >= list.rows) return
|
|
||||||
list.pageNum++
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取列表
|
// 获取列表
|
||||||
function getList() {
|
getList()
|
||||||
//
|
})
|
||||||
api.video.myVideoList({
|
|
||||||
query: {
|
|
||||||
isDraft: 0,
|
|
||||||
userId: form.userId,
|
|
||||||
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 uploadImg() {
|
* 选择举报列表
|
||||||
util.upload_image({
|
* @param {Object} ev 携带参数
|
||||||
value: form.pic,
|
*/
|
||||||
})
|
function handleReportList(ev) {
|
||||||
}
|
const index = ev.detail.value
|
||||||
|
if (reportIndex.value === index) return
|
||||||
|
reportIndex.value = index
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
// 刷新列表
|
||||||
* 删除多媒体
|
function refreshList() {
|
||||||
* @param {Number} index 列表下标
|
list.pageNum = 1
|
||||||
* @param {String} key 操作的键
|
list.total = 0
|
||||||
*/
|
getList()
|
||||||
function removeMedia(index, key) {
|
}
|
||||||
|
|
||||||
|
// 获取列表
|
||||||
|
function getList() {
|
||||||
|
//
|
||||||
|
api.video.myWorks({
|
||||||
|
query: {
|
||||||
|
userId: form.userId,
|
||||||
|
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({
|
util.alert({
|
||||||
content: '确认要删除吗?',
|
content: rs.msg,
|
||||||
}).then(rs => {
|
showCancel: false,
|
||||||
if (rs.confirm) form[key].splice(index, 1)
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传图片
|
||||||
|
function uploadImg() {
|
||||||
|
util.upload_image({
|
||||||
|
type: 1,
|
||||||
|
success: rs => {
|
||||||
|
form.videoPictureUrl = rs.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除多媒体
|
||||||
|
* @param {Number} index 列表下标
|
||||||
|
* @param {String} key 操作的键
|
||||||
|
*/
|
||||||
|
function removeMedia(key) {
|
||||||
|
util.alert({
|
||||||
|
content: '确认要删除吗?',
|
||||||
|
}).then(rs => {
|
||||||
|
if (key == 'videoId') {
|
||||||
|
form.videoId = null
|
||||||
|
form.coverUrl = null
|
||||||
|
}
|
||||||
|
if (key == 'videoPictureUrl') form.videoPictureUrl = null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 视频举报
|
||||||
|
function handleSubmit() {
|
||||||
|
//
|
||||||
|
const data = {
|
||||||
|
...form
|
||||||
}
|
}
|
||||||
|
|
||||||
// 视频举报
|
// 验证必填项
|
||||||
function handleSubmit() {
|
if (reportIndex == '') {
|
||||||
//
|
util.alert('请选择举报理由')
|
||||||
const data = {
|
return
|
||||||
...form
|
|
||||||
}
|
|
||||||
|
|
||||||
// 验证必填项
|
|
||||||
if (reportIndex == '') {
|
|
||||||
util.alert('请选择举报理由')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!data.context) {
|
|
||||||
util.alert('详细描述不能为空')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (data.context.length > 100) {
|
|
||||||
util.alert('详细描述自述超过100')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!data.pic[0]) {
|
|
||||||
util.alert('请上传举报图片')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!data.videoId[0]) {
|
|
||||||
util.alert('请选择举报视频')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
data.reason = reportList[reportIndex.value].name
|
|
||||||
data.pic = data.pic.map(node => {
|
|
||||||
node = util.replace_url('node')
|
|
||||||
return node
|
|
||||||
}).join(',')
|
|
||||||
data.videoId = data.videoId.join(',')
|
|
||||||
|
|
||||||
api.video.reportVideo({
|
|
||||||
data: data,
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
util.alert('举报成功,请等待后台审核')
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.navigateBack()
|
|
||||||
}, 500)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
if (!data.particulars) {
|
||||||
|
util.alert('详细描述不能为空')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (data.particulars.length > 100) {
|
||||||
|
util.alert('详细描述自述超过100')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!data.videoPictureUrl) {
|
||||||
|
util.alert('请上传举报图片')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!data.videoId) {
|
||||||
|
util.alert('请选择举报视频')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data.reasonForReporting = reportList[reportIndex.value].name
|
||||||
|
|
||||||
|
api.video.reportVideo({
|
||||||
|
data: data,
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
util.alert('举报成功,请等待后台审核')
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选中视频信息
|
||||||
|
function videoInfo(param) {
|
||||||
|
console.log('选中视频信息', param);
|
||||||
|
form.videoId = param.videoId;
|
||||||
|
form.coverUrl = param.coverUrl;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -208,7 +209,7 @@
|
||||||
<view class="key mr20">举报理由</view>
|
<view class="key mr20">举报理由</view>
|
||||||
<picker class="f1" :range="reportList" rangeKey="name" @change="handleReportList">
|
<picker class="f1" :range="reportList" rangeKey="name" @change="handleReportList">
|
||||||
<view class="inputBox ptb10 plr10">
|
<view class="inputBox ptb10 plr10">
|
||||||
<text v-if="reportList[reportIndex]">{{reportList[reportIndex].name}}</text>
|
<text v-if="reportList[reportIndex]">{{ reportList[reportIndex].name }}</text>
|
||||||
<text v-else class="placeholderStyle">请选择举报理由</text>
|
<text v-else class="placeholderStyle">请选择举报理由</text>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
|
@ -218,10 +219,10 @@
|
||||||
<view class="key">详细描述</view>
|
<view class="key">详细描述</view>
|
||||||
|
|
||||||
<view class="inputBox mt20 ptb15 plr15">
|
<view class="inputBox mt20 ptb15 plr15">
|
||||||
<textarea v-model="form.context" placeholder="请详细填写,以提高举报成功率。" />
|
<textarea v-model="form.particulars" placeholder="请详细填写,以提高举报成功率。" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="hint mt10 tar f20">{{form.context.length}}/100</view>
|
<view class="hint mt10 tar f20">{{ form.particulars.length }}/100</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="line mtb50 uploadBox">
|
<view class="line mtb50 uploadBox">
|
||||||
|
@ -233,14 +234,15 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="imgList images mt20">
|
<view class="imgList images mt20">
|
||||||
<view class="item upload fmid pr mr20 br10" @click="uploadImg">
|
<view v-if="!form.videoPictureUrl" class="item upload fmid pr mr20 br10" @click="uploadImg">
|
||||||
<uni-icons type="plusempty" color="#D8D8D8" size="100rpx" />
|
<uni-icons type="plusempty" color="#D8D8D8" size="100rpx" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="imgs item mr20 br10" v-for="(item,index) in form.pic" :key="index">
|
<view v-else class="imgs item mr20 br10">
|
||||||
<image class="br10" :src="item" mode="aspectFill" />
|
<image class="br10" :src="form.videoPictureUrl" mode="aspectFill" />
|
||||||
<view class="close">
|
<view class="close">
|
||||||
<uni-icons type="clear" size="30rpx" color="red" @click="removeMedia(index,'pic')" />
|
<uni-icons type="clear" size="30rpx" color="red"
|
||||||
|
@click="removeMedia('videoPictureUrl')" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -251,15 +253,15 @@
|
||||||
<view class="key">选择视频</view>
|
<view class="key">选择视频</view>
|
||||||
|
|
||||||
<view class="list pr mt20">
|
<view class="list pr mt20">
|
||||||
<view class="item fmid oh br10" @click="$refs.select.open()">
|
<view v-if="!form.coverUrl" class="item fmid oh br10" @click="$refs.select.open()">
|
||||||
<uni-icons type="plusempty" color="#D8D8D8" size="100rpx" />
|
<uni-icons type="plusempty" color="#D8D8D8" size="100rpx" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="item pr br10" v-for="(item,index) in videos" :key="index">
|
<view v-else class="item pr br10">
|
||||||
<image :src="item.format_imageUrl" mode="aspectFill" />
|
<image :src="form.coverUrl" mode="aspectFill" />
|
||||||
|
|
||||||
<view class="close">
|
<view class="close">
|
||||||
<uni-icons type="clear" size="30rpx" color="red" @click="removeMedia(index,'videoId')" />
|
<uni-icons type="clear" size="30rpx" color="red" @click="removeMedia('videoId')" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -279,7 +281,7 @@
|
||||||
<view class="header rows ptb20 plr20">
|
<view class="header rows ptb20 plr20">
|
||||||
<view class="title plr30 c333 f34">
|
<view class="title plr30 c333 f34">
|
||||||
<text>作品</text>
|
<text>作品</text>
|
||||||
<text class="ml10">{{list.total}}</text>
|
<text class="ml10">{{ list.total }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="fmid c999 f28" @click="refreshList">
|
<view class="fmid c999 f28" @click="refreshList">
|
||||||
|
@ -290,7 +292,7 @@
|
||||||
|
|
||||||
<!-- 视频菜单 -->
|
<!-- 视频菜单 -->
|
||||||
<scroll-view scroll-y="true" class="scroll">
|
<scroll-view scroll-y="true" class="scroll">
|
||||||
<videoMenu :list="list.data" v-model:ids="form.videoId" mode="checkbox" />
|
<videoMenu :list="list.data" @videoInfo="videoInfo" mode="checkbox" />
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -300,66 +302,66 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单
|
||||||
|
.form {
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
color: #a7a7a7;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 表单
|
// 上传图片
|
||||||
.form {
|
.uploadBox {
|
||||||
|
|
||||||
.hint {
|
//
|
||||||
color: #a7a7a7;
|
.uploads {
|
||||||
|
.cartoon {
|
||||||
|
top: 0;
|
||||||
|
right: -100rpx;
|
||||||
|
width: 530rpx;
|
||||||
|
height: 249rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传图片
|
// 上传图片
|
||||||
.uploadBox {
|
.images .item {
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
background-color: #F3F3F5;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
// 列表
|
||||||
.uploads {
|
.list {
|
||||||
.cartoon {
|
display: grid;
|
||||||
top: 0;
|
grid-template-columns: repeat(3, 1fr);
|
||||||
right: -100rpx;
|
grid-gap: 20rpx;
|
||||||
width: 530rpx;
|
|
||||||
height: 249rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 上传图片
|
|
||||||
.images .item {
|
|
||||||
width: 150rpx;
|
|
||||||
height: 150rpx;
|
|
||||||
background-color: #F3F3F5;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 列表
|
// 列表
|
||||||
.list {
|
.item {
|
||||||
display: grid;
|
height: 290rpx;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
background-color: #F1F1F1;
|
||||||
grid-gap: 20rpx;
|
|
||||||
|
|
||||||
// 列表
|
// 关闭
|
||||||
.item {
|
.close {
|
||||||
height: 290rpx;
|
position: absolute;
|
||||||
background-color: #F1F1F1;
|
top: 0;
|
||||||
|
right: 0;
|
||||||
// 关闭
|
transform: translate(50%, -50%);
|
||||||
.close {
|
z-index: 1;
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translate(50%, -50%);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 作品数量
|
// 作品数量
|
||||||
.product {
|
.product {
|
||||||
.scroll {
|
.scroll {
|
||||||
height: 80vh;
|
height: 80vh;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,233 +1,289 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 他人用户视频主页
|
* 他人用户视频主页
|
||||||
*/
|
*/
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
computed,
|
computed,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
onPageScroll,
|
onPageScroll,
|
||||||
onReachBottom,
|
onReachBottom,
|
||||||
onHide
|
onHide
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import {
|
import {
|
||||||
useStore
|
useStore
|
||||||
} from 'vuex'
|
} from 'vuex'
|
||||||
// 工具库
|
// 工具库
|
||||||
import util from '@/common/js/util';
|
import util from '@/common/js/util';
|
||||||
// api
|
// api
|
||||||
import api from '@/api/index.js'
|
import api from '@/api/index.js'
|
||||||
// 顶部状态栏
|
// 顶部状态栏
|
||||||
import statusBar from '@/components/header/statusBar.vue'
|
import statusBar from '@/components/header/statusBar.vue'
|
||||||
// 顶部
|
// 顶部
|
||||||
import apex from '@/components/header/apex.vue'
|
import apex from '@/components/header/apex.vue'
|
||||||
// 视频菜单
|
// 视频菜单
|
||||||
import videoMenu from '@/components/index/videoMenu.vue'
|
import videoMenu from '@/components/index/videoMenu.vue'
|
||||||
|
|
||||||
// 代理
|
// 代理
|
||||||
const {
|
const {
|
||||||
proxy
|
proxy
|
||||||
} = getCurrentInstance()
|
} = getCurrentInstance()
|
||||||
//
|
//
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
// 滚动头部
|
// 滚动头部
|
||||||
const scrollTop = ref(false)
|
const scrollTop = ref(false)
|
||||||
|
// 用户id
|
||||||
|
const userId = ref('')
|
||||||
|
// 详情
|
||||||
|
const detail = reactive({})
|
||||||
|
// 列表对象
|
||||||
|
const listProperty = reactive({
|
||||||
|
data: [],
|
||||||
|
pageSize: 9,
|
||||||
|
pageNum: 1,
|
||||||
|
total: 0,
|
||||||
|
})
|
||||||
|
// 用户信息
|
||||||
|
let userinfo = computed(() => {
|
||||||
|
let result = store.state.userinfo
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
//
|
||||||
|
onLoad((option) => {
|
||||||
// 用户id
|
// 用户id
|
||||||
const userId = ref('')
|
if (option.userId) userId.value = option.userId
|
||||||
// 详情
|
// 他人用户主页
|
||||||
const detail = reactive({})
|
getUserinfo()
|
||||||
// 列表对象
|
// 获取列表
|
||||||
const listProperty = reactive({
|
getList()
|
||||||
data: [],
|
})
|
||||||
pageSize: 9,
|
|
||||||
pageNum: 1,
|
|
||||||
total: 0,
|
|
||||||
})
|
|
||||||
// 用户信息
|
|
||||||
let userinfo = computed(() => {
|
|
||||||
let result = store.state.userinfo
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
//
|
onHide(() => {
|
||||||
onLoad((option) => {
|
// 暂停当前视频
|
||||||
// 用户id
|
proxy.$refs.videoMenuRef.pause()
|
||||||
if (option.userId) userId.value = option.userId
|
})
|
||||||
// 他人用户主页
|
|
||||||
getUserinfo()
|
|
||||||
// 获取列表
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
|
|
||||||
onHide(() => {
|
// 滚动
|
||||||
// 暂停当前视频
|
onPageScroll((ev) => {
|
||||||
proxy.$refs.videoMenuRef.pause()
|
scrollTop.value = ev.scrollTop > 44 ? true : false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 滚动
|
|
||||||
onPageScroll((ev) => {
|
|
||||||
scrollTop.value = ev.scrollTop > 44 ? true : false
|
|
||||||
})
|
|
||||||
|
|
||||||
onReachBottom(() => {
|
|
||||||
// 获取更多列表
|
|
||||||
getMoreList()
|
|
||||||
})
|
|
||||||
|
|
||||||
// 获取用户信息
|
|
||||||
function getUserinfo() {
|
|
||||||
api.video.getUserInfo({
|
|
||||||
query: {
|
|
||||||
userId: userId.value,
|
|
||||||
myId: userinfo.value.id,
|
|
||||||
}
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
console.log('userinfo', rs)
|
|
||||||
const result = rs.data
|
|
||||||
Object.assign(detail, result)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
onReachBottom(() => {
|
||||||
// 获取更多列表
|
// 获取更多列表
|
||||||
function getMoreList() {
|
getMoreList()
|
||||||
if (listProperty.total <= listProperty.data.length) return
|
})
|
||||||
listProperty.pageNum++
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取用户作品
|
// 获取用户信息
|
||||||
function getList() {
|
function getUserinfo() {
|
||||||
//
|
api.video.getUserInfo({
|
||||||
api.video.myWorks({
|
query: {
|
||||||
query: {
|
userId: userId.value,
|
||||||
// 人员id
|
myId: userinfo.value.id,
|
||||||
userId: userId.value,
|
}
|
||||||
pageSize: listProperty.pageSize,
|
}).then(rs => {
|
||||||
pageNum: listProperty.pageNum,
|
if (rs.code == 200) {
|
||||||
}
|
console.log('userinfo', rs)
|
||||||
}).then(rs => {
|
const result = rs.data
|
||||||
if (rs.code == 200) {
|
Object.assign(detail, result)
|
||||||
if (listProperty.pageNum == 1) listProperty.data.length = 0
|
return
|
||||||
listProperty.data.push(...rs.rows)
|
}
|
||||||
listProperty.total = rs.total
|
util.alert({
|
||||||
return
|
content: rs.msg,
|
||||||
}
|
showCancel: false,
|
||||||
util.alert({
|
})
|
||||||
content: rs.msg,
|
})
|
||||||
showCancel: false,
|
}
|
||||||
|
|
||||||
|
// 获取更多列表
|
||||||
|
function getMoreList() {
|
||||||
|
if (listProperty.total <= listProperty.data.length) return
|
||||||
|
listProperty.pageNum++
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户作品
|
||||||
|
function getList() {
|
||||||
|
//
|
||||||
|
api.video.myWorks({
|
||||||
|
query: {
|
||||||
|
// 人员id
|
||||||
|
userId: userId.value,
|
||||||
|
pageSize: listProperty.pageSize,
|
||||||
|
pageNum: listProperty.pageNum,
|
||||||
|
}
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
if (listProperty.pageNum == 1) listProperty.data.length = 0
|
||||||
|
listProperty.data.push(...rs.rows)
|
||||||
|
listProperty.total = rs.total
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 举报
|
||||||
|
function handleReport() {
|
||||||
|
// 关闭弹窗
|
||||||
|
proxy.$refs.menuRef.close()
|
||||||
|
|
||||||
|
// 打开模态弹窗
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['举报'],
|
||||||
|
}).then(rs => {
|
||||||
|
const index = rs.tapIndex
|
||||||
|
if (index == 0) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: util.setUrl('/pages/index/report', {
|
||||||
|
userId: userId.value,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拉黑
|
||||||
|
function handleBlack() {
|
||||||
|
// let text = detail.isBlock ? '取消拉黑' : '拉黑'
|
||||||
|
// util.alert({
|
||||||
|
// content: `确认要${text}用户${detail.userNickname}吗?`,
|
||||||
|
// }).then(rs => {
|
||||||
|
// let obj = {
|
||||||
|
// blockUserId: detail.id,
|
||||||
|
// status: detail.isBlock ? 1 : 0
|
||||||
|
// }
|
||||||
|
// api.mine.blockUser(obj).then(res => {
|
||||||
|
// if (res.code == 200) {
|
||||||
|
// util.alert('操作成功!')
|
||||||
|
// getUserinfo()
|
||||||
|
|
||||||
|
// // 关闭弹窗
|
||||||
|
// proxy.$refs.menuRef.close()
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复制账号
|
||||||
|
function handleCopyAccount() {
|
||||||
|
// 复制用户账号
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: detail.account,
|
||||||
|
showToast: false,
|
||||||
|
success: rs => {
|
||||||
|
util.alert('复制成功')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关注用户
|
||||||
|
function handleAttention() {
|
||||||
|
let targetAtt = detail.isAttention == 0 ? 1 : 0
|
||||||
|
api.video.attention({
|
||||||
|
data: {
|
||||||
|
// 当前用户id
|
||||||
|
userId: userinfo.value.id,
|
||||||
|
// 被关注id
|
||||||
|
attentionId: detail.id,
|
||||||
|
//
|
||||||
|
isAttention: targetAtt,
|
||||||
|
}
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
// 关注状态切换
|
||||||
|
detail.isAttention = targetAtt
|
||||||
|
|
||||||
|
// 他人用户主页
|
||||||
|
getUserinfo()
|
||||||
|
// 修改了他人关注状态
|
||||||
|
uni.$emit('focusUser', {
|
||||||
|
userId: detail.id,
|
||||||
|
result: detail.isAttention,
|
||||||
|
})
|
||||||
|
// 重载关注列表
|
||||||
|
uni.$emit('updateFocusList')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false,
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 举报
|
// 操作不让看
|
||||||
function handleReport() {
|
function handleBlock() {
|
||||||
// 关闭弹窗
|
// // 反选状态
|
||||||
proxy.$refs.menuRef.close()
|
// detail.isBlock = !detail.isBlock
|
||||||
|
|
||||||
// 打开模态弹窗
|
// api.video.videoBlock({
|
||||||
uni.showActionSheet({
|
// query: {
|
||||||
itemList: ['举报'],
|
// type: detail.isBlock ? 0 : 1,
|
||||||
|
// userId: detail.id,
|
||||||
|
// }
|
||||||
|
// }).then(rs => {
|
||||||
|
// if (rs.code == 200) {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
// detail.isBlock = !detail.isBlock
|
||||||
|
// util.alert({
|
||||||
|
// content: rs.msg,
|
||||||
|
// showCancel: false,
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 私信
|
||||||
|
function handleMessage() {
|
||||||
|
util.toChat({
|
||||||
|
name: detail.userNickname,
|
||||||
|
msgId: detail.id,
|
||||||
|
type: 'C2C',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 评论
|
||||||
|
function userComments() {
|
||||||
|
if (detail.isLock) {
|
||||||
|
toCommentsList()
|
||||||
|
} else {
|
||||||
|
// 解锁提示
|
||||||
|
util.alert({
|
||||||
|
content: `确认消耗${detail.consumeFruit}个榴莲果解锁评论吗?`,
|
||||||
}).then(rs => {
|
}).then(rs => {
|
||||||
const index = rs.tapIndex
|
unlockComments()
|
||||||
if (index == 0) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/index/report',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 复制账号
|
// 解锁评论列表
|
||||||
function handleCopyAccount() {
|
function unlockComments() {
|
||||||
// 复制用户账号
|
api.mine.unlockComment({ userId: detail.id }).then(res => {
|
||||||
uni.setClipboardData({
|
if (res.code == 200) {
|
||||||
data: detail.account,
|
util.alert('解锁成功!')
|
||||||
showToast: false,
|
if (res.data.isLock) {
|
||||||
success: rs => {
|
toCommentsList()
|
||||||
util.alert('复制成功')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 关注用户
|
|
||||||
function handleAttention() {
|
|
||||||
let targetAtt = detail.isAttention == 0 ? 1 : 0
|
|
||||||
api.video.attention({
|
|
||||||
data: {
|
|
||||||
// 当前用户id
|
|
||||||
userId: userinfo.value.id,
|
|
||||||
// 被关注id
|
|
||||||
attentionId: detail.id,
|
|
||||||
//
|
|
||||||
isAttention: targetAtt,
|
|
||||||
}
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
// 关注状态切换
|
|
||||||
detail.isAttention = targetAtt
|
|
||||||
|
|
||||||
// 他人用户主页
|
|
||||||
getUserinfo()
|
getUserinfo()
|
||||||
// 修改了他人关注状态
|
|
||||||
uni.$emit('focusUser', {
|
|
||||||
userId: detail.userId,
|
|
||||||
result: detail.isAttention,
|
|
||||||
})
|
|
||||||
// 重载关注列表
|
|
||||||
uni.$emit('updateFocusList')
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
util.alert({
|
}
|
||||||
content: rs.msg,
|
})
|
||||||
showCancel: false,
|
}
|
||||||
})
|
// 跳转到评论列表
|
||||||
})
|
function toCommentsList() {
|
||||||
}
|
uni.navigateTo({
|
||||||
|
url: util.setUrl('/pages/mine/myComment', {
|
||||||
// 操作不让看
|
userId: detail.id,
|
||||||
function handleBlock() {
|
}),
|
||||||
// 反选状态
|
})
|
||||||
detail.isBlock = !detail.isBlock
|
}
|
||||||
|
|
||||||
//
|
|
||||||
api.video.videoBlock({
|
|
||||||
query: {
|
|
||||||
type: detail.isBlock ? 0 : 1,
|
|
||||||
userId: detail.userId,
|
|
||||||
}
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
detail.isBlock = !detail.isBlock
|
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 私信
|
|
||||||
function handleMessage() {
|
|
||||||
util.toChat({
|
|
||||||
name: detail.userNickname,
|
|
||||||
msgId: detail.userId,
|
|
||||||
type: 'C2C',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -239,9 +295,9 @@
|
||||||
<view class="window pfull"></view>
|
<view class="window pfull"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<apex :bgColor="scrollTop?'#fff':'#fff0'" :color="scrollTop ? '#333' : '#fff'">
|
<apex :bgColor="scrollTop ? '#fff' : '#fff0'" :color="scrollTop ? '#333' : '#fff'">
|
||||||
<template #content v-if="scrollTop">
|
<template #content v-if="scrollTop">
|
||||||
<view class="">{{detail.userNickname}}</view>
|
<view class="">{{ detail.userNickname }}</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #right>
|
<template #right>
|
||||||
|
@ -258,8 +314,8 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="user f1 ml20 cfff">
|
<view class="user f1 ml20 cfff">
|
||||||
<view class="f36 b">{{detail.userNickname}}</view>
|
<view class="f36 b">{{ detail.userNickname }}</view>
|
||||||
<view class="f24">账号:{{detail.account}}</view>
|
<view class="f24">账号:{{ detail.account }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -270,25 +326,25 @@
|
||||||
|
|
||||||
<view class="number df">
|
<view class="number df">
|
||||||
<view class="option mr40" v-if="0">
|
<view class="option mr40" v-if="0">
|
||||||
<text class="value f36">{{detail.userPraised}}</text>
|
<text class="value f36">{{ detail.userPraised }}</text>
|
||||||
<text class="key ml10 c666 f24">获赞</text>
|
<text class="key ml10 c666 f24">获赞</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="option mr40">
|
<view class="option mr40">
|
||||||
<text class="value f36">{{detail.userFans}}</text>
|
<text class="value f36">{{ detail.userFans }}</text>
|
||||||
<text class="key ml10 c666 f24">粉丝</text>
|
<text class="key ml10 c666 f24">粉丝</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="option mr40">
|
<view class="option mr40">
|
||||||
<text class="value f36">{{detail.userAttention}}</text>
|
<text class="value f36">{{ detail.userAttention }}</text>
|
||||||
<text class="key ml10 c666 f24">关注</text>
|
<text class="key ml10 c666 f24">关注</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">他的评论</view>
|
<view class="" @click="userComments">他的评论</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 个人介绍 -->
|
<!-- 个人介绍 -->
|
||||||
<view class="desc mtb20 c333 f28">{{detail.userBrief}}</view>
|
<view class="desc mtb20 c333 f28">{{ detail.userBrief }}</view>
|
||||||
|
|
||||||
<!-- 橱窗 -->
|
<!-- 橱窗 -->
|
||||||
<view class="shopwindow df aic mtb30" v-if="detail.isShop == 1 && 0">
|
<view class="shopwindow df aic mtb30" v-if="detail.isShop == 1 && 0">
|
||||||
|
@ -312,7 +368,7 @@
|
||||||
<view class="product mt30">
|
<view class="product mt30">
|
||||||
<view class="title plr30 c333 f32">
|
<view class="title plr30 c333 f32">
|
||||||
<text>作品</text>
|
<text>作品</text>
|
||||||
<text class="ml10">{{listProperty.total}}</text>
|
<text class="ml10">{{ listProperty.total }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list mt20">
|
<view class="list mt20">
|
||||||
|
@ -326,9 +382,9 @@
|
||||||
<view class="menuAlt ptb50 plr40 ">
|
<view class="menuAlt ptb50 plr40 ">
|
||||||
<view class="header df">
|
<view class="header df">
|
||||||
<view class="user f1 c111">
|
<view class="user f1 c111">
|
||||||
<view class="nickname f28">{{detail.userNickname}}</view>
|
<view class="nickname f28">{{ detail.userNickname }}</view>
|
||||||
<view class="df aic mt10">
|
<view class="df aic mt10">
|
||||||
<text class="f20">账号:{{detail.account}}</text>
|
<text class="f20">账号:{{ detail.account }}</text>
|
||||||
<image class="wh30 ml10" src="/static/copy.png" mode="aspectFit" @click="handleCopyAccount" />
|
<image class="wh30 ml10" src="/static/copy.png" mode="aspectFit" @click="handleCopyAccount" />
|
||||||
<view class="f1"></view>
|
<view class="f1"></view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -345,7 +401,7 @@
|
||||||
<view class="txt mt20 c111 f20">分享主页</view>
|
<view class="txt mt20 c111 f20">分享主页</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
|
|
||||||
<view class="option ver jcc bfff br10">
|
<view class="option ver jcc bfff br10" @click="handleMessage">
|
||||||
<image class="wh50" src="/static/email.png" mode="aspectFit" />
|
<image class="wh50" src="/static/email.png" mode="aspectFit" />
|
||||||
<view class="txt mt20 c111 f20">私信Ta</view>
|
<view class="txt mt20 c111 f20">私信Ta</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -358,7 +414,7 @@
|
||||||
<view class="option ver jcc bfff br10" @click="handleBlack">
|
<view class="option ver jcc bfff br10" @click="handleBlack">
|
||||||
<image class="wh50" src="/static/blackList.png" mode="aspectFit" />
|
<image class="wh50" src="/static/blackList.png" mode="aspectFit" />
|
||||||
<view class="txt mt20 c111 f20">
|
<view class="txt mt20 c111 f20">
|
||||||
<text>拉黑</text>
|
<text>{{ detail.isBlock ? '取消拉黑' : '拉黑' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -385,47 +441,47 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// 头部
|
// 头部
|
||||||
.apex {
|
.apex {
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
.userinfo {
|
.userinfo {
|
||||||
.avatar {
|
.avatar {
|
||||||
padding: 5rpx;
|
padding: 5rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 内容
|
||||||
|
.container {
|
||||||
|
margin-top: -30rpx;
|
||||||
|
border-radius: 15rpx 15rpx 0 0;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 菜单弹窗
|
||||||
|
.menuAlt {
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
background: #F2F2F2;
|
||||||
|
|
||||||
|
// 选择菜单
|
||||||
|
.select {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
grid-gap: 20rpx;
|
||||||
|
|
||||||
|
// 选项
|
||||||
|
.option {
|
||||||
|
height: 160rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 内容
|
// 列表
|
||||||
.container {
|
.list {
|
||||||
margin-top: -30rpx;
|
.inputBox {
|
||||||
border-radius: 15rpx 15rpx 0 0;
|
width: 220rpx;
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 菜单弹窗
|
|
||||||
.menuAlt {
|
|
||||||
border-radius: 24rpx 24rpx 0 0;
|
|
||||||
background: #F2F2F2;
|
|
||||||
|
|
||||||
// 选择菜单
|
|
||||||
.select {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
grid-gap: 20rpx;
|
|
||||||
|
|
||||||
// 选项
|
|
||||||
.option {
|
|
||||||
height: 160rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 列表
|
|
||||||
.list {
|
|
||||||
.inputBox {
|
|
||||||
width: 220rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,97 +1,116 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 我的评论
|
// 我的评论
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
computed,
|
computed,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
onReady,
|
onReady,
|
||||||
onUnload,
|
onUnload,
|
||||||
onPageScroll,
|
onPageScroll,
|
||||||
onReachBottom,
|
onReachBottom,
|
||||||
} from '@dcloudio/uni-app'
|
onPullDownRefresh
|
||||||
import {
|
} from '@dcloudio/uni-app'
|
||||||
useStore,
|
import {
|
||||||
} from 'vuex'
|
useStore,
|
||||||
import api from '@/api/index.js'
|
} from 'vuex'
|
||||||
// 工具库
|
import api from '@/api/index.js'
|
||||||
import util from '@/common/js/util';
|
// 工具库
|
||||||
|
import util from '@/common/js/util';
|
||||||
|
|
||||||
// 仓库
|
// 仓库
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
// 数据列表
|
// 数据列表
|
||||||
const list = reactive({
|
const list = reactive({
|
||||||
data: [],
|
data: [],
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
})
|
})
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const userinfo = computed(() => {
|
const userinfo = computed(() => {
|
||||||
let result = store.state.userinfo
|
return store.state.userinfo
|
||||||
return result
|
})
|
||||||
})
|
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad((option) => {
|
||||||
getLst()
|
if (option.userId) {
|
||||||
})
|
uni.setNavigationBarTitle({
|
||||||
|
title: '他的评论'
|
||||||
// 重载视频列表
|
|
||||||
function refreshVideoList() {
|
|
||||||
list.pageNum = 1
|
|
||||||
list.total = 0
|
|
||||||
getLst()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取更多视频列表
|
|
||||||
function getMoreVideoList() {
|
|
||||||
if (list.data.length >= list.total) return
|
|
||||||
list.pageNum++
|
|
||||||
getLst()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取我的评论
|
|
||||||
function getLst() {
|
|
||||||
api.mine.myComment({
|
|
||||||
query: {
|
|
||||||
pageNum: list.pageNum,
|
|
||||||
pageSize: list.pageSize,
|
|
||||||
}
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
if (list.pageNum) list.data.length = 0
|
|
||||||
// 追加视频列表
|
|
||||||
list.data.push(...rs.rows.map(item => {
|
|
||||||
return item
|
|
||||||
}))
|
|
||||||
// 视频列表
|
|
||||||
list.total = rs.total
|
|
||||||
console.log('list', list.data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false,
|
|
||||||
})
|
|
||||||
}).finally(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
})
|
})
|
||||||
|
getList(option.userId)
|
||||||
|
} else {
|
||||||
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
onReachBottom(() => {
|
||||||
|
// 获取更多列表
|
||||||
|
getMoreVideoList()
|
||||||
|
})
|
||||||
|
|
||||||
|
onPullDownRefresh(() => {
|
||||||
|
// 刷新
|
||||||
|
refreshVideoList()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 重载视频列表
|
||||||
|
function refreshVideoList() {
|
||||||
|
list.pageNum = 1
|
||||||
|
list.total = 0
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取更多视频列表
|
||||||
|
function getMoreVideoList() {
|
||||||
|
if (list.data.length >= list.total) return
|
||||||
|
list.pageNum++
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取我的评论
|
||||||
|
function getList(id) {
|
||||||
|
api.mine.myComment({
|
||||||
|
query: {
|
||||||
|
userId: id ? id : userinfo.value.id,
|
||||||
|
pageNum: list.pageNum,
|
||||||
|
pageSize: list.pageSize,
|
||||||
|
}
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
if (list.pageNum) list.data.length = 0
|
||||||
|
// 追加视频列表
|
||||||
|
list.data.push(...rs.data[0].CommentVo.map(item => {
|
||||||
|
return item
|
||||||
|
}))
|
||||||
|
// 视频列表
|
||||||
|
list.total = rs.total
|
||||||
|
console.log('list', list.data)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="appbw">
|
<view class="appbw">
|
||||||
<view class="listBox plr30 ">
|
<view class="listBox plr30 ">
|
||||||
<view class="list ptb30 plr10" v-for="(item,index) in list.data" :key="index">
|
<view class="list ptb30 plr10" v-for="(item, index) in list.data" :key="index">
|
||||||
<view class="rows">
|
<view class="rows">
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<view class="title f32 c333">评论了 视频</view>
|
<view class="title f32 c333">评论了{{ item.commentType }}</view>
|
||||||
<view class="content t2hd mtb15 c333 f32">{{item.content}}</view>
|
<view class="content t2hd mtb15 c333 f32">{{ item.content }}</view>
|
||||||
<view class="time mt15 f28 c999">{{item.createTime}}</view>
|
<view class="time mt15 f28 c999">{{ item.createTime }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="image ml20" v-if="item.imageUrl">
|
<view class="image ml20" v-if="item.imageUrl">
|
||||||
<image class="wh120 br10" :src="item.imageUrl" mode="aspectFill" />
|
<image class="wh120 br10" :src="item.imageUrl" mode="aspectFill" />
|
||||||
|
@ -106,12 +125,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
//
|
//
|
||||||
.listBox {
|
.listBox {
|
||||||
|
|
||||||
// 列表
|
// 列表
|
||||||
.list+.list {
|
.list+.list {
|
||||||
border-top: 2rpx solid #eee;
|
border-top: 2rpx solid #eee;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -3,9 +3,9 @@ import {
|
||||||
} from 'vite';
|
} from 'vite';
|
||||||
import uni from '@dcloudio/vite-plugin-uni';
|
import uni from '@dcloudio/vite-plugin-uni';
|
||||||
|
|
||||||
let target = 'http://91f.xyz:8080'
|
// let target = 'http://91f.xyz:8080'
|
||||||
// let target = 'https://1a880cd5.r24.cpolar.top/'
|
// let target = 'https://1a880cd5.r24.cpolar.top/'
|
||||||
// let target = 'http://6mkwby.natappfree.cc'
|
let target = 'http://aere2w.natappfree.cc'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [uni()],
|
plugins: [uni()],
|
||||||
|
|
Loading…
Reference in New Issue