Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
0424dfc9
提交
0424dfc9
authored
4月 01, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
e5801880
decad6fc
流水线
#8682
已通过 于阶段
in 1 分 3 秒
变更
10
流水线
1
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
811 行增加
和
3 行删除
+811
-3
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
activityManage.ts
src/api/interface/activityManage.ts
+82
-0
activityManage.ts
src/api/modules/activityManage.ts
+36
-0
index.tsx
...vityManage/pointExchangeGoods/comp/addEditModal/index.tsx
+124
-0
index.tsx
src/pages/activityManage/pointExchangeGoods/index.tsx
+200
-0
index.tsx
...ivityManage/pointExchangeList/comp/addEditModal/index.tsx
+155
-0
index.tsx
src/pages/activityManage/pointExchangeList/index.tsx
+186
-0
index.tsx
...ourceManage/storeDecorate/comp/addSolutionModal/index.tsx
+2
-2
index.tsx
...urceManage/storeDecorate/comp/storeSolutionView/index.tsx
+1
-0
router.tsx
src/router/router.tsx
+24
-0
没有找到文件。
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
0424dfc9
...
...
@@ -14,4 +14,4 @@ patches:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag
:
66414ec625450b5e92c20edcb3c840e5914fdda0
newTag
:
b2587d668e66494bfe96217234b7f1eb778644c2
src/api/interface/activityManage.ts
浏览文件 @
0424dfc9
...
...
@@ -201,3 +201,85 @@ export type activityInviteDetailType = InterListFunction<
};
}
>
;
// 后台——添加积分商品
export
type
insertMallType
=
InterFunction
<
{
goods
?:
string
;
goodsUrl
?:
string
;
id
?:
number
;
needPoints
?:
number
;
},
null
>
;
// 后台——修改积分商品
export
type
updateMallType
=
InterFunction
<
{
goods
?:
string
;
goodsUrl
?:
string
;
id
?:
number
;
needPoints
?:
number
;
},
null
>
;
// 积分商城列表
export
type
getMallListType
=
InterListFunction
<
NonNullable
<
unknown
>
,
{
goods
:
string
;
goodsUrl
:
string
;
id
:
number
;
needPoints
:
number
;
}
>
;
// 后台——删除积分商品
export
type
deleteMallType
=
InterFunction
<
{
id
:
number
;
},
null
>
;
// 积分商品订单列表
export
type
mallOrderListType
=
InterListFunction
<
{
isAdmin
?:
number
;
userId
?:
number
;
},
{
id
:
number
;
userId
:
number
;
pointsMallId
:
number
;
address
:
string
;
trackingNumber
:
string
;
userName
:
string
;
userPhone
:
string
;
trackintCompany
:
string
;
sendStatus
:
number
;
goods
:
string
;
goodsUrl
:
string
;
needPoints
:
number
;
createTime
:
string
;
}
>
;
// 修改商品订单
export
type
updateGoodsOrderType
=
InterFunction
<
{
address
?:
string
;
id
?:
number
;
pointsMallId
?:
number
;
sendStatus
?:
number
;
trackingNumber
?:
string
;
trackintCompany
?:
string
;
userId
?:
number
;
userName
?:
string
;
userPhone
?:
string
;
},
NonNullable
<
unknown
>
>
;
// 物流-状态码-字典
export
type
listKdnDicType
=
InterFunction
<
NonNullable
<
unknown
>
,
{
exName
:
string
;
exCode
:
string
;
}[]
>
;
src/api/modules/activityManage.ts
浏览文件 @
0424dfc9
...
...
@@ -8,10 +8,17 @@ import {
activityUpdateType
,
addActivityType
,
DataInfoType
,
deleteMallType
,
endActivityType
,
getMallListType
,
insertMallType
,
listActivityPagesType
,
listKdnDicType
,
mallOrderListType
,
SignInListType
,
splitCouponDownType
,
updateGoodsOrderType
,
updateMallType
,
}
from
'../interface/activityManage'
;
import
axios
from
'../request'
;
...
...
@@ -79,4 +86,33 @@ export class ActivityManageAPI {
static
activityInviteDetail
:
activityInviteDetailType
=
(
params
)
=>
{
return
axios
.
post
(
'/userapp/activity/inviteDetail'
,
params
);
};
// 后台——添加积分商品
static
insertMall
:
insertMallType
=
(
params
)
=>
{
return
axios
.
post
(
'/oms/pointsMall/insertMall'
,
params
);
};
// 后台——修改积分商品
static
updateMall
:
updateMallType
=
(
params
)
=>
{
return
axios
.
post
(
'/oms/pointsMall/updateMall'
,
params
);
};
// 积分商城列表
static
getMallList
:
getMallListType
=
(
params
)
=>
{
return
axios
.
post
(
'/oms/pointsMall/getMallList'
,
params
);
};
// 后台——删除积分商品
static
deleteMall
:
deleteMallType
=
(
params
)
=>
{
return
axios
.
get
(
'/oms/pointsMall/deleteMall'
,
{
params
});
};
// 积分商品订单列表
static
mallOrderList
:
mallOrderListType
=
(
params
)
=>
{
return
axios
.
post
(
'/oms/pointsMall/mallOrderList'
,
params
);
};
// 修改商品订单
static
updateGoodsOrder
:
updateGoodsOrderType
=
(
params
)
=>
{
return
axios
.
post
(
'/oms/pointsMall/updateGoodsOrder'
,
params
);
};
// 物流-状态码-字典
static
listKdnDic
:
listKdnDicType
=
(
params
)
=>
{
return
axios
.
get
(
'/oms/express/listExpressInfo'
,
{
params
});
};
}
src/pages/activityManage/pointExchangeGoods/comp/addEditModal/index.tsx
0 → 100644
浏览文件 @
0424dfc9
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Input
,
message
,
Modal
,
ModalProps
}
from
'antd'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
InterReqType
}
from
'~/api/interface'
;
import
{
updateMallType
}
from
'~/api/interface/activityManage'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
// 请求的表单类型
type
ReqType
=
InterReqType
<
updateMallType
>
;
const
AddEditModalView
:
React
.
FC
<
ModalProps
&
{
data
:
ReqType
;
onCancel
:
()
=>
void
}
>
=
({
open
,
title
,
onCancel
,
data
,
})
=>
{
// 表单数据
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 店铺图片列表
const
[
imageList
,
setImageList
]
=
useState
<
any
>
([]);
// 店铺图片列表上传
const
imageListChange
=
(
value
:
any
)
=>
{
setImageList
(
value
);
form
.
setFieldValue
(
'goodsUrl'
,
JSON
.
stringify
(
value
?.
map
((
i
:
{
url
:
string
})
=>
i
?.
url
)));
};
// 关闭弹窗
const
handleCancel
=
()
=>
{
form
.
resetFields
();
setImageList
([]);
onCancel
?.();
};
// 确认事件
const
handleOk
=
()
=>
{
form
.
validateFields
()
.
then
(
async
(
values
)
=>
{
await
handleSubmit
(
values
);
})
.
catch
((
err
)
=>
{
message
.
warning
({
content
:
err
.
errorFields
[
0
].
errors
[
0
],
})
.
then
();
});
};
// 提交数据
const
handleSubmit
=
async
(
values
:
ReqType
)
=>
{
const
res
=
await
ActivityManageAPI
[
data
?.
id
?
'updateMall'
:
'insertMall'
]({
...
data
,
...
values
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
data
?.
id
?
'修改成功'
:
'添加成功'
);
handleCancel
();
}
};
// 组件挂载
useEffect
(()
=>
{
if
(
!
data
)
return
;
form
.
setFieldsValue
(
data
);
try
{
setImageList
(
(
JSON
.
parse
(
data
.
goodsUrl
||
`[]`
)
||
[])?.
map
((
i
:
{
url
:
string
},
j
:
number
)
=>
({
id
:
j
,
url
:
i
,
})),
);
}
catch
(
e
)
{
setImageList
([]);
}
// console.log('组件挂载 --->', data);
},
[
open
]);
return
(
<
Modal
open=
{
open
}
title=
{
title
}
onCancel=
{
handleCancel
}
onOk=
{
handleOk
}
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
14
}
}
>
<
Form
.
Item
label=
'商品名称'
name=
'goods'
rules=
{
[{
required
:
true
,
message
:
'请输入商品名称'
}]
}
>
<
Input
placeholder=
{
'请输入商品名称'
}
maxLength=
{
25
}
allowClear
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品图片'
name=
'goodsUrl'
rules=
{
[{
required
:
true
,
message
:
'请上传商品图片'
}]
}
>
<
Uploader
fileUpload
listType=
'picture-card'
defaultFileList=
{
imageList
}
onChange=
{
imageListChange
}
fileLength=
{
1
}
fileSize=
{
10
}
>
<
UploadOutlined
/>
</
Uploader
>
</
Form
.
Item
>
<
Form
.
Item
label=
'消耗积分'
name=
'needPoints'
rules=
{
[
{
required
:
true
,
message
:
'请输入消耗积分'
},
{
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'请输入正整数'
},
{
validator
:
(
_rule
,
value
)
=>
{
if
(
value
>
99999999
)
{
return
Promise
.
reject
(
'最大不能超过99999999'
);
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
placeholder=
{
'请输入消耗积分'
}
maxLength=
{
25
}
allowClear
type=
{
'number'
}
/>
</
Form
.
Item
>
</
Form
>
</
Modal
>
);
};
export
default
AddEditModalView
;
src/pages/activityManage/pointExchangeGoods/index.tsx
0 → 100644
浏览文件 @
0424dfc9
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
,
message
,
Modal
,
Table
,
Image
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
AddEditModalView
from
'./comp/addEditModal'
;
import
{
InterListType
,
InterReqListType
}
from
'~/api/interface'
;
import
{
getMallListType
}
from
'~/api/interface/activityManage'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
// 表格列表
type
TableType
=
InterListType
<
getMallListType
>
;
// 搜索表单的类型
type
ReqType
=
InterReqListType
<
getMallListType
>
;
// 搜索表单的数据
let
query
:
ReqType
=
{};
const
PointExchangeGoodsPage
:
React
.
FC
=
()
=>
{
// 新增编辑弹窗是否开启
const
[
addEditShow
,
setAddEditShow
]
=
useState
<
boolean
>
(
false
);
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 需要编辑的数据
const
[
recordData
,
setRecordData
]
=
useState
<
TableType
[
0
]
>
();
// 表格分页配置
const
[
pagination
,
setPagination
]
=
useState
({
total
:
0
,
pageSize
:
10
,
current
:
1
,
totalPage
:
0
,
});
// +++++++++++++++++++++++++++++++++++++++++++++++++++ //
// 新版通用部分(ES6+ for React) ZhangLK 2022/08/30 Start
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
const
res
=
await
ActivityManageAPI
.
getMallList
({
pageNo
:
pagination
.
current
,
pageSize
:
pagination
.
pageSize
,
...
value
,
...
query
,
});
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
();
};
// 表单提交
const
onFinish
=
(
data
:
ReqType
)
=>
{
pagination
.
current
=
1
;
query
=
data
;
getTableList
(
data
).
then
();
};
// +++++++++++++++++++++++++++++++++++++++++++++++++++ //
// 删除数据
const
handleDelete
=
(
record
:
TableType
[
0
])
=>
{
Modal
.
confirm
({
title
:
'提示'
,
content
:
'删除后将无法恢复,请确认是否删除?'
,
onOk
:
async
()
=>
{
const
res
=
await
ActivityManageAPI
.
deleteMall
({
id
:
record
?.
id
});
if
(
res
&&
res
.
code
===
'200'
)
{
paginationChange
(
tableData
.
length
===
1
&&
pagination
.
current
!==
1
?
pagination
.
current
-
1
:
pagination
.
current
,
pagination
.
pageSize
,
);
message
.
success
(
'删除成功'
);
}
},
});
};
// 转换商品图片数据
const
getGoodsUrl
=
(
record
:
TableType
[
0
])
=>
{
try
{
const
image
=
(
JSON
.
parse
(
record
.
goodsUrl
||
`[]`
)
||
[])?.[
0
];
return
<
Image
src=
{
image
}
alt=
{
record
.
goods
}
width=
{
35
}
height=
{
35
}
></
Image
>;
}
catch
(
e
)
{
return
`无`
;
}
};
// 页面挂载
useEffect
(()
=>
{
query
=
{};
(
async
()
=>
{
await
getTableList
();
})();
},
[]);
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
title
:
'序号'
,
dataIndex
:
'accountNo'
,
align
:
'center'
,
width
:
'50px'
,
render
:
(
_text
,
_record
,
index
)
=>
(
pagination
.
current
-
1
)
*
pagination
.
pageSize
+
index
+
1
,
},
{
title
:
'商品名称'
,
dataIndex
:
'goods'
,
align
:
'center'
,
},
{
title
:
'商品图片'
,
dataIndex
:
'goodsUrl'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
getGoodsUrl
(
record
),
},
{
title
:
'消耗积分'
,
dataIndex
:
'needPoints'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'id'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
(
<>
<
Button
type=
{
'link'
}
onClick=
{
()
=>
{
setAddEditShow
(
true
);
setRecordData
(
record
);
}
}
>
编辑
</
Button
>
<
Button
type=
{
'link'
}
danger
onClick=
{
()
=>
handleDelete
(
record
)
}
>
删除
</
Button
>
</>
),
},
];
return
(
<>
<
SearchBox
child=
{
<
Button
type=
{
'primary'
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
setAddEditShow
(
true
)
}
>
添加商品
</
Button
>
}
search=
{
[
{
label
:
'商品名称'
,
name
:
'name'
,
type
:
'Input'
,
placeholder
:
'请输入商品名称'
,
maxlength
:
20
,
},
]
}
searchData=
{
onFinish
}
/>
<
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} 条数据`
,
}
}
/>
<
AddEditModalView
open=
{
addEditShow
}
title=
{
recordData
?.
id
?
'编辑商品'
:
'添加商品'
}
data=
{
recordData
}
onCancel=
{
()
=>
{
setAddEditShow
(
false
);
setRecordData
(
undefined
);
paginationChange
(
pagination
?.
current
,
pagination
?.
pageSize
);
}
}
/>
</>
);
};
export
default
PointExchangeGoodsPage
;
src/pages/activityManage/pointExchangeList/comp/addEditModal/index.tsx
0 → 100644
浏览文件 @
0424dfc9
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Input
,
message
,
Modal
,
ModalProps
,
Select
}
from
'antd'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
mallOrderListType
,
updateGoodsOrderType
}
from
'~/api/interface/activityManage'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
// 详情类型
type
DetailType
=
InterListType
<
mallOrderListType
>
[
0
];
// 请求数据
type
ReqType
=
InterReqType
<
updateGoodsOrderType
>
;
const
AddEditModalView
:
React
.
FC
<
ModalProps
&
{
onCancel
:
()
=>
void
;
data
?:
DetailType
}
>
=
({
open
,
title
,
onCancel
,
data
,
})
=>
{
// 店铺图片列表
const
[
imageList
,
setImageList
]
=
useState
<
any
>
([]);
// 表单数据
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 关闭弹窗
const
handleCancel
=
()
=>
{
onCancel
?.();
};
// 快递列表
const
[
kdnDicList
,
setKdnDicList
]
=
useState
<
{
label
:
string
;
value
:
string
;
}[]
>
([]);
// 获取快递字典
const
getKdnDicList
=
async
()
=>
{
const
res
=
await
ActivityManageAPI
.
listKdnDic
();
if
(
res
&&
res
.
code
===
'200'
)
{
setKdnDicList
((
res
.
result
||
[])?.
map
((
i
)
=>
({
label
:
i
?.
exName
,
value
:
i
?.
exCode
})));
// console.log('获取快递字典 --->', res.result);
}
};
// 确定事件
const
handleOk
=
()
=>
{
form
.
validateFields
()
.
then
(
async
(
values
)
=>
{
await
handleSubmit
(
values
);
})
.
catch
((
err
)
=>
{
message
.
warning
({
content
:
err
.
errorFields
[
0
].
errors
[
0
],
})
.
then
();
});
};
// 提交数据
const
handleSubmit
=
async
(
values
:
ReqType
)
=>
{
const
res
=
await
ActivityManageAPI
.
updateGoodsOrder
({
...
data
,
...
values
,
sendStatus
:
1
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
'发货成功'
);
handleCancel
();
}
};
// 组件挂载
useEffect
(()
=>
{
getKdnDicList
().
then
();
if
(
!
open
)
return
;
form
.
setFieldsValue
(
data
);
try
{
setImageList
(
(
JSON
.
parse
(
data
?.
goodsUrl
||
`[]`
)
||
[])?.
map
((
i
:
{
url
:
string
},
j
:
number
)
=>
({
id
:
j
,
url
:
i
,
})),
);
}
catch
(
e
)
{
setImageList
([]);
}
},
[
open
]);
return
(
<
Modal
open=
{
open
}
title=
{
title
}
onCancel=
{
handleCancel
}
onOk=
{
handleOk
}
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
14
}
}
>
<
Form
.
Item
label=
'商品名称'
name=
'goods'
rules=
{
[{
required
:
true
,
message
:
'请输入商品名称'
}]
}
>
<
Input
placeholder=
{
'请输入商品名称'
}
maxLength=
{
25
}
allowClear
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品图片'
name=
'goodsUrl'
rules=
{
[{
required
:
true
,
message
:
'请上传商品图片'
}]
}
>
<
Uploader
fileUpload
listType=
'picture-card'
defaultFileList=
{
imageList
}
disabled=
{
true
}
fileLength=
{
1
}
fileSize=
{
10
}
>
<
UploadOutlined
/>
</
Uploader
>
</
Form
.
Item
>
<
Form
.
Item
label=
'消耗积分'
name=
'needPoints'
rules=
{
[
{
required
:
true
,
message
:
'请输入消耗积分'
},
{
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'请输入正整数'
},
{
validator
:
(
_rule
,
value
)
=>
{
if
(
value
>
99999999
)
{
return
Promise
.
reject
(
'最大不能超过99999999'
);
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
placeholder=
{
'请输入消耗积分'
}
maxLength=
{
25
}
allowClear
type=
{
'number'
}
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'快递公司'
name=
'trackintCompany'
rules=
{
[{
required
:
true
,
message
:
'请选择快递公司'
}]
}
>
<
Select
placeholder=
{
'请输入商品名称'
}
options=
{
kdnDicList
}
allowClear
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'快递单号'
name=
'trackingNumber'
rules=
{
[{
required
:
true
,
message
:
'请输入快递单号'
}]
}
>
<
Input
placeholder=
{
'请输入快递单号'
}
maxLength=
{
25
}
allowClear
/>
</
Form
.
Item
>
</
Form
>
</
Modal
>
);
};
export
default
AddEditModalView
;
src/pages/activityManage/pointExchangeList/index.tsx
0 → 100644
浏览文件 @
0424dfc9
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
,
message
,
Table
}
from
'antd'
;
import
{
ActivityManageAPI
}
from
'~/api'
;
import
{
mallOrderListType
}
from
'~/api/interface/activityManage'
;
import
{
InterListType
,
InterReqListType
}
from
'~/api/interface'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
AddEditModalView
from
'./comp/addEditModal/index'
;
// 表格列表
type
TableType
=
InterListType
<
mallOrderListType
>
;
// 搜索表单的类型
type
ReqType
=
InterReqListType
<
mallOrderListType
>
;
// 搜索表单的数据
let
query
:
ReqType
=
{};
const
PointExchangeListPage
:
React
.
FC
=
()
=>
{
// 新增编辑弹窗是否开启
const
[
addEditShow
,
setAddEditShow
]
=
useState
<
boolean
>
(
false
);
// 需要编辑的数据
const
[
recordData
,
setRecordData
]
=
useState
<
TableType
[
0
]
>
();
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 表格分页配置
const
[
pagination
,
setPagination
]
=
useState
({
total
:
0
,
pageSize
:
10
,
current
:
1
,
totalPage
:
0
,
});
// +++++++++++++++++++++++++++++++++++++++++++++++++++ //
// 新版通用部分(ES6+ for React) ZhangLK 2022/08/30 Start
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
const
res
=
await
ActivityManageAPI
.
mallOrderList
({
pageNo
:
pagination
.
current
,
pageSize
:
pagination
.
pageSize
,
...
value
,
...
query
,
isAdmin
:
1
,
});
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
();
};
// 表单提交
const
onFinish
=
(
data
:
ReqType
)
=>
{
pagination
.
current
=
1
;
query
=
data
;
getTableList
(
data
).
then
();
};
// +++++++++++++++++++++++++++++++++++++++++++++++++++ //
// 页面挂载
useEffect
(()
=>
{
query
=
{};
(
async
()
=>
{
await
getTableList
();
})();
},
[]);
// 表格列配置
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
title
:
'兑换商品'
,
dataIndex
:
'goods'
,
align
:
'center'
,
width
:
'150px'
,
ellipsis
:
true
,
},
{
title
:
'收货姓名'
,
dataIndex
:
'userName'
,
align
:
'center'
,
},
{
title
:
'收货电话'
,
dataIndex
:
'userPhone'
,
align
:
'center'
,
},
{
title
:
'收货地址'
,
dataIndex
:
'address'
,
align
:
'center'
,
width
:
'200px'
,
ellipsis
:
true
,
},
{
title
:
'是否发货'
,
dataIndex
:
'sendStatus'
,
align
:
'center'
,
render
:
(
text
)
=>
(
text
!==
1
?
'未发货'
:
'已发货'
),
},
{
title
:
'下单时间'
,
dataIndex
:
'createTime'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'id'
,
align
:
'center'
,
render
:
(
_text
,
record
)
=>
(
<>
<
Button
type=
'link'
disabled=
{
record
.
sendStatus
===
1
}
onClick=
{
()
=>
{
setRecordData
(
record
);
setAddEditShow
(
true
);
}
}
>
发货
</
Button
>
</>
),
},
];
return
(
<>
<
SearchBox
search=
{
[
{
label
:
'收货姓名'
,
name
:
'userName'
,
type
:
'Input'
,
placeholder
:
'请输入收货姓名'
,
maxlength
:
20
,
},
{
label
:
'收货人电话'
,
name
:
'userPhone'
,
type
:
'Input'
,
placeholder
:
'请输入收货人电话'
,
maxlength
:
20
,
},
]
}
isSearch=
{
true
}
isReset=
{
true
}
searchData=
{
onFinish
}
/>
<
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} 条数据`
,
}
}
/>
<
AddEditModalView
open=
{
addEditShow
}
title=
{
'发货'
}
data=
{
recordData
}
onCancel=
{
()
=>
{
setAddEditShow
(
false
);
setRecordData
(
undefined
);
paginationChange
(
pagination
?.
current
,
pagination
?.
pageSize
);
}
}
/>
</>
);
};
export
default
PointExchangeListPage
;
src/pages/resourceManage/storeDecorate/comp/addSolutionModal/index.tsx
浏览文件 @
0424dfc9
...
...
@@ -16,7 +16,7 @@ type DataType = InterDataType<getSuggestionType>[0];
const
AddSolutionModal
:
React
.
FC
<
ModalProps
&
{
detail
:
DetailType
;
onCancel
?:
()
=>
void
;
data
?:
DataType
}
>
=
({
open
,
onCancel
,
data
})
=>
{
>
=
({
open
,
title
,
onCancel
,
data
})
=>
{
// 表单数据
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 封面图列表
...
...
@@ -75,7 +75,7 @@ const AddSolutionModal: React.FC<
setSuggestFileList
([{
url
:
data
.
suggestFile
}]);
},
[
data
]);
return
(
<
Modal
open=
{
open
}
title=
{
'添加方案'
}
width=
{
450
}
onCancel=
{
handleCancel
}
onOk=
{
handleOk
}
>
<
Modal
open=
{
open
}
title=
{
title
}
width=
{
450
}
onCancel=
{
handleCancel
}
onOk=
{
handleOk
}
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'方案标题'
...
...
src/pages/resourceManage/storeDecorate/comp/storeSolutionView/index.tsx
浏览文件 @
0424dfc9
...
...
@@ -125,6 +125,7 @@ const StoreSolutionView: React.FC<{
open=
{
isAddSolution
}
detail=
{
detail
}
data=
{
editData
}
title=
{
editData
?.
id
?
'编辑方案'
:
'添加方案'
}
onCancel=
{
()
=>
{
setIsAddSolution
(
false
);
setEditData
(
undefined
);
...
...
src/router/router.tsx
浏览文件 @
0424dfc9
...
...
@@ -37,6 +37,8 @@ import {
UsergroupAddOutlined
,
ContactsOutlined
,
CommentOutlined
,
DropboxOutlined
,
OrderedListOutlined
,
}
from
'@ant-design/icons'
;
import
{
Spin
}
from
'antd'
;
...
...
@@ -174,6 +176,8 @@ import CourseCategoryView from '~/pages/pilotTraining/courseCategory';
import
NoticeManageView
from
'~/pages/resourceManage/noticeManage'
;
import
CustomApplyPage
from
'~/pages/customManage/customApply'
;
import
StoreDecoratePage
from
'~/pages/resourceManage/storeDecorate'
;
import
PointExchangeGoodsPage
from
'~/pages/activityManage/pointExchangeGoods'
;
import
PointExchangeListPage
from
'~/pages/activityManage/pointExchangeList'
;
const
AddressManageView
=
React
.
lazy
(()
=>
import
(
'~/pages/systemManage/addressManage'
));
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
...
...
@@ -1049,6 +1053,26 @@ export const routerList: Array<RouteObjectType> = [
pid
:
920
,
},
},
{
path
:
'/activityManage/pointExchangeGoods'
,
element
:
withLoadingComponent
(<
PointExchangeGoodsPage
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
930
,
title
:
'兑换商品'
,
icon
:
<
DropboxOutlined
/>,
},
},
{
path
:
'/activityManage/pointExchangeList'
,
element
:
withLoadingComponent
(<
PointExchangeListPage
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
940
,
title
:
'兑换记录'
,
icon
:
<
OrderedListOutlined
/>,
},
},
],
},
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论