mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-31 09:12:10 +08:00
✨ Introducing new features. 增加微信用户拉黑功能
This commit is contained in:
parent
4e14df7237
commit
37fd47d376
@ -61,3 +61,19 @@ export function putObj(obj) {
|
|||||||
data: obj,
|
data: obj,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function black(obj, appid) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/wx-account-fans/black/' + appid,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unblack(obj, appid) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/wx-account-fans/unblack/' + appid,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -11,6 +11,7 @@ export default {
|
|||||||
language: 'language',
|
language: 'language',
|
||||||
country: 'country',
|
country: 'country',
|
||||||
province: 'province',
|
province: 'province',
|
||||||
|
isBlack: 'isBlack',
|
||||||
city: 'city',
|
city: 'city',
|
||||||
tagIds: 'tagIds',
|
tagIds: 'tagIds',
|
||||||
headimgUrl: 'headimgUrl',
|
headimgUrl: 'headimgUrl',
|
||||||
|
@ -11,6 +11,7 @@ export default {
|
|||||||
language: '语言',
|
language: '语言',
|
||||||
country: '国家',
|
country: '国家',
|
||||||
province: '省份',
|
province: '省份',
|
||||||
|
isBlack: '是否在黑名单',
|
||||||
city: '城市',
|
city: '城市',
|
||||||
tagIds: '分组',
|
tagIds: '分组',
|
||||||
headimgUrl: ' headimgUrl',
|
headimgUrl: ' headimgUrl',
|
||||||
|
@ -52,6 +52,11 @@
|
|||||||
<el-table-column :label="t('fans.subscribeTime')" prop="subscribeTime" show-overflow-tooltip />
|
<el-table-column :label="t('fans.subscribeTime')" prop="subscribeTime" show-overflow-tooltip />
|
||||||
<el-table-column :label="t('fans.nickname')" prop="nickname" show-overflow-tooltip />
|
<el-table-column :label="t('fans.nickname')" prop="nickname" show-overflow-tooltip />
|
||||||
<el-table-column :label="t('fans.language')" prop="language" show-overflow-tooltip />
|
<el-table-column :label="t('fans.language')" prop="language" show-overflow-tooltip />
|
||||||
|
<el-table-column :label="t('fans.isBlack')" prop="isBlack" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="blackList" :value="scope.row.isBlack"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column :label="t('fans.tagIds')" prop="tagIds" show-overflow-tooltip width="200">
|
<el-table-column :label="t('fans.tagIds')" prop="tagIds" show-overflow-tooltip width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-for="(tag, index) in scope.row.tagList" :key="index">
|
<span v-for="(tag, index) in scope.row.tagList" :key="index">
|
||||||
@ -61,12 +66,14 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="t('fans.remark')" prop="remark" show-overflow-tooltip />
|
<el-table-column :label="t('fans.remark')" prop="remark" show-overflow-tooltip />
|
||||||
<el-table-column :label="t('fans.wxAccountName')" prop="wxAccountName" show-overflow-tooltip />
|
<el-table-column :label="t('fans.wxAccountName')" prop="wxAccountName" show-overflow-tooltip />
|
||||||
<el-table-column :label="$t('common.action')" width="150">
|
<el-table-column :label="$t('common.action')" width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row, state.queryForm.wxAccountAppid)"
|
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row, state.queryForm.wxAccountAppid)"
|
||||||
>{{ $t('common.editBtn') }}
|
>{{ $t('common.editBtn') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button text type="primary" @click="handleDelete([scope.row.id])">{{ $t('common.delBtn') }} </el-button>
|
<el-button text type="primary" @click="handleDelete([scope.row.id])">{{ $t('common.delBtn') }} </el-button>
|
||||||
|
<el-button text type="primary" @click="handelUnBlack([scope.row.id])" v-if="scope.row.isBlack"> 取消拉黑 </el-button>
|
||||||
|
<el-button text type="primary" @click="handelBlack([scope.row.id])" v-else> 拉黑 </el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -78,7 +85,7 @@
|
|||||||
|
|
||||||
<script lang="ts" name="systemWxAccountFans" setup>
|
<script lang="ts" name="systemWxAccountFans" setup>
|
||||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||||
import { delObjs, fetchList, sync } from '/@/api/mp/wx-account-fans';
|
import { black, delObjs, fetchList, sync, unblack } from '/@/api/mp/wx-account-fans';
|
||||||
import { fetchAccountList } from '/@/api/mp/wx-account';
|
import { fetchAccountList } from '/@/api/mp/wx-account';
|
||||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
@ -91,6 +98,16 @@ const { subscribe } = useDict('subscribe');
|
|||||||
// 引入组件
|
// 引入组件
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
// 定义查询字典
|
// 定义查询字典
|
||||||
|
const blackList = ref([
|
||||||
|
{
|
||||||
|
label: '是',
|
||||||
|
value: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '否',
|
||||||
|
value: '0',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const formDialogRef = ref();
|
const formDialogRef = ref();
|
||||||
@ -181,4 +198,34 @@ const handleDelete = (ids: string[]) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handelBlack = (ids: string[]) => {
|
||||||
|
useMessageBox()
|
||||||
|
.confirm('是否要拉黑用户')
|
||||||
|
.then(() => {
|
||||||
|
black(ids, state.queryForm.wxAccountAppid)
|
||||||
|
.then(() => {
|
||||||
|
getDataList(false);
|
||||||
|
useMessage().success('拉黑用户成功');
|
||||||
|
})
|
||||||
|
.catch((err: any) => {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handelUnBlack = (ids: string[]) => {
|
||||||
|
useMessageBox()
|
||||||
|
.confirm('是否要取消拉黑用户')
|
||||||
|
.then(() => {
|
||||||
|
unblack(ids, state.queryForm.wxAccountAppid)
|
||||||
|
.then(() => {
|
||||||
|
getDataList(false);
|
||||||
|
useMessage().success('设置成功');
|
||||||
|
})
|
||||||
|
.catch((err: any) => {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user