Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
608936af
提交
608936af
authored
10月 27, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:活动管理领取记录
上级
00bc04d2
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
253 行增加
和
2 行删除
+253
-2
activityManage.ts
src/api/interface/activityManage.ts
+75
-0
activityManage.ts
src/api/modules/activityManage.ts
+6
-0
index.tsx
src/pages/activityManage/activityList/detail/index.tsx
+139
-0
index.tsx
src/pages/activityManage/activityList/index.tsx
+19
-2
router.tsx
src/router/router.tsx
+14
-0
没有找到文件。
src/api/interface/activityManage.ts
浏览文件 @
608936af
...
@@ -126,3 +126,78 @@ export type activityUpdateType = InterFunction<
...
@@ -126,3 +126,78 @@ export type activityUpdateType = InterFunction<
>
;
>
;
// 删除活动
// 删除活动
export
type
activityDeleteType
=
InterFunction
<
{
id
:
number
},
null
>
;
export
type
activityDeleteType
=
InterFunction
<
{
id
:
number
},
null
>
;
// 活动详情
export
type
activityInviteDetailType
=
InterListFunction
<
{
activityId
:
number
;
activityStatus
?:
number
;
activityType
?:
number
;
userAccountId
?:
number
;
},
{
id
:
number
;
activityId
:
number
;
userAccountId
:
number
;
createTime
:
null
;
accountSimpleDTO
:
{
id
:
number
;
uid
:
string
;
phoneNum
:
string
;
userName
:
string
;
nickName
:
string
;
userImg
:
string
;
openid
:
string
;
userSex
:
number
;
email
:
null
;
source
:
null
;
accountStatus
:
number
;
portType
:
number
;
companyAuthStatus
:
number
;
cooperationTagId
:
null
;
companyName
:
string
;
tagName
:
null
;
cooperationTagVOS
:
Array
<
{
id
:
number
;
tagName
:
string
;
tagImg
:
null
;
tagDescription
:
null
;
tagRequire
:
null
;
createTime
:
null
;
}
>
;
briefIntroduction
:
null
;
coverPicture
:
null
;
region
:
null
;
};
rewardValue
:
null
;
puserAccountId
:
number
;
paccountSimpleDTO
:
{
id
:
number
;
uid
:
string
;
phoneNum
:
string
;
userName
:
null
;
nickName
:
string
;
userImg
:
string
;
openid
:
string
;
userSex
:
number
;
email
:
null
;
source
:
null
;
accountStatus
:
number
;
portType
:
number
;
companyAuthStatus
:
number
;
cooperationTagId
:
null
;
companyName
:
null
;
tagName
:
null
;
cooperationTagVOS
:
Array
<
{
id
:
number
;
tagName
:
string
;
tagImg
:
null
;
tagDescription
:
null
;
tagRequire
:
null
;
createTime
:
null
;
}
>
;
briefIntroduction
:
null
;
coverPicture
:
null
;
region
:
null
;
};
}
>
;
src/api/modules/activityManage.ts
浏览文件 @
608936af
...
@@ -4,6 +4,7 @@ import {
...
@@ -4,6 +4,7 @@ import {
activityDeleteType
,
activityDeleteType
,
activityEditType
,
activityEditType
,
activityInsertType
,
activityInsertType
,
activityInviteDetailType
,
activityUpdateType
,
activityUpdateType
,
addActivityType
,
addActivityType
,
DataInfoType
,
DataInfoType
,
...
@@ -73,4 +74,9 @@ export class ActivityManageAPI {
...
@@ -73,4 +74,9 @@ export class ActivityManageAPI {
static
activityDelete
:
activityDeleteType
=
(
params
)
=>
{
static
activityDelete
:
activityDeleteType
=
(
params
)
=>
{
return
axios
.
get
(
'/userapp/activity/delete'
,
{
params
});
return
axios
.
get
(
'/userapp/activity/delete'
,
{
params
});
};
};
// 活动详情
static
activityInviteDetail
:
activityInviteDetailType
=
(
params
)
=>
{
return
axios
.
post
(
'/userapp/activity/inviteDetail'
,
params
);
};
}
}
src/pages/activityManage/activityList/detail/index.tsx
0 → 100644
浏览文件 @
608936af
import
{
useEffect
,
useState
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
,
message
,
Table
}
from
'antd'
;
import
{
ArrowLeftOutlined
}
from
'@ant-design/icons'
;
import
{
activityInviteDetailType
}
from
'~/api/interface/activityManage'
;
import
{
InterListType
}
from
'~/api/interface'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
import
{
useLocation
,
useNavigate
}
from
'react-router-dom'
;
import
qs
from
'query-string'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
// 列表的类型
type
TableType
=
InterListType
<
activityInviteDetailType
>
;
const
ActivityListDetailView
=
()
=>
{
// 路由钩子
const
location
=
useLocation
();
const
navigate
=
useNavigate
();
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 表格分页配置
const
[
pagination
,
setPagination
]
=
useState
({
total
:
0
,
pageSize
:
10
,
current
:
1
,
totalPage
:
0
,
});
// 活动id
const
activityId
=
Number
(
qs
.
parse
(
location
.
search
).
id
);
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
const
res
=
await
ActivityManageAPI
.
activityInviteDetail
({
pageNo
:
pagination
.
current
,
pageSize
:
pagination
.
pageSize
,
activityId
,
...
value
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
const
{
list
,
pageNo
,
totalCount
,
pageSize
,
totalPage
}
=
res
.
result
;
// 解构
setPagination
({
total
:
totalCount
,
current
:
pageNo
,
pageSize
,
totalPage
,
});
setTableData
(
list
||
[]);
// console.log('加载列表 --->', list);
}
else
{
message
.
warning
(
res
.
message
);
}
};
// 翻页
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
getTableList
({
pageNo
,
pageSize
}).
then
();
};
// 页面挂载
useEffect
(()
=>
{
getTableList
().
then
();
},
[]);
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
title
:
'邀请人'
,
dataIndex
:
'userAccountId'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
record
?.
accountSimpleDTO
?.
userName
||
record
?.
accountSimpleDTO
?.
nickName
,
},
{
title
:
'邀请人手机号'
,
dataIndex
:
'userAccountId'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
record
?.
accountSimpleDTO
?.
phoneNum
,
},
{
title
:
'被邀请人'
,
dataIndex
:
'userAccountId'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
record
?.
paccountSimpleDTO
?.
userName
||
record
?.
paccountSimpleDTO
?.
nickName
,
},
{
title
:
'被邀请人手机号'
,
dataIndex
:
'userAccountId'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
record
?.
paccountSimpleDTO
?.
phoneNum
,
},
{
title
:
'奖励积分'
,
dataIndex
:
'rewardValue'
,
align
:
'center'
,
render
:
(
text
)
=>
`
${
text
}
分`
,
},
{
title
:
'注册时间'
,
dataIndex
:
'createTime'
,
align
:
'center'
,
},
];
return
(
<>
<
SearchBox
child=
{
<>
<
Button
type=
{
'primary'
}
icon=
{
<
ArrowLeftOutlined
/>
}
onClick=
{
()
=>
{
navigate
(
-
1
);
}
}
>
返回
</
Button
>
</>
}
/>
<
Table
// size='small'
dataSource=
{
tableData
}
columns=
{
columns
}
rowKey=
'id'
// scroll={{ x: 1000 }}
bordered
pagination=
{
{
total
:
pagination
.
total
,
pageSize
:
pagination
.
pageSize
,
current
:
pagination
.
current
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
onChange
:
(
page
:
number
,
pageSize
:
number
)
=>
paginationChange
(
page
,
pageSize
),
showTotal
:
(
total
,
range
)
=>
`当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`
,
}
}
/>
</>
);
};
export
default
ActivityListDetailView
;
src/pages/activityManage/activityList/index.tsx
浏览文件 @
608936af
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
SearchView
from
'~/components/search-box'
;
import
SearchView
from
'~/components/search-box'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
import
{
InterListType
,
InterReqListType
}
from
'~/api/interface'
;
import
{
InterListType
,
InterReqListType
}
from
'~/api/interface'
;
...
@@ -7,6 +7,8 @@ import { Button, message, Modal, Table } from 'antd';
...
@@ -7,6 +7,8 @@ import { Button, message, Modal, Table } from 'antd';
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
AddOrEditModal
from
'~/pages/activityManage/activityList/comp/addOrEditModal'
;
import
AddOrEditModal
from
'~/pages/activityManage/activityList/comp/addOrEditModal'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
qs
from
'query-string'
;
// 列表的类型
// 列表的类型
type
TableType
=
InterListType
<
listActivityPagesType
>
;
type
TableType
=
InterListType
<
listActivityPagesType
>
;
...
@@ -29,6 +31,8 @@ const rewardTypeList = [
...
@@ -29,6 +31,8 @@ const rewardTypeList = [
];
];
const
ActivityListView
=
()
=>
{
const
ActivityListView
=
()
=>
{
// 路由钩子
const
navigate
=
useNavigate
();
// 表格数据
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 表格分页配置
// 表格分页配置
...
@@ -62,7 +66,7 @@ const ActivityListView = () => {
...
@@ -62,7 +66,7 @@ const ActivityListView = () => {
totalPage
,
totalPage
,
});
});
setTableData
(
list
||
[]);
setTableData
(
list
||
[]);
console
.
log
(
'加载列表 --->'
,
list
);
//
console.log('加载列表 --->', list);
}
else
{
}
else
{
message
.
warning
(
res
.
message
);
message
.
warning
(
res
.
message
);
}
}
...
@@ -162,6 +166,7 @@ const ActivityListView = () => {
...
@@ -162,6 +166,7 @@ const ActivityListView = () => {
dataIndex
:
'action'
,
dataIndex
:
'action'
,
align
:
'center'
,
align
:
'center'
,
fixed
:
'right'
,
fixed
:
'right'
,
width
:
'180px'
,
render
:
(
_text
,
record
)
=>
(
render
:
(
_text
,
record
)
=>
(
<>
<>
<
Button
<
Button
...
@@ -173,6 +178,18 @@ const ActivityListView = () => {
...
@@ -173,6 +178,18 @@ const ActivityListView = () => {
>
>
编辑
编辑
</
Button
>
</
Button
>
<
Button
type=
{
'link'
}
onClick=
{
()
=>
{
navigate
(
`/activityManage/activityList/detail?${qs.stringify({
id: record?.id,
})}`
,
);
}
}
>
领取记录
</
Button
>
<
Button
type=
{
'link'
}
danger
onClick=
{
()
=>
handleDelete
(
record
)
}
>
<
Button
type=
{
'link'
}
danger
onClick=
{
()
=>
handleDelete
(
record
)
}
>
删除
删除
</
Button
>
</
Button
>
...
...
src/router/router.tsx
浏览文件 @
608936af
...
@@ -174,6 +174,7 @@ import CustomListDetail from '~/pages/customManage/customList/detail';
...
@@ -174,6 +174,7 @@ import CustomListDetail from '~/pages/customManage/customList/detail';
import
ServiceCategoryDetail
from
'~/pages/categoryManage/serviceCategoryList/detail'
;
import
ServiceCategoryDetail
from
'~/pages/categoryManage/serviceCategoryList/detail'
;
import
RewardsManageView
from
'~/pages/activityManage/rewardsManage'
;
import
RewardsManageView
from
'~/pages/activityManage/rewardsManage'
;
import
ActivityListView
from
'~/pages/activityManage/activityList'
;
import
ActivityListView
from
'~/pages/activityManage/activityList'
;
import
ActivityListDetailView
from
'~/pages/activityManage/activityList/detail'
;
const
AddressManageView
=
React
.
lazy
(()
=>
import
(
'~/pages/systemManage/addressManage'
));
const
AddressManageView
=
React
.
lazy
(()
=>
import
(
'~/pages/systemManage/addressManage'
));
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
...
@@ -529,6 +530,19 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -529,6 +530,19 @@ export const routerList: Array<RouteObjectType> = [
develop
:
true
,
develop
:
true
,
},
},
},
},
{
path
:
'/activityManage/activityList/detail'
,
element
:
withLoadingComponent
(<
ActivityListDetailView
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
520
,
title
:
'领取记录'
,
icon
:
<
WechatOutlined
/>,
hidden
:
true
,
pid
:
520
,
develop
:
true
,
},
},
],
],
},
},
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论