Commit 4c322f1a authored by pengyunqian's avatar pengyunqian

feature:新增接口

parent 6e805e6d
......@@ -9,7 +9,7 @@ exports.getUserPermission = async (ctx) => {
url,
method: "GET",
qs: {
//user_email: "jianghaiming@126.com"
// user_email: "jianghaiming@126.com"
user_email: user
}
};
......
const WITHDRAWAL_URI = require("../config.js").WITHDRAWAL_URI;
const req = require("../utils/request").httpReq;
const WITHDRAWAL_URI = require("../config").WITHDRAWAL_URI;
const req = require("../utils/request_withdraw").httpReq;
/**
* 示例
......@@ -25,3 +25,14 @@ exports.getApplyList = async ctx => {
};
ctx.body = await req(ctx, opts);
};
// 获取黑名单冻结账户
exports.getBlackList = 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);
};
......@@ -6,7 +6,7 @@ const enterprise = require("./controllers/enterprise");
const role = require('./controllers/role')
const life = require('./controllers/life-no');
const goods = require('./controllers/goods');
const withdrawal = require('./controllers/withdrawal');
const withdrawal = require('./controllers/withdraw/withdrawal');
const router = Router();
const API_VERSION = "/api/v1";
......@@ -62,7 +62,8 @@ router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
//用户
router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail)
// 钱包提现审核
router.post(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList)
router.post(`${API_VERSION}/get_withdrawal_black_list`, withdrawal.getBlackList)
module.exports = router;
......@@ -177,7 +177,13 @@
>点击打开外层 Dialog</el-button
>
<el-dialog title="提现申请审核" :show-close="false" :close-on-click-modal="false" v-model="outerVisible" width="50%">
<el-dialog
title="提现申请审核"
:show-close="false"
:close-on-click-modal="false"
v-model="outerVisible"
width="50%"
>
<el-form inline :model="form">
<el-form-item label="提现用户" label-width="120px">
<span style="display: inline-block; min-width: 200px">{{
......@@ -186,7 +192,7 @@
</el-form-item>
<el-button
type="info"
@click="handleButtonlist('黑名单')"
@click="handleBlackList('黑名单')"
v-show="dialogData.showMode === 'audit'"
>黑名单</el-button
>
......@@ -256,13 +262,13 @@
<div class="dialog-footer">
<el-button
type="primary"
@click="handleButtonlist('通过')"
@click="handleAdoptList('通过')"
v-show="dialogData.showMode === 'audit'"
>通过</el-button
>
<el-button
type="danger"
@click="handleButtonlist('拒绝')"
@click="handleRefuseList('拒绝')"
v-show="dialogData.showMode === 'audit'"
>拒绝</el-button
>
......@@ -275,7 +281,7 @@
</template>
<script>
import Layout from "../layout/index.vue";
// import {getApplyList} from "@/service/"
// import { getApplyList, getBlackList } from "@/service/Withdrawal/withdrawal";
export default {
name: "Audit",
components: { Layout },
......@@ -309,6 +315,13 @@ export default {
showData: {}, //弹框展示
showMode: "audit", //判断是审核还是查看
},
// 黑名单
blackList: {
user_id:'',
wallet_id:'',
is_freezing: 0,
opt_desc: ''
},
award: "", //奖励明细
outerVisible: false, //外层弹框
page: 20,
......@@ -329,8 +342,13 @@ export default {
this.outerVisible = true;
},
// 二次确认弹框
handleButtonlist(val) {
this.$confirm(`<p>你确定此操作吗</p><p>${val}</p>`, "再次确认", {
handleButtonlist(action, url, params) {
const urlObj = {
// 黑名单: getBlackList,
// "通过":,
// "拒绝"
};
this.$confirm(`<p>你确定此操作吗</p><p>${action}</p>`, "再次确认", {
confirmButtonText: "取消",
cancelButtonText: "确定",
cancelButtonClass: "cancel",
......@@ -341,7 +359,13 @@ export default {
showClose: false,
type: "warning",
})
.then(() => {
.then(async () => {
try {
const res = await urlObj[url](params);
console.log(res);
} catch (error) {
console.log(error);
}
this.$message({
type: "success",
message: "操作成功",
......@@ -354,25 +378,42 @@ export default {
});
});
},
//获取黑名单
handleBlackList() {
// const {user_id,wallet_id,is_freezing} = this.blackList
// const blackList= {
// user_id,
// wallet_id,
// is_freezing,
// opt_desc
// }
// // try {
// // } catch (error) {
// // }
// handleButtonlist('黑名单', blackList)
},
// 获取提现审核列表
async getApplyList() {
this.loading = true;
setTimeout(() => {
this.loading = false;
}, 2000);
console.log(this.searchProps);
// async getApplyList() {
// this.loading = true;
// // setTimeout(() => {
// // this.loading = false;
// // }, 2000);
// console.log(this.searchProps);
// try {
// const res = await getApplyList(this.searchProps);
// if (res.code !== 0) return this.$message.error(res.reason);
// console.log("提现列表", res);
// this.goodsList = res.result.list;
// this.count = res.result.count;
// this.loading = false
// this.loading = false;
// } catch (error) {
// this.loading = false
// this.loading = false;
// console.error(error);
// }
},
// },
},
};
</script>
......
......@@ -67,14 +67,14 @@
</div>
</template>
<script>
import page from "../components/Pagination"
import page from "../../../components/Pagination"
import roleInfo from './components/roleInfo'
import {
getRole_list as reqGetRole_list, getAdd_role as reqGetAdd_role,
getAll_role_list as reqGetAll_role_list,
getUpdate_role as reqGetUpdate_role,
get_role_info as reqGet_role_info
} from "../../service/role";
} from "../../../service/role";
import { ElMessage } from 'element-plus'
export default {
name: 'KeepaddRole',
......
......@@ -136,13 +136,13 @@
</layout>
</template>
<script>
import Layout from "@/layouts";
import page from "../components/Pagination"
import Layout from "../layout";
import page from "../../../components/Pagination"
import {
getRole_list as reqGetRole_list, getAll_role_list as reqGetAll_role_list,
getUpdate_role as reqGetUpdate_role, get_role_info as reqGet_role_info,
getDelete_role as reqGetDelete_role, getAdd_role as reqGetAdd_role
} from "../../service/role";
} from "../../../service/role";
export default {
name: 'KeepRoleManagement',
components: {
......
......@@ -68,7 +68,7 @@
</div>
</template>
<script>
import { get_role_info as reqGet_role_info, getAll_role_list as reqGetAll_role_list, } from '../../service/role'
import { get_role_info as reqGet_role_info, getAll_role_list as reqGetAll_role_list, } from '../../../service/role'
export default {
data () {
return {
......
......@@ -47,7 +47,7 @@
</div>
</template>
<script>
import { getUser_detail as reqGetUser_detail } from "../../service/user";
import { getUser_detail as reqGetUser_detail } from "../../../service/user";
export default {
data () {
return {
......
......@@ -63,7 +63,7 @@
<script>
import { ElMessage } from "element-plus";
import { getRole_list as reqGetRoles } from '@/service/role';
import { getRole_list as reqGetRoles } from '../../../../../service/role';
export default {
name: 'UserInfoEditModal',
......
......@@ -60,7 +60,7 @@
<script>
import { ElMessage } from "element-plus";
import { getRole_list as reqGetRoles } from '@/service/role';
import { getRole_list as reqGetRoles } from '../../../../../service/role';
export default {
name: 'UserInfoEditModal',
......
......@@ -105,8 +105,8 @@
</template>
<script>
import Layout from "@/layouts";
import page from "@/components/Pagination";
import Layout from "../../layout";
import page from "../../../../components/Pagination";
import UserInfoModal from "./components/UserInfoModal";
import UserInfoEditModal from "./components/UserInfoEditModal";
import UserInfoNewModal from "./components/UserInfoNewModal";
......@@ -116,7 +116,7 @@ import {
getUserDetail as reqGetUserDetail,
editUser as reqEditUser,
createUser as reqCreateUser,
} from "@/service/user";
} from "../../../../service/user";
export default {
components: {
......
......@@ -4,11 +4,11 @@ const headerConfig = [
path: "/op/withdrawal/audit"
},
{
path: '/op/withdrawal/components/role',
path: '/op/withdrawal/roleManageRole',
name: '角色管理'
},
{
path: '/op/withdrawal/components/user',
path: '/op/withdrawal/user',
name: '用户管理'
}
......
const request = require("request");
exports.httpReq = (ctx, opts) => {
opts.timeout = opts.timeout || 1000;
return new Promise((resolve, reject) => {
var time_start = +new Date();
const defaultQs = {
appid: "merchant-op-auditing",
cv: "1.0.0",
version: "999999",
distribution: "op",
net: "wifi",
platform: "2"
};
opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs };
request(opts, (err, res, body) => {
console.info(
`[Api] httpReq (${opts.url}, user:[${opts.qs.op_cur_user
}]) spent: ${+new Date() - time_start}ms`
);
if (!err) {
resolve(body);
} else {
reject(err);
console.error(opts.url, err);
}
});
});
};
......@@ -9,7 +9,44 @@ const withdrawalRoutes = [
name: "Audit",
component: () => import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Audit"),
},
//用户管理
{
path: "/op/withdrawal/user",
name: "User",
component: () => import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/User/userList"),
},
{
path: "/op/withdrawal/userDetail",
name: "UserDetail",
component: () => import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/User/user-detail.vue"),
},
//角色管理
{
path: "/op/withdrawal/roleAddRole",
name: "AddRole",
component: () => import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Role/add-role"),
meta: {
requireAuth: true,
keepAlive: true
}
},
{
path: "/op/withdrawal/roleManageRole",
name: "ManageRole",
component: () => import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Role/manage-role"),
meta: {
requireAuth: true,
keepAlive: true
}
},
{
path: "/op/withdrawal/roleRoleDetail",
name: "RoleDetail",
component: () => import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Role/role-detail"),
meta: {
keepAlive: true
}
},
];
export default withdrawalRoutes;
\ No newline at end of file
export const defaultParams = {
appid: "merchant-op-auditing"
}
import axios from "@/utils/request";
import { defaultParams } from "./common";
const getParams = (p = {}) => {
return {...defaultParams, ...p}
}
// 获取提现审核列表
export async function getApplyList () {
const res = await axios.get("/api/v1/get_withdrawal_apply_list");
const res = await axios.get("/api/v1/get_withdrawal_apply_list", {params: getParams()});
return res;
}
// 黑名单,冻结用户
export async function getBlackList ({user_id,wallet_id,is_freezing}) {
const res = await axios.post("/api/v1/get_withdrawal_black_list" ,{params: getParams({user_id,wallet_id,is_freezing})});
return res;
}
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