Merge branch 'main' of http://1.117.67.95:3000/team/ycc-proxy-admin
This commit is contained in:
@@ -16,6 +16,8 @@ export namespace AgentApi {
|
|||||||
frozen_balance: number;
|
frozen_balance: number;
|
||||||
withdrawn_amount: number;
|
withdrawn_amount: number;
|
||||||
is_real_name: boolean;
|
is_real_name: boolean;
|
||||||
|
real_name?: string; // 姓名(实名认证的姓名)
|
||||||
|
id_card_plain?: string; // 身份证号(解密后的明文)
|
||||||
create_time: string;
|
create_time: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,6 +40,16 @@ export namespace AgentApi {
|
|||||||
order_type?: 'asc' | 'desc';
|
order_type?: 'asc' | 'desc';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 代理手机号修改参数 */
|
||||||
|
export interface UpdateAgentMobileParams {
|
||||||
|
agent_id: string;
|
||||||
|
mobile: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentMobileResp {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface AgentLinkListItem {
|
export interface AgentLinkListItem {
|
||||||
agent_id: number;
|
agent_id: number;
|
||||||
product_id: number;
|
product_id: number;
|
||||||
@@ -409,6 +421,7 @@ async function getAgentList(params: AgentApi.GetAgentListParams) {
|
|||||||
/**
|
/**
|
||||||
* 获取代理推广链接列表
|
* 获取代理推广链接列表
|
||||||
*/
|
*/
|
||||||
|
|
||||||
async function getAgentLinkList(params: AgentApi.GetAgentLinkListParams) {
|
async function getAgentLinkList(params: AgentApi.GetAgentLinkListParams) {
|
||||||
return requestClient.get<AgentApi.AgentLinkList>('/agent/link/list', {
|
return requestClient.get<AgentApi.AgentLinkList>('/agent/link/list', {
|
||||||
params,
|
params,
|
||||||
@@ -574,6 +587,16 @@ async function getAgentRewardList(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理手机号
|
||||||
|
*/
|
||||||
|
async function updateAgentMobile(params: AgentApi.UpdateAgentMobileParams) {
|
||||||
|
return requestClient.post<AgentApi.UpdateAgentMobileResp>(
|
||||||
|
'/agent/mobile/update',
|
||||||
|
params,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
auditWithdrawal,
|
auditWithdrawal,
|
||||||
generateDiamondInviteCode,
|
generateDiamondInviteCode,
|
||||||
@@ -590,5 +613,6 @@ export {
|
|||||||
getAgentWithdrawalList,
|
getAgentWithdrawalList,
|
||||||
getInviteCodeList,
|
getInviteCodeList,
|
||||||
updateAgentConfig,
|
updateAgentConfig,
|
||||||
|
updateAgentMobile,
|
||||||
updateAgentProductionConfig,
|
updateAgentProductionConfig,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -129,6 +129,16 @@ export function useColumns(): VxeTableGridOptions['columns'] {
|
|||||||
title: '实名认证状态',
|
title: '实名认证状态',
|
||||||
width: 120,
|
width: 120,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'real_name',
|
||||||
|
title: '姓名',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id_card_plain',
|
||||||
|
title: '身份证号',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'wechat_id',
|
field: 'wechat_id',
|
||||||
title: '微信号',
|
title: '微信号',
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { useColumns, useGridFormSchema } from './data';
|
|||||||
import CommissionModal from './modules/commission-modal.vue';
|
import CommissionModal from './modules/commission-modal.vue';
|
||||||
import Form from './modules/form.vue';
|
import Form from './modules/form.vue';
|
||||||
import LinkModal from './modules/link-modal.vue';
|
import LinkModal from './modules/link-modal.vue';
|
||||||
|
import MobileEditModal from './modules/mobile-edit-modal.vue';
|
||||||
import OrderModal from './modules/order-modal.vue';
|
import OrderModal from './modules/order-modal.vue';
|
||||||
import RebateModal from './modules/rebate-modal.vue';
|
import RebateModal from './modules/rebate-modal.vue';
|
||||||
import UpgradeModal from './modules/upgrade-modal.vue';
|
import UpgradeModal from './modules/upgrade-modal.vue';
|
||||||
@@ -70,6 +71,12 @@ const [WithdrawalModalComponent, withdrawalModalApi] = useVbenModal({
|
|||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 修改手机号弹窗
|
||||||
|
const [MobileEditModalComponent, mobileEditModalApi] = useVbenModal({
|
||||||
|
connectedComponent: MobileEditModal,
|
||||||
|
destroyOnClose: true,
|
||||||
|
});
|
||||||
|
|
||||||
// 表格配置
|
// 表格配置
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
@@ -142,6 +149,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
|
|
||||||
// 更多操作菜单项
|
// 更多操作菜单项
|
||||||
const moreMenuItems = [
|
const moreMenuItems = [
|
||||||
|
{
|
||||||
|
key: 'edit-mobile',
|
||||||
|
label: '修改手机号',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'links',
|
key: 'links',
|
||||||
label: '推广链接',
|
label: '推广链接',
|
||||||
@@ -188,6 +199,10 @@ function onActionClick(
|
|||||||
onViewCommission(e.row);
|
onViewCommission(e.row);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'edit-mobile': {
|
||||||
|
onEditMobile(e.row);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'edit': {
|
case 'edit': {
|
||||||
onEdit(e.row);
|
onEdit(e.row);
|
||||||
break;
|
break;
|
||||||
@@ -229,6 +244,11 @@ function onEdit(row: AgentApi.AgentListItem) {
|
|||||||
formDrawerApi.setData(row).open();
|
formDrawerApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改手机号
|
||||||
|
function onEditMobile(row: AgentApi.AgentListItem) {
|
||||||
|
mobileEditModalApi.setData(row).open();
|
||||||
|
}
|
||||||
|
|
||||||
// 查看推广链接
|
// 查看推广链接
|
||||||
function onViewLinks(row: AgentApi.AgentListItem) {
|
function onViewLinks(row: AgentApi.AgentListItem) {
|
||||||
linkModalApi.setData({ agentId: row.id }).open();
|
linkModalApi.setData({ agentId: row.id }).open();
|
||||||
@@ -269,6 +289,7 @@ function onRefresh() {
|
|||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<FormDrawer @success="onRefresh" />
|
<FormDrawer @success="onRefresh" />
|
||||||
<LinkModalComponent />
|
<LinkModalComponent />
|
||||||
|
<MobileEditModalComponent @success="onRefresh" />
|
||||||
<CommissionModalComponent />
|
<CommissionModalComponent />
|
||||||
<RebateModalComponent />
|
<RebateModalComponent />
|
||||||
<UpgradeModalComponent />
|
<UpgradeModalComponent />
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import type { AgentApi } from '#/api/agent';
|
||||||
|
|
||||||
|
import { computed, ref, watch } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import { updateAgentMobile } from '#/api/agent';
|
||||||
|
|
||||||
|
const [Modal, modalApi] = useVbenModal({
|
||||||
|
title: '修改手机号',
|
||||||
|
destroyOnClose: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
success: [];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const rowData = computed(() => modalApi.getData<AgentApi.AgentListItem>());
|
||||||
|
|
||||||
|
const newMobile = ref('');
|
||||||
|
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 打开时回填当前手机号
|
||||||
|
watch(
|
||||||
|
rowData,
|
||||||
|
(row) => {
|
||||||
|
if (row?.mobile) {
|
||||||
|
newMobile.value = row.mobile;
|
||||||
|
} else {
|
||||||
|
newMobile.value = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
const row = rowData.value;
|
||||||
|
if (!row) return;
|
||||||
|
|
||||||
|
const mobile = newMobile.value?.trim();
|
||||||
|
if (!mobile) {
|
||||||
|
message.warning('请输入新手机号');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!/^1[3-9]\d{9}$/.test(mobile)) {
|
||||||
|
message.warning('请输入正确的11位手机号');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
await updateAgentMobile({
|
||||||
|
agent_id: String(row.id),
|
||||||
|
mobile,
|
||||||
|
});
|
||||||
|
message.success('手机号修改成功');
|
||||||
|
emit('success');
|
||||||
|
modalApi.close();
|
||||||
|
} catch {
|
||||||
|
message.error('手机号修改失败');
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Modal width="420px">
|
||||||
|
<div class="py-2">
|
||||||
|
<a-form layout="vertical">
|
||||||
|
<a-form-item label="当前手机号">
|
||||||
|
<a-input :value="rowData?.mobile" disabled />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="新手机号" required>
|
||||||
|
<a-input
|
||||||
|
v-model:value="newMobile"
|
||||||
|
placeholder="请输入11位手机号"
|
||||||
|
maxlength="11"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<a-button @click="modalApi.close()">取消</a-button>
|
||||||
|
<a-button type="primary" :loading="loading" @click="handleSubmit">
|
||||||
|
确定
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
|
</Modal>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user