Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sass-admin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj_app
sass-admin
Commits
eeb6ce4b
Commit
eeb6ce4b
authored
Oct 22, 2025
by
chengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分商城
parent
81b76cfc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
164 additions
and
22 deletions
+164
-22
src/pages/SystemManagement/Point/ActiveOption.jsx
+4
-1
src/pages/SystemManagement/Point/CurrencyOption.jsx
+102
-21
src/pages/SystemManagement/Point/ModalForm.jsx
+27
-0
src/pages/SystemManagement/Point/redux/action.js
+17
-0
src/pages/SystemManagement/Point/redux/api.js
+9
-0
src/pages/SystemManagement/Point/redux/reducer.js
+5
-0
No files found.
src/pages/SystemManagement/Point/ActiveOption.jsx
View file @
eeb6ce4b
...
@@ -80,7 +80,6 @@ class ActiveOption extends React.Component {
...
@@ -80,7 +80,6 @@ class ActiveOption extends React.Component {
const
{
current
,
pageSize
,
record
,
type
,
activityName
}
=
this
.
state
;
const
{
current
,
pageSize
,
record
,
type
,
activityName
}
=
this
.
state
;
const
form
=
this
.
formRef
.
props
.
form
;
const
form
=
this
.
formRef
.
props
.
form
;
form
.
validateFields
((
err
,
values
)
=>
{
form
.
validateFields
((
err
,
values
)
=>
{
console
.
log
(
values
,
record
,
'values'
);
if
(
err
)
{
if
(
err
)
{
return
;
return
;
}
}
...
@@ -91,6 +90,8 @@ class ActiveOption extends React.Component {
...
@@ -91,6 +90,8 @@ class ActiveOption extends React.Component {
id
:
record
.
id
,
id
:
record
.
id
,
productImg
:
values
.
productImg
,
productImg
:
values
.
productImg
,
productName
:
values
.
productName
,
productName
:
values
.
productName
,
startTime
:
values
.
effectiveTime
[
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
endTime
:
values
.
effectiveTime
[
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
point
:
values
.
point
,
point
:
values
.
point
,
},
},
''
,
''
,
...
@@ -106,6 +107,8 @@ class ActiveOption extends React.Component {
...
@@ -106,6 +107,8 @@ class ActiveOption extends React.Component {
{
{
productImg
:
values
.
productImg
,
productImg
:
values
.
productImg
,
productName
:
values
.
productName
,
productName
:
values
.
productName
,
startTime
:
values
.
effectiveTime
[
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
endTime
:
values
.
effectiveTime
[
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
),
point
:
values
.
point
,
point
:
values
.
point
,
},
},
{
pageNo
:
current
,
pageSize
:
pageSize
},
{
pageNo
:
current
,
pageSize
:
pageSize
},
...
...
src/pages/SystemManagement/Point/CurrencyOption.jsx
View file @
eeb6ce4b
import
React
from
"react"
;
import
React
from
"react"
;
import
{
Input
,
Button
,
Table
,
Modal
,
message
,
Pagination
}
from
"antd"
;
import
{
Input
,
Button
,
Table
,
Modal
,
message
,
Pagination
,
Tabs
}
from
"antd"
;
import
{
connect
}
from
"react-redux"
;
import
{
connect
}
from
"react-redux"
;
import
Breadcrumb
from
"@/common/Breadcrumb"
;
import
Breadcrumb
from
"@/common/Breadcrumb"
;
import
moment
from
"moment"
;
import
{
import
{
postUserList
,
postUserList
,
postPointExchange
,
postPointExchange
,
postPointExchangeApprovalList
,
}
from
"./redux/action"
;
}
from
"./redux/action"
;
const
Search
=
Input
.
Search
;
const
Search
=
Input
.
Search
;
const
TabPane
=
Tabs
.
TabPane
;
class
CurrencyOption
extends
React
.
Component
{
class
CurrencyOption
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -20,19 +23,27 @@ class CurrencyOption extends React.Component {
...
@@ -20,19 +23,27 @@ class CurrencyOption extends React.Component {
exchangeModalVisible
:
false
,
exchangeModalVisible
:
false
,
selectedUser
:
null
,
selectedUser
:
null
,
deductPoints
:
0
,
deductPoints
:
0
,
loading
:
false
loading
:
false
,
key
:
1
,
};
};
this
.
callback
=
this
.
callback
.
bind
(
this
);
}
}
componentDidMount
()
{
componentDidMount
()
{
// 加载用户列表数据
// 加载用户列表数据
this
.
props
.
postUserList
({
name
:
""
,
pageNo
:
1
,
pageSize
:
20
});
this
.
props
.
postUserList
({
name
:
""
,
pageNo
:
1
,
pageSize
:
10
});
// 加载申请列表数据
this
.
props
.
postPointExchangeApprovalList
({
learnType
:
"point_exchange"
,
pageNo
:
1
,
pageSize
:
10
});
}
}
// 搜索处理
// 搜索处理
handleSearch
=
(
value
)
=>
{
handleSearch
=
(
value
)
=>
{
this
.
props
.
postUserList
({
name
:
value
,
pageNo
:
1
,
pageSize
:
20
});
this
.
props
.
postUserList
({
name
:
value
,
pageNo
:
1
,
pageSize
:
10
});
}
callback
(
key
)
{
this
.
setState
({
key
:
key
-
0
,
});
}
}
// 显示兑换弹窗
// 显示兑换弹窗
showExchangeModal
=
(
user
)
=>
{
showExchangeModal
=
(
user
)
=>
{
this
.
setState
({
this
.
setState
({
...
@@ -73,7 +84,7 @@ class CurrencyOption extends React.Component {
...
@@ -73,7 +84,7 @@ class CurrencyOption extends React.Component {
this
.
props
.
postUserList
({
name
:
this
.
state
.
searchValue
,
pageNo
:
this
.
state
.
currentPage
,
pageSize
:
this
.
state
.
pageSize
});
this
.
props
.
postUserList
({
name
:
this
.
state
.
searchValue
,
pageNo
:
this
.
state
.
currentPage
,
pageSize
:
this
.
state
.
pageSize
});
}
}
render
()
{
render
()
{
const
{
exchangeList
,
postUserList
}
=
this
.
props
;
const
{
exchangeList
,
exchangeApprovalList
,
postUserList
}
=
this
.
props
;
// 表格列配置
// 表格列配置
const
columns
=
[
const
columns
=
[
{
{
...
@@ -94,19 +105,19 @@ class CurrencyOption extends React.Component {
...
@@ -94,19 +105,19 @@ class CurrencyOption extends React.Component {
key
:
"totalPoint"
,
key
:
"totalPoint"
,
render
:
(
text
)
=>
<
span
style=
{
{
color
:
'#1890ff'
,
fontWeight
:
'bold'
}
}
>
{
text
}
</
span
>,
render
:
(
text
)
=>
<
span
style=
{
{
color
:
'#1890ff'
,
fontWeight
:
'bold'
}
}
>
{
text
}
</
span
>,
},
},
{
//
{
title
:
"操作"
,
//
title: "操作",
key
:
"action"
,
//
key: "action",
render
:
(
text
,
record
)
=>
(
//
render: (text, record) => (
<
Button
//
<Button
type=
"primary"
//
type="primary"
size=
"small"
//
size="small"
onClick=
{
()
=>
this
.
showExchangeModal
(
record
)
}
//
onClick={() => this.showExchangeModal(record)}
>
//
>
兑换
//
兑换
</
Button
>
//
</Button>
),
//
),
},
//
},
];
];
const
pagination
=
{
const
pagination
=
{
showQuickJumper
:
true
,
showQuickJumper
:
true
,
...
@@ -123,7 +134,57 @@ class CurrencyOption extends React.Component {
...
@@ -123,7 +134,57 @@ class CurrencyOption extends React.Component {
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
},
};
};
const
columns1
=
[
{
title
:
"用户名"
,
dataIndex
:
"name"
,
key
:
"name"
,
},
{
title
:
"姓名"
,
dataIndex
:
"accountName"
,
key
:
"accountName"
,
},
{
title
:
"兑换商品"
,
dataIndex
:
"learnName"
,
key
:
"learnName"
,
render
:
(
text
)
=>
<
span
>
{
text
?
text
.
split
(
':'
).
pop
()
:
''
}
</
span
>,
},
{
title
:
"兑换时间"
,
dataIndex
:
"time"
,
key
:
"time"
,
render
:
(
text
)
=>
<
span
>
{
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
span
>,
},
{
title
:
"扣除积分"
,
dataIndex
:
"point"
,
key
:
"point"
,
ellipsis
:
true
,
},
{
title
:
"积分余额"
,
dataIndex
:
"changeAfter"
,
key
:
"changeAfter"
,
render
:
(
text
)
=>
<
span
style=
{
{
color
:
'#1890ff'
,
fontWeight
:
'bold'
}
}
>
{
text
}
</
span
>,
},
];
const
pagination1
=
{
showQuickJumper
:
true
,
showSizeChanger
:
true
,
total
:
exchangeApprovalList
&&
exchangeApprovalList
.
total
,
showTotal
:
total
=>
`共
${
exchangeApprovalList
.
total
}
条`
,
pageSize
:
exchangeApprovalList
&&
exchangeApprovalList
.
size
,
onShowSizeChange
(
current
,
pageSize
)
{
postPointExchangeApprovalList
({
pageNo
:
current
,
pageSize
:
pageSize
});
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
onChange
(
current
,
pageSize
)
{
postPointExchangeApprovalList
({
pageNo
:
current
,
pageSize
:
pageSize
});
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
};
return
(
return
(
<
div
>
<
div
>
<
Breadcrumb
title=
"积分兑换"
/>
<
Breadcrumb
title=
"积分兑换"
/>
...
@@ -138,13 +199,28 @@ class CurrencyOption extends React.Component {
...
@@ -138,13 +199,28 @@ class CurrencyOption extends React.Component {
enterButton
enterButton
/>
/>
</
div
>
</
div
>
<
Tabs
activeKey=
{
this
.
state
.
key
.
toString
()
}
onChange=
{
this
.
callback
}
>
<
TabPane
tab=
"用户列表"
key=
"1"
>
<
Table
<
Table
columns=
{
columns
}
columns=
{
columns
}
dataSource=
{
exchangeList
&&
exchangeList
.
records
}
dataSource=
{
exchangeList
&&
exchangeList
.
records
}
rowKey=
{
record
=>
record
.
userId
}
rowKey=
{
record
=>
record
.
userId
}
pagination=
{
pagination
}
pagination=
{
pagination
}
/>
/>
</
TabPane
>
<
TabPane
tab=
"申请列表"
key=
"2"
>
<
Table
columns=
{
columns1
}
dataSource=
{
exchangeApprovalList
&&
exchangeApprovalList
.
records
}
rowKey=
{
record
=>
record
.
id
}
pagination=
{
pagination1
}
/>
</
TabPane
>
</
Tabs
>
</
div
>
</
div
>
{
/* 兑换弹窗 */
}
{
/* 兑换弹窗 */
}
...
@@ -180,13 +256,17 @@ class CurrencyOption extends React.Component {
...
@@ -180,13 +256,17 @@ class CurrencyOption extends React.Component {
function
mapStateToProps
(
state
,
ownProps
)
{
function
mapStateToProps
(
state
,
ownProps
)
{
return
{
return
{
exchangeList
:
state
.
point
.
exchangeList
,
exchangeList
:
state
.
point
.
exchangeList
,
exchangeApprovalList
:
state
.
point
.
exchangeApprovalList
,
param
:
state
.
uploadParam
.
param
,
param
:
state
.
uploadParam
.
param
,
};
};
}
}
function
mapDispatchToProps
(
dispatch
)
{
function
mapDispatchToProps
(
dispatch
)
{
return
{
return
{
postUserList
:
obj
=>
dispatch
(
postUserList
(
obj
)),
postUserList
:
obj
=>
dispatch
(
postUserList
(
obj
)),
//兑换列表
postPointExchange
:
obj
=>
dispatch
(
postPointExchange
(
obj
)),
postPointExchange
:
obj
=>
dispatch
(
postPointExchange
(
obj
)),
//申请列表
postPointExchangeApprovalList
:
obj
=>
dispatch
(
postPointExchangeApprovalList
(
obj
)),
};
};
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
CurrencyOption
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
CurrencyOption
);
\ No newline at end of file
src/pages/SystemManagement/Point/ModalForm.jsx
View file @
eeb6ce4b
...
@@ -57,6 +57,16 @@ class activModalForm extends React.Component {
...
@@ -57,6 +57,16 @@ class activModalForm extends React.Component {
sm
:
{
span
:
18
},
sm
:
{
span
:
18
},
},
},
};
};
let
timeLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
8
},
},
};
return
(
return
(
<
Modal
<
Modal
visible=
{
visible
}
visible=
{
visible
}
...
@@ -102,6 +112,23 @@ class activModalForm extends React.Component {
...
@@ -102,6 +112,23 @@ class activModalForm extends React.Component {
/>
/>
)
}
)
}
</
FormItem
>
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"生效时间"
>
{
getFieldDecorator
(
"effectiveTime"
,
{
initialValue
:
record
&&
record
.
startTime
&&
record
.
endTime
?
[
moment
(
record
.
startTime
),
moment
(
record
.
endTime
)]
:
undefined
,
rules
:
[
{
required
:
true
,
message
:
"请选择生效时间"
},
],
})(
<
RangePicker
showTime=
{
{
format
:
'HH:mm'
}
}
format=
"YYYY-MM-DD HH:mm"
placeholder=
{
[
'开始时间'
,
'结束时间'
]
}
disabled=
{
type
==
"look"
?
true
:
false
}
style=
{
{
width
:
'100%'
}
}
/>
)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"所需积分"
>
<
FormItem
{
...
formItemLayout
}
label=
"所需积分"
>
{
getFieldDecorator
(
"point"
,
{
{
getFieldDecorator
(
"point"
,
{
initialValue
:
record
&&
record
.
point
,
initialValue
:
record
&&
record
.
point
,
...
...
src/pages/SystemManagement/Point/redux/action.js
View file @
eeb6ce4b
...
@@ -4,6 +4,7 @@ import { message } from "antd";
...
@@ -4,6 +4,7 @@ import { message } from "antd";
export
const
POINT_SET
=
"POINT_SET"
;
export
const
POINT_SET
=
"POINT_SET"
;
export
const
POINT_TABLE
=
"POINT_TABLE"
;
export
const
POINT_TABLE
=
"POINT_TABLE"
;
export
const
POINT_EXCHANGE
=
"POINT_EXCHANGE"
;
export
const
POINT_EXCHANGE
=
"POINT_EXCHANGE"
;
export
const
POINT_EXCHANGE_APPROVAL
=
"POINT_EXCHANGE_APPROVAL"
;
export
const
POINT_DETAILED
=
"POINT_DETAILED"
;
export
const
POINT_DETAILED
=
"POINT_DETAILED"
;
// 兑换
// 兑换
...
@@ -37,6 +38,8 @@ const {
...
@@ -37,6 +38,8 @@ const {
//兑换列表
//兑换列表
postUserListApi
,
postUserListApi
,
postPointExchangeApi
,
postPointExchangeApi
,
//申请列表
postPointExchangeApprovalListApi
,
}
=
api
;
}
=
api
;
//积分通用设置
//积分通用设置
...
@@ -382,6 +385,20 @@ export function postUserList(data, callback) {
...
@@ -382,6 +385,20 @@ export function postUserList(data, callback) {
});
});
};
};
}
}
//获取申请列表
export
function
postPointExchangeApprovalList
(
data
,
callback
)
{
return
dispatch
=>
{
return
request
({
url
:
postPointExchangeApprovalListApi
,
data
:
data
,
}).
then
(
res
=>
{
dispatch
({
type
:
POINT_EXCHANGE_APPROVAL
,
data
:
res
.
data
,
});
});
};
}
// 积分兑换
// 积分兑换
export
function
postPointExchange
(
data
,
callback
)
{
export
function
postPointExchange
(
data
,
callback
)
{
return
dispatch
=>
{
return
dispatch
=>
{
...
...
src/pages/SystemManagement/Point/redux/api.js
View file @
eeb6ce4b
...
@@ -28,6 +28,15 @@ export default {
...
@@ -28,6 +28,15 @@ export default {
// {"userId":1314, "point": 2}
// {"userId":1314, "point": 2}
postUserListApi
:
`POST
${
services
.
webManage
}
/point/user/list`
,
postUserListApi
:
`POST
${
services
.
webManage
}
/point/user/list`
,
postPointExchangeApi
:
`POST
${
services
.
webManage
}
/point/user/exchange`
,
postPointExchangeApi
:
`POST
${
services
.
webManage
}
/point/user/exchange`
,
//申请列表
// manage/point/details/list
// 入参:{
// "learnType":"point_exchange",
// "pageNo":1,
// "pageSize":10
// }
postPointExchangeApprovalListApi
:
`POST
${
services
.
webManage
}
/point/details/list`
,
postPointExchangeApprovalApi
:
`POST
${
services
.
webManage
}
/point/user/exchange/approval`
,
getExchangeSwitchApi
:
`GET
${
services
.
webMall
}
/student/token/config/switch`
,
getExchangeSwitchApi
:
`GET
${
services
.
webMall
}
/student/token/config/switch`
,
getExchangeRuleApi
:
`GET
${
services
.
webMall
}
/manage/tokenExchangeRule/get`
,
getExchangeRuleApi
:
`GET
${
services
.
webMall
}
/manage/tokenExchangeRule/get`
,
saveExchangeRuleApi
:
`POST
${
services
.
webMall
}
/manage/tokenExchangeRule/save`
,
saveExchangeRuleApi
:
`POST
${
services
.
webMall
}
/manage/tokenExchangeRule/save`
,
...
...
src/pages/SystemManagement/Point/redux/reducer.js
View file @
eeb6ce4b
...
@@ -39,6 +39,11 @@ function point(state = initialState, action) {
...
@@ -39,6 +39,11 @@ function point(state = initialState, action) {
return
Object
.
assign
({},
state
,
{
return
Object
.
assign
({},
state
,
{
exchangeList
:
action
.
data
,
exchangeList
:
action
.
data
,
});
});
//申请列表
case
"POINT_EXCHANGE_APPROVAL"
:
return
Object
.
assign
({},
state
,
{
exchangeApprovalList
:
action
.
data
,
});
//积分流水明细
//积分流水明细
case
"POINT_DETAILED"
:
case
"POINT_DETAILED"
:
return
Object
.
assign
({},
state
,
{
return
Object
.
assign
({},
state
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment