增加推广邀请码

This commit is contained in:
lingling 2025-02-24 21:51:56 +08:00
parent ce2f5c2f13
commit 719551bbb0
5 changed files with 121 additions and 0 deletions

19
src/api/promotion.ts Normal file
View File

@ -0,0 +1,19 @@
import axios from 'axios';
/**
*
* @param 广
* @returns
*/
export function lists() {
return axios.post<any>('/admin/api/v1/Promotion/list');
}
/**
*
* @param 广
* @returns
*/
export function Generatelink() {
return axios.post<any>('/admin/api/v1/Promotion/Generatelink');
}

View File

@ -55,6 +55,8 @@ export default {
'menu.carousel': 'carousel', 'menu.carousel': 'carousel',
'menu.volunteerservicecorps':'volunteerservicecorps', 'menu.volunteerservicecorps':'volunteerservicecorps',
"menu.searchusertime": '用户在线时长', "menu.searchusertime": '用户在线时长',
"menu.promotion": '推广管理',
"menu.promotion.Table": '推广链接',
...localeSettings, ...localeSettings,
...localeMessageBox, ...localeMessageBox,
...localeLogin, ...localeLogin,

View File

@ -62,6 +62,8 @@ export default {
"menu.dictionary":'客服', "menu.dictionary":'客服',
"menu.withdraw": '提现管理', "menu.withdraw": '提现管理',
"menu.searchusertime": '用户在线时长', "menu.searchusertime": '用户在线时长',
"menu.promotion": '推广管理',
"menu.promotion.Table": '推广链接',
...localeSettings, ...localeSettings,
...localeMessageBox, ...localeMessageBox,
...localeLogin, ...localeLogin,

View File

@ -0,0 +1,28 @@
import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';
const LIST: AppRouteRecordRaw = {
path: '/promotion',
name: 'promotion',
component: DEFAULT_LAYOUT,
meta: {
locale: 'menu.promotion',
requiresAuth: true,
icon: 'icon-list',
order: 0,
},
children: [
{
path: 'list', // The midline path complies with SEO specifications
name: 'list',
component: () => import('@/views/promotion/index.vue'),
meta: {
locale: 'menu.promotion.Table',
requiresAuth: true,
roles: ['*'],
},
},
],
};
export default LIST;

View File

@ -0,0 +1,70 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" />
<a-card class="general-card" :title="$t('menu.promotion.Table')">
<!-- <a-table :columns="columns" :data="data" @change="handleChange">
<template #columns>
<a-table-column title="id" data-index="id"></a-table-column>
<a-table-column title="邀请码" data-index="invite_code"></a-table-column>
<a-table-column title="打开次数" data-index="open"></a-table-column>
<a-table-column title="注册人数" data-index="register"></a-table-column>
</template>
</a-table> -->
<a-table :columns="columns" :data="data" @change="handleChange">
<template #name-filter="{ filterValue, setFilterValue, handleFilterConfirm, handleFilterReset}">
<div class="custom-filter">
<a-space direction="vertical">
<a-input :model-value="filterValue[0]" @input="(value)=>setFilterValue([value])" />
<div class="custom-filter-footer">
<a-button @click="handleFilterConfirm">确认</a-button>
<a-button @click="handleFilterReset">重置</a-button>
</div>
</a-space>
</div>
</template>
</a-table>
</a-card>
</div>
</template>
<script setup>
import { ref, onMounted,h } from 'vue';
import { lists } from '@/api/promotion';
import { IconSearch } from '@arco-design/web-vue/es/icon';
const data = ref([])
onMounted(async () => {
const res = await lists()
data.value = res.data
})
const columns = [
{
title: 'id',
dataIndex: 'id',
},
{
title: '邀请码',
dataIndex: 'invite_code',
filterable: {
filter: (value, record) => record.invite_code.includes(value),
slotName: 'name-filter',
icon: () => h(IconSearch)
}
},
{
title: '打开次数',
dataIndex: 'open',
},{
title: '注册人数',
dataIndex: 'register',
},
];
</script>
<style lang="less" scoped>
.container {
padding: 0 20px 20px 20px;
}
</style>