Commit 11870677 authored by 罗林杰's avatar 罗林杰

修改黑名单

parent 2d5732e0
...@@ -153,3 +153,24 @@ export function getBalance(data){ ...@@ -153,3 +153,24 @@ export function getBalance(data){
}); });
} }
/**
* 拉黑
*/
export function addBlack(data){
return request({
method: "post",
url: '/app/opmBlackList/add',
data,
});
}
/**
* 黑名单
*/
export function getBlackList(data){
return request({
method: "get",
url: '/app/opmBlackList/list',
data
});
}
\ No newline at end of file
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<view style="background-color: #F4F5F9;min-height: 100vh;"> <view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头 --> <!-- 页头 -->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="个人留言"></u-navbar> <u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="个人留言"></u-navbar>
<view class="fixed-buttons" style="display: flex; justify-content: space-evenly; position: fixed; top: 120rpx; width: 100%; z-index: 99;"> <view class="fixed-buttons">
<view class="button-item" style="width: 50%; text-align: center; height: 50rpx; background-color: #cbcbcb; color: black;">拉黑</view> <view class="button-item" @click="addBlack">拉黑</view>
<view class="vertical-line" style="width: 1px; height: 50rpx; background-color: #808080;"></view> <view class="vertical-line" style="width: 1px; height: 50rpx; background-color: #808080;"></view>
<view class="button-item" style="width: 50%; text-align: center; height: 50rpx; background-color: #cbcbcb; color: black;">关注</view> <view class="button-item">关注</view>
</view> </view>
<view style="height: 80rpx;"></view> <view style="height: 80rpx;"></view>
<view class="page-layout"> <view class="page-layout">
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</template> </template>
<script> <script>
import {addMessage, telMessage} from "../../api/user"; import {addBlack, addMessage, telMessage} from "../../api/user";
import {getOssUrl} from "../../api/article"; import {getOssUrl} from "../../api/article";
export default { export default {
...@@ -91,6 +91,27 @@ export default { ...@@ -91,6 +91,27 @@ export default {
}) })
}) })
}, },
addBlack() {
uni.showModal({
title: '提示',
content: '确定拉黑该用户吗?',
success: (res) => {
if (res.confirm) {
const form = {
targetId: this.targetId
}
addBlack(form).then(res=>{
if (res.data.code == 200){
uni.showToast({
title: '已拉黑',
icon: 'none'
})
}
})
}
}
})
},
/** /**
* 发送 * 发送
*/ */
...@@ -296,4 +317,20 @@ export default { ...@@ -296,4 +317,20 @@ export default {
margin-right: 10rpx; margin-right: 10rpx;
} }
.fixed-buttons{
display: flex;
justify-content: space-evenly;
position: fixed;
top: 120rpx;
width: 100%;
z-index: 99;
}
.button-item{
width: 50%;
text-align: center;
height: 50rpx;
background-color: #cbcbcb;
color: black;
}
</style> </style>
\ No newline at end of file
<template> <template>
<view> <view>
<u-swipe-action> <z-paging ref="paging" :data="blackList" @query="getBlackList">
<u-swipe-action-item <u-swipe-action>
:options="options" <u-swipe-action-item
v-for="(item, index) in options4" :options="options"
:key="index" v-for="(item, index) in blackList"
> :key="index"
<view
class="swipe-action u-border-top"
:class="[index === options4.length - 1 && 'u-border-bottom']"
> >
<view class="swipe-action__content"> <view
<view class="avatar"> class="swipe-action u-border-top"
<u--image :src="item.avatar" width="40px" height="40px" mode="aspectFill" shape="circle"></u--image> :class="[index === blackList.length - 1 && 'u-border-bottom']"
</view> >
<view class="content"> <view class="swipe-action__content">
<view class="title"> <view class="avatar">
<text class="name">{{ item.name }}</text> <u--image :src="item.avatarUrl" width="40px" height="40px" mode="aspectFill" shape="circle"></u--image>
<!-- <text class="time">{{ item.time }}</text>--> </view>
<view class="content">
<view class="title">
<text class="name">{{ item.memNickName }}</text>
</view>
</view> </view>
<!-- <view class="txt">{{ item.msg }}</view>-->
</view> </view>
</view> </view>
</view> </u-swipe-action-item>
</u-swipe-action-item> </u-swipe-action>
</u-swipe-action> </z-paging>
</view> </view>
</template> </template>
<script> <script>
import {addBlack, getBlackList} from "../../api/user";
import {getOssUrl} from "../../api/article";
export default { export default {
data() { data() {
return { return {
...@@ -37,83 +40,59 @@ export default { ...@@ -37,83 +40,59 @@ export default {
text: '移除', text: '移除',
style: { style: {
backgroundColor: '#3c9cff', backgroundColor: '#3c9cff',
},
onClick: (index, item) => {
uni.showModal({
title: '提示',
content: '确定移除该用户吗?',
success: (res) => {
if (res.confirm) {
const form = {
targetId: this.targetId
}
addBlack(form).then(res=>{
if (res.data.code == 200){
uni.showToast({
title: '已拉黑',
icon: 'none'
})
}
})
}
}
})
} }
}, },
], ],
options4: [ blackList: [],
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '杨涛',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '雨中漫步',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '糖果梦境',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '海上日落',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '男朋友',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '女朋友',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '静谧之夜',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '风吹麦浪',
read: 0,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '路过岁月',
read: 0,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '繁星点点',
read: 0,
time: '23:59',
msg: '没有消息就是最好的消息'
}
],
}; };
}, },
onshow() {
},
methods: {
getBlackList(pageNo, pageSize) {
const form = {
pageNo: pageNo,
pageSize: pageSize
};
getBlackList(form).then(res => {
this.blackList = res.data.data;
this.blackList.forEach(item => {
//处理头像
if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(imgRes => {
if (imgRes.data.data != null) {
item.avatarUrl = imgRes.data.data.replace(/\\/g, "/");
console.log('11111111', item.avatarUrl)
}
})
}
})
this.$refs.paging.completeByTotal(this.blackList,res.data.total);
});
},
}
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment