Commit 979efc91 authored by pengyunqian's avatar pengyunqian

feat:黑名单

parent bc9d0910
......@@ -92,6 +92,28 @@ exports.getRecordList = async ctx => {
}
ctx.body = await req(ctx, opts)
}
// 钱包账户黑名单
exports.getAccountBlackList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/blacklist`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
// 钱包账户释放
exports.getReblackList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/reblacklist`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
const getUserPermission = async (ctx) => {
const url = `${WITHDRAWAL_URI}/merchant/authority/get_role_list`;
......
......@@ -90,5 +90,7 @@ router.get(`${API_VERSION}/get_apply_detail`, withdrawal.getApplyDetail)
// 钱包账户
router.get(`${API_VERSION}/get_account_list`, withdrawal.getAccountList)
router.get(`${API_VERSION}/get_record_list`, withdrawal.getRecordList)
router.post(`${API_VERSION}/get_account_black_list`, withdrawal.getAccountBlackList)
router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList)
module.exports = router;
......@@ -4,6 +4,11 @@
<!-- <el-card class="goods-h5"> -->
<div class="goods-h5">
<el-table :data="goodsList" border>
<el-table-column
label="登录地点"
prop="withdraw_address"
align="center"
></el-table-column>
<el-table-column
label="申请用户"
prop="user_id"
......
......@@ -195,6 +195,10 @@
>白名单</el-button
> -->
<ul class="listShow">
<li>
<span class="list-left">登录地点 :</span>
<span class="list-right">{{ dialogData.showData.withdraw_address }}</span>
</li>
<li>
<span class="list-left">提现金额 :</span>
<span class="list-right">{{ dialogData.showData.amount }}</span>
......
<template>
<div
class="manage-wrapper"
v-loading="tableLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.6)"
>
<el-card class="role_management">
<!-- 检索区域 -->
<div class="creatRole">
......@@ -49,6 +56,11 @@
</template>
</el-table-column>
<el-table-column label="状态" width="200px" prop="status" align="center">
<template #default="scope">
<span :style="{ color: scope.row.status==='失败' ?'red':'black'}" >
{{scope.row.status}}
</span>
</template>
</el-table-column>
<el-table-column label="说明" align="center" prop="third_order_desc">
</el-table-column>
......@@ -56,11 +68,13 @@
<el-button type="primary" @click="handleBack" style="margin-top:50px;margin-left: 45%;">返回</el-button>
<page :totalNum="totalNum" @update="update" />
</el-card>
</div>
</template>
<script>
import page from "../../../components/Pagination";
import { getRecordList } from "@/service/Withdrawal/withdrawal";
import { ElMessage } from 'element-plus';
const tradeType = { 1: "充值", 2: "提现", 3: "转账" };
export default {
name: "flowRecord",
......@@ -70,7 +84,17 @@ export default {
user_id: "",
wallet_id: "",
type: "",
recordList: [],
recordList: [
{wallet_record_id:'243435676',
create_time:"2021-3-3",
amount:4,
balance:555,
trade_type:"提现",
status:"失败"
}
],
tableLoading: false,
params: {
page: 1,
page_size: 20,
......@@ -81,6 +105,7 @@ export default {
created() {
this.user_id = this.$route.query.user_id;
this.wallet_id = this.$route.query.wallet_id;
this.tableLoading = true;
this.getRecordList();
},
......@@ -101,9 +126,14 @@ export default {
type,
};
getRecordList(params_list).then((res) => {
this.tableLoading = true;
this.recordList = res.result.list;
this.totalNum = res.result.count;
});
this.tableLoading = false;
}).catch (err=>{
this.tableLoading = false;
ElMessage.error("加载失败"+err)
});;
},
// 获取交易类型
getTradeType(code) {
......
<template>
<Layout>
<div
class="manage-wrapper"
v-loading="tableLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.6)"
>
<el-card class="role_management">
<!-- 检索区域 -->
<div class="creatRole">
<el-form inline :model="searchProps">
<el-form-item label="用户Id" >
<el-input clearable v-model="searchProps.user_id" @input="
searchProps.user_id = $event
.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, '')
"></el-input>
<el-form-item label="用户Id">
<el-input
clearable
v-model="searchProps.user_id"
@input="
searchProps.user_id = $event.replace(
/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g,
''
)
"
></el-input>
</el-form-item>
<el-form-item label="账户状态">
<el-select v-model="searchProps.type" clearable >
<el-select v-model="searchProps.type" clearable>
<el-option label="黑名单" :value="2"></el-option>
<el-option label="正常用户" :value="1"></el-option>
</el-select>
......@@ -38,7 +51,7 @@
align="center"
>
<template #default="scope">
{{"¥ "+scope.row.available_fund}}
{{ "¥ " + scope.row.available_fund }}
</template>
</el-table-column>
<el-table-column
......@@ -47,7 +60,7 @@
align="center"
>
<template #default="scope">
{{"¥ "+scope.row.freezing_fund}}
{{ "¥ " + scope.row.freezing_fund }}
</template>
</el-table-column>
<el-table-column
......@@ -56,7 +69,7 @@
align="center"
>
<template #default="scope">
{{"¥ "+scope.row.history_fund}}
{{ "¥ " + scope.row.history_fund }}
</template>
</el-table-column>
<el-table-column
......@@ -70,14 +83,26 @@
<template #default="scope">
<el-button
v-show="scope.row.is_black == 0"
@click.stop="openBounced(scope.row.is_black,scope.row.wallet_id)"
@click.stop="
openBounced(
scope.row.is_black,
scope.row.user_id,
scope.row.wallet_id
)
"
type="text"
size="mini"
>黑名单</el-button
>
<el-button
v-show="scope.row.is_black == 1"
@click.stop="openBounced(scope.row.is_black,scope.row.wallet_id)"
@click.stop="
openBounced(
scope.row.is_black,
scope.row.user_id,
scope.row.wallet_id
)
"
size="mini"
type="text"
>释放</el-button
......@@ -93,85 +118,76 @@
</el-table>
<page :totalNum="totalNum" @update="update" />
</el-card>
</Layout>
</div>
</Layout>
</template>
<script>
import page from "../../../components/Pagination";
import Layout from "../layout/index.vue";
import {
getAccountList
getAccountList,
getAccountBlackList,
getReblackList
} from "@/service/Withdrawal/withdrawal";
// import { ElMessage } from 'element-plus';
import { ElMessage } from "element-plus";
export default {
name: "walletAccount",
props:["flowRecord"],
props: ["flowRecord"],
components: {
page,Layout
page,
Layout,
},
data() {
return {
searchProps: {
user_id: "",
wallet_id: "",
type: "",
},
formLabelWidth: "120px",
params: {
page: 1,
page_size: 20,
},
totalNum: null,
roleTitle: "",
roleName: "",
edit: true,
props: {
multiple: true, //设置为多选
value: "id", //value值和哪个值绑定
label: "desc", //label值和哪个值绑定
children: "sub_permissions", //children值和哪个值绑定
},
selectedOptions: [],
dialogText: "",
accountList: [],
role_info_detail: {
//详情非编辑项
role_id: "",
role_name: "",
},
permissionsAll: [],
currenPermissionsUpdate: [],
currentRolePrivilege: [],
tableLoading: false,
};
},
created() {
this.tableLoading = true;
this.getAccountList();
// this.getPermissionsAll();
},
methods: {
//获取账户列表
getAccountList() {
this.accountList=[]
this.accountList = [];
let { page, page_size } = this.params;
let { user_id, type } = this.searchProps;
let params_list = {
page,
page_size,
type,
user_id: user_id || undefined
user_id: user_id || undefined,
};
getAccountList(params_list).then((res) => {
getAccountList(params_list)
.then((res) => {
this.tableLoading = true;
this.accountList = res.result.list;
this.totalNum = res.result.count;
this.tableLoading = false;
})
.catch((err) => {
this.tableLoading = false;
ElMessage.error("加载失败" + err);
});
},
//查询
findProducts() {
this.tableLoading = true;
this.getAccountList();
},
// //重置
// onReset() {
// (this.searchProps.user_id = ""), (this.searchProps.type = "");
// this.getGetRole_list();
// },
//列表分页
update(obj) {
Object.assign(this.params, obj);
......@@ -179,18 +195,26 @@ export default {
this.getAccountList(page, page_size);
},
//弹框提示
openBounced(type, wallet_id) {
this.$confirm(`${type===1?"确认后则将用户释放出黑名单": "确认后则将用户拉入黑名单"}是否继续?`, "提示", {
openBounced(type, user_id, wallet_id) {
this.$confirm(
`${
type === 1 ? "确认后则将用户释放出黑名单" : "确认后则将用户拉入黑名单"
}是否继续?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
center: true,
}
)
.then(() => {
if (+type === 0) {
this.getRole_info_detail("disable", wallet_id);
this.handleBlackList(user_id, wallet_id);
} else {
this.release(wallet_id);
this.release(user_id, wallet_id);
}
console.log("123456")
})
.catch(() => {
this.$message({
......@@ -201,32 +225,48 @@ export default {
},
//释放
// async release(wallet_id) {
// this.dialogText = "确认后则将用户释放出黑名单";
// try {
// await getRelease(wallet_id)
// ElMessage("释放成功")
// this.getAccountList()
// } catch (error) {
// ElMessage(error)
// }
// },
async release(user_id, wallet_id) {
this.dialogText = "确认后则将用户释放出黑名单";
let params = {
user_id,
wallet_id,
};
try {
await getReblackList(params);
ElMessage("释放成功");
this.getAccountList();
} catch (error) {
ElMessage("释放请求失败");
}
},
// //流水记录
handelRecord(row) {
this.$router.push({path: "/op/withdrawal/flowrecord", query: {user_id:row.user_id,wallet_id:row.wallet_id}})
this.$router.push({
path: "/op/withdrawal/flowrecord",
query: { user_id: row.user_id, wallet_id: row.wallet_id },
});
},
// //黑名单
// async handleBlackList(row) {
// this.edit = true;
// this.roleTitle = "修改角色";
// await this.getPermissionsAll();
// this.dialogVisible = true;
// this.getRole_info_detail("modify", row.role_id);
// },
async handleBlackList(user_id, wallet_id) {
let params = {
user_id,
wallet_id,
};
try {
await getAccountBlackList(params);
ElMessage("添加黑名单成功");
this.getAccountList();
} catch (error) {
ElMessage("添加黑名单失败");
}
},
}
},
};
</script>
<style lang="less" scoped>
.manage-wrapper {
height: 100%;
}
.creatRole {
display: flex;
justify-content: space-between;
......
......@@ -50,15 +50,21 @@ export async function getRolesForUser(user_email) {
// 迭代---钱包账户
// 获取账户列表
export async function getAccountList(params) {
const res = await axios.get("/api/v1/get_account_list", {
params: getParams(params)
});
const res = await axios.get("/api/v1/get_account_list", params);
return res;
}
// 获取账户流水列表
export async function getRecordList(params) {
const res = await axios.get("/api/v1/get_record_list", {
params: getParams(params)
});
const res = await axios.get("/api/v1/get_record_list", params);
return res;
}
// 钱包账户-黑名单
export async function getAccountBlackList(params) {
const res = await axios.post("/api/v1/get_account_black_list", params)
return res;
}
// 钱包账户-释放
export async function getReblackList(params) {
const res = await axios.post("/api/v1/get_reblack_list",params)
return res;
}
\ No newline at end of file
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