举报 拉黑 查看评论

This commit is contained in:
lr 2025-02-24 16:25:08 +08:00
parent a8684b1956
commit 4e88cbdefc
8 changed files with 839 additions and 738 deletions

View File

@ -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

View File

@ -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',
}) })

View File

@ -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: {

View File

@ -42,7 +42,10 @@
// //
const emit = defineEmits(['item']) const emit = defineEmits(['item'])
// id // id
const ids = defineModel('ids') const videoInfo = reactive({
videoId: '',
coverUrl: '',
})
// //
const videoContext = ref(null) const videoContext = ref(null)
// //
@ -86,15 +89,12 @@
else if (props.mode == 'menu') { else if (props.mode == 'menu') {
emit('item', item) emit('item', item)
} }
// //
else if (props.mode == 'checkbox') { else if (props.mode == 'checkbox') {
const findIndex = ids.value.findIndex(node => node == item.videoId) videoInfo.videoId = item.id
if (findIndex >= 0) ids.value.splice(findIndex, 1) videoInfo.coverUrl = item.coverUrl
else { videoUrl.value = item.videoUrl
// emit('videoInfo', videoInfo)
if (props.limit != 0 && props.limit <= ids.value.length) return
ids.value.push(item.videoId)
}
} }
} }
@ -126,7 +126,7 @@
<!-- 选项 --> <!-- 选项 -->
<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 File

@ -46,10 +46,11 @@
// //
const form = reactive({ const form = reactive({
userId: '', userId: '',
videoId: [], videoId: '',
reason: '', reasonForReporting: '',
context: '', particulars: '',
pic: [], videoPictureUrl: '',
coverUrl: ''
}) })
// //
const list = reactive({ const list = reactive({
@ -90,19 +91,11 @@
getList() getList()
} }
//
function getMoreList() {
if (list.data.length >= list.rows) return
list.pageNum++
getList()
}
// //
function getList() { function getList() {
// //
api.video.myVideoList({ api.video.myWorks({
query: { query: {
isDraft: 0,
userId: form.userId, userId: form.userId,
pageSize: list.pageSize, pageSize: list.pageSize,
pageNum: list.pageNum, pageNum: list.pageNum,
@ -128,7 +121,10 @@
// //
function uploadImg() { function uploadImg() {
util.upload_image({ util.upload_image({
value: form.pic, type: 1,
success: rs => {
form.videoPictureUrl = rs.value
}
}) })
} }
@ -137,11 +133,15 @@
* @param {Number} index 列表下标 * @param {Number} index 列表下标
* @param {String} key 操作的键 * @param {String} key 操作的键
*/ */
function removeMedia(index, key) { function removeMedia(key) {
util.alert({ util.alert({
content: '确认要删除吗?', content: '确认要删除吗?',
}).then(rs => { }).then(rs => {
if (rs.confirm) form[key].splice(index, 1) if (key == 'videoId') {
form.videoId = null
form.coverUrl = null
}
if (key == 'videoPictureUrl') form.videoPictureUrl = null
}) })
} }
@ -157,30 +157,24 @@
util.alert('请选择举报理由') util.alert('请选择举报理由')
return return
} }
if (!data.context) { if (!data.particulars) {
util.alert('详细描述不能为空') util.alert('详细描述不能为空')
return return
} }
if (data.context.length > 100) { if (data.particulars.length > 100) {
util.alert('详细描述自述超过100') util.alert('详细描述自述超过100')
return return
} }
if (!data.pic[0]) { if (!data.videoPictureUrl) {
util.alert('请上传举报图片') util.alert('请上传举报图片')
return return
} }
if (!data.videoId[0]) { if (!data.videoId) {
util.alert('请选择举报视频') util.alert('请选择举报视频')
return return
} }
// data.reasonForReporting = reportList[reportIndex.value].name
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({ api.video.reportVideo({
data: data, data: data,
@ -198,6 +192,13 @@
}) })
}) })
} }
//
function videoInfo(param) {
console.log('选中视频信息', param);
form.videoId = param.videoId;
form.coverUrl = param.coverUrl;
}
</script> </script>
<template> <template>
@ -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>
@ -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>

View File

@ -142,12 +142,36 @@
const index = rs.tapIndex const index = rs.tapIndex
if (index == 0) { if (index == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/report', 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() { function handleCopyAccount() {
// //
@ -181,7 +205,7 @@
getUserinfo() getUserinfo()
// //
uni.$emit('focusUser', { uni.$emit('focusUser', {
userId: detail.userId, userId: detail.id,
result: detail.isAttention, result: detail.isAttention,
}) })
// //
@ -197,37 +221,69 @@
// //
function handleBlock() { function handleBlock() {
// // //
detail.isBlock = !detail.isBlock // detail.isBlock = !detail.isBlock
// // api.video.videoBlock({
api.video.videoBlock({ // query: {
query: { // type: detail.isBlock ? 0 : 1,
type: detail.isBlock ? 0 : 1, // userId: detail.id,
userId: detail.userId, // }
} // }).then(rs => {
}).then(rs => { // if (rs.code == 200) {
if (rs.code == 200) { // return
return // }
}
detail.isBlock = !detail.isBlock // detail.isBlock = !detail.isBlock
util.alert({ // util.alert({
content: rs.msg, // content: rs.msg,
showCancel: false, // showCancel: false,
}) // })
}) // })
} }
// //
function handleMessage() { function handleMessage() {
util.toChat({ util.toChat({
name: detail.userNickname, name: detail.userNickname,
msgId: detail.userId, msgId: detail.id,
type: 'C2C', type: 'C2C',
}) })
return return
} }
//
function userComments() {
if (detail.isLock) {
toCommentsList()
} else {
//
util.alert({
content: `确认消耗${detail.consumeFruit}个榴莲果解锁评论吗?`,
}).then(rs => {
unlockComments()
})
}
}
//
function unlockComments() {
api.mine.unlockComment({ userId: detail.id }).then(res => {
if (res.code == 200) {
util.alert('解锁成功!')
if (res.data.isLock) {
toCommentsList()
getUserinfo()
}
}
})
}
//
function toCommentsList() {
uni.navigateTo({
url: util.setUrl('/pages/mine/myComment', {
userId: detail.id,
}),
})
}
</script> </script>
<template> <template>
@ -284,7 +340,7 @@
<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>
<!-- 个人介绍 --> <!-- 个人介绍 -->
@ -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>

View File

@ -12,6 +12,7 @@
onUnload, onUnload,
onPageScroll, onPageScroll,
onReachBottom, onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
useStore, useStore,
@ -31,32 +32,50 @@
}) })
// //
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: '他的评论'
})
getList(option.userId)
} else {
getList()
}
})
onReachBottom(() => {
//
getMoreVideoList()
})
onPullDownRefresh(() => {
//
refreshVideoList()
}) })
// //
function refreshVideoList() { function refreshVideoList() {
list.pageNum = 1 list.pageNum = 1
list.total = 0 list.total = 0
getLst() getList()
} }
// //
function getMoreVideoList() { function getMoreVideoList() {
if (list.data.length >= list.total) return if (list.data.length >= list.total) return
list.pageNum++ list.pageNum++
getLst() getList()
} }
// //
function getLst() { function getList(id) {
api.mine.myComment({ api.mine.myComment({
query: { query: {
userId: id ? id : userinfo.value.id,
pageNum: list.pageNum, pageNum: list.pageNum,
pageSize: list.pageSize, pageSize: list.pageSize,
} }
@ -64,7 +83,7 @@
if (rs.code == 200) { if (rs.code == 200) {
if (list.pageNum) list.data.length = 0 if (list.pageNum) list.data.length = 0
// //
list.data.push(...rs.rows.map(item => { list.data.push(...rs.data[0].CommentVo.map(item => {
return item return item
})) }))
// //
@ -89,7 +108,7 @@
<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 File

@ -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()],