Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
biz.qingxiao.com
Commits
6c9749d1
Commit
6c9749d1
authored
Sep 02, 2019
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分
parent
91885b91
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1429 additions
and
56 deletions
+1429
-56
api.js
src/common/api.js
+4
-0
integral.js
src/models/integral.js
+270
-10
uploader.js
src/models/uploader.js
+7
-0
webapp.js
src/models/webapp.js
+5
-0
index.js
src/pages/integralmanage/index.js
+152
-12
index.js
src/pages/integralmanage/integralsetting/index.js
+126
-27
index.less
src/pages/integralmanage/integralsetting/index.less
+9
-0
index.js
src/pages/integralmanage/operationlog/index.js
+100
-0
index.less
src/pages/integralmanage/operationlog/index.less
+10
-0
CouponAddModal.js
src/pages/integralmanage/storesetting/CouponAddModal.js
+185
-0
CouponAddModal.less
src/pages/integralmanage/storesetting/CouponAddModal.less
+51
-0
GoodsAddModal.js
src/pages/integralmanage/storesetting/GoodsAddModal.js
+202
-0
GoodsAddModal.less
src/pages/integralmanage/storesetting/GoodsAddModal.less
+72
-0
index.js
src/pages/integralmanage/storesetting/index.js
+203
-7
integral.js
src/services/integral.js
+33
-0
No files found.
src/common/api.js
View file @
6c9749d1
...
...
@@ -144,6 +144,10 @@ export default {
integralsetting
:
{
goodsList
:
`
${
dakaapi
}
member/integral_goods`
,
goodsDelete
:
`
${
dakaapi
}
member/integral_goods/good_status`
,
scoreSave
:
`
${
dakaapi
}
member/integral/distribution`
,
// 积分配置
goodsAdd
:
`
${
dakaapi
}
member/integral_goods/store`
,
goodsEdit
:
`
${
dakaapi
}
member/integral_goods/update`
,
journalList
:
`
${
dakaapi
}
member/integral/records`
,
},
};
src/models/integral.js
View file @
6c9749d1
...
...
@@ -8,12 +8,36 @@ import {
}
from
'../utils/index'
;
import
errorcode
from
'../common/errorcode'
;
import
*
as
goodsAjax
from
'../services/integral'
;
import
*
as
studentsAjax
from
'../services/students'
;
import
*
as
courseAjax
from
'../services/course'
;
import
*
as
teachersAjax
from
'../services/teachers'
;
import
*
as
classMgtAjax
from
'../services/classmgt'
;
export
default
{
namespace
:
'integral'
,
state
:
{
goodsList
:
[],
sid
:
0
,
allStudentList
:
[],
editScoreVisible
:
false
,
editCouponModalShow
:
false
,
editGoodsModalShow
:
false
,
recordList
:
[],
recordListTotal
:
0
,
couponImg
:
''
,
editCouponInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
editGoodsInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
...
...
@@ -22,25 +46,195 @@ export default {
effects
:
{
*
integralModelList
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
console
.
log
(
sid
,
'dsa'
);
const
loadmessage
=
message
.
loading
(
'数据加载中...'
,
0
);
const
course
listinfo
=
yield
call
(
goodsAjax
.
goodsList
,
{
const
goods
listinfo
=
yield
call
(
goodsAjax
.
goodsList
,
{
school_id
:
sid
,
});
setTimeout
(
loadmessage
);
if
(
course
listinfo
.
code
==
200
)
{
if
(
goods
listinfo
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
sid
,
goodsList
:
courselistinfo
.
data
&&
course
listinfo
.
data
.
list
,
goodsList
:
goodslistinfo
.
data
&&
goods
listinfo
.
data
.
list
,
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
courselistinfo
,
data
:
goodslistinfo
,
},
});
}
},
*
integralModelScoreSave
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
courseSubmiting
}
=
yield
select
(
state
=>
state
.
integral
);
if
(
courseSubmiting
)
{
return
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
courseSubmiting
:
true
,
},
});
const
{
student_ids
,
number
,
remark
,
}
=
payload
;
if
(
!
sid
)
{
return
;
}
const
loadmessage
=
message
.
loading
(
'数据保存中...'
,
0
);
const
scoreAdd
=
yield
call
(
goodsAjax
.
scoreSave
,
{
school_id
:
sid
,
student_ids
,
number
,
remark
,
});
yield
put
({
type
:
'updateState'
,
payload
:
{
courseSubmiting
:
false
,
},
});
setTimeout
(
loadmessage
);
if
(
scoreAdd
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
editScoreVisible
:
false
,
},
});
}
else
if
(
scoreAdd
.
code
==
4000
)
{
message
.
error
(
scoreAdd
.
msg
,
1
);
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
scoreAdd
,
},
});
}
yield
put
(
routerRedux
.
push
({
pathname
:
'/sjd/integralmanage'
,
}));
},
*
integralModelStudentsList
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
if
(
!
sid
)
{
return
;
}
const
{
studentListQueryParams
}
=
yield
select
(
state
=>
state
.
studentclass
);
const
loadmessage
=
message
.
loading
(
'数据加载中...'
,
0
);
const
newClassListQueryParams
=
Object
.
assign
(
studentListQueryParams
,
{
school_id
:
sid
,
});
const
studentsinfo
=
yield
call
(
studentsAjax
.
studentsList
,
newClassListQueryParams
);
setTimeout
(
loadmessage
);
if
(
studentsinfo
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
allStudentList
:
(
studentsinfo
.
data
&&
studentsinfo
.
data
.
list
)
||
[],
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
studentsinfo
,
},
});
}
},
*
integralModelGoodAdd
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
studentSubmiting
,
couponImg
,
couponBanner
,
editCouponInfo
,
}
=
yield
select
(
state
=>
state
.
integral
);
if
(
!
sid
)
{
return
;
}
if
(
studentSubmiting
)
{
return
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
studentSubmiting
:
true
,
},
});
const
{
price
,
title
,
inventory
,
remark
,
type
,
cover
,
status
,
banner
,
}
=
payload
;
console
.
log
(
payload
,
'payload'
);
const
loadmessage
=
message
.
loading
(
'保存中...'
,
0
);
const
postFunction
=
editCouponInfo
.
id
!=
0
?
goodsAjax
.
goodsEdit
:
goodsAjax
.
goodsAdd
;
const
data
=
yield
call
(
postFunction
,
Object
.
assign
(
editCouponInfo
,
{
school_id
:
sid
,
cover
:
couponImg
||
editCouponInfo
.
cover
,
price
,
title
,
inventory
,
remark
,
type
,
status
,
banner
:
'banner'
,
}));
yield
put
({
type
:
'updateState'
,
payload
:
{
studentSubmiting
:
false
,
},
});
setTimeout
(
loadmessage
);
if
(
data
.
code
==
200
)
{
yield
put
({
type
:
'integralModelList'
,
});
yield
put
({
type
:
'updateState'
,
payload
:
{
editCouponModalShow
:
false
,
editGoodsModalShow
:
false
,
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
,
},
});
}
},
*
integralModelGoodEdit
({
payload
},
{
call
,
put
,
select
})
{
const
{
record
}
=
payload
;
if
(
record
.
type
==
1
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
editCouponInfo
:
{
...
record
},
editGoodsModalShow
:
true
,
},
});
}
else
{
yield
put
({
type
:
'updateState'
,
payload
:
{
editCouponInfo
:
{
...
record
},
editCouponModalShow
:
true
,
},
});
}
...
...
@@ -48,36 +242,102 @@ export default {
*
integralModelDelete
({
payload
},
{
call
,
put
,
select
})
{
const
{
id
}
=
payload
;
const
loadmessage
=
message
.
loading
(
'数据提交中...'
,
0
);
const
course
delete
=
yield
call
(
goodsAjax
.
goodsDelete
,
{
const
goods
delete
=
yield
call
(
goodsAjax
.
goodsDelete
,
{
id
:
payload
.
id
,
});
setTimeout
(
loadmessage
);
if
(
course
delete
.
code
==
200
)
{
if
(
goods
delete
.
code
==
200
)
{
yield
put
({
type
:
'webapp/updateState'
,
});
yield
put
({
type
:
'integralModelList'
,
payload
:
{
// 1
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
course
delete
,
data
:
goods
delete
,
},
});
// message.error(coursedelete.msg, 1);
}
},
*
integralModeljournalList
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
recordListTotal
}
=
yield
select
(
state
=>
state
.
integral
);
let
newClassListTotal
=
recordListTotal
;
const
loadmessage
=
message
.
loading
(
'数据加载中...'
,
0
);
const
courselistinfo
=
yield
call
(
goodsAjax
.
journalList
,
{
school_id
:
sid
,
page
:
1
,
perPage
:
100
,
});
setTimeout
(
loadmessage
);
if
(
courselistinfo
.
code
==
200
)
{
if
(
courselistinfo
.
data
.
total
!=
undefined
)
{
newClassListTotal
=
courselistinfo
.
data
.
total
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
sid
,
recordList
:
courselistinfo
.
data
&&
courselistinfo
.
data
.
list
,
recordListTotal
:
newClassListTotal
,
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
courselistinfo
,
},
});
}
},
*
paginationchange
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
params
}
=
payload
;
yield
put
({
type
:
'integralModeljournalList'
,
payload
:
{
school_id
:
sid
,
page
:
params
.
page
,
perPage
:
params
.
perPage
,
},
});
},
*
updateCouponThumb
({
payload
},
{
call
,
put
,
select
})
{
const
{
avatar
}
=
payload
;
yield
put
({
type
:
'updateState'
,
payload
:
{
couponImg
:
avatar
,
},
});
},
*
pageInit
({
payload
},
{
call
,
put
,
select
})
{
yield
put
({
type
:
'updateState'
,
payload
:
{
sid
:
0
,
goodslist
:
[],
editCourseModalShow
:
false
,
editCouponInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
editGoodsInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
},
});
},
...
...
src/models/uploader.js
View file @
6c9749d1
...
...
@@ -228,6 +228,13 @@ export default {
avatar
:
`
${
filename
}
?x-oss-process=
${
cropperUrl
}
`
,
},
});
}
else
if
(
uploadtype
==
'goodsAvatorupload'
)
{
yield
put
({
type
:
'integral/updateCouponThumb'
,
payload
:
{
avatar
:
`
${
filename
}
?x-oss-process=
${
cropperUrl
}
`
,
},
});
}
},
*
unloadstates
({
payload
},
{
call
,
put
})
{
// 释放该页面存储的所有状态
...
...
src/models/webapp.js
View file @
6c9749d1
...
...
@@ -520,6 +520,11 @@ export default {
payload
:
{
},
});
dispatch
({
type
:
'integral/integralModeljournalList'
,
payload
:
{
},
});
dispatch
({
type
:
'webapp/updateState'
,
payload
:
{
...
...
src/pages/integralmanage/index.js
View file @
6c9749d1
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
{
Icon
,
Button
,
Tabs
,
Select
,
Form
}
from
'antd'
;
import
{
Icon
,
Button
,
Tabs
,
Select
,
Form
,
InputNumber
,
Row
,
Col
,
Input
,
Radio
,
Modal
,
message
}
from
'antd'
;
import
pageStyle
from
'./index.less'
;
import
{
pageIn
,
hasBtnPower
}
from
'../../utils/index'
;
import
Integralsetting
from
'./integralsetting/index'
;
import
Storesetting
from
'./storesetting/index'
;
import
Operationlog
from
'./operationlog/index'
;
const
{
TabPane
}
=
Tabs
;
class
Integralmanage
extends
React
.
Component
{
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
class
ClassMgtForm
extends
React
.
Component
{
componentDidMount
()
{
// 挂载
pageIn
(
'轻校-积分管理'
);
}
...
...
@@ -16,20 +21,77 @@ class Integralmanage extends React.Component {
componentWillUnmount
()
{
// 卸载
}
callback
=
(
key
)
=>
{
console
.
log
(
key
);
const
{
dispatch
}
=
this
.
props
;
if
(
key
===
3
)
{
dispatch
({
type
:
'integral/integralModeljournalList'
,
payload
:
{
},
});
}
}
integralBtn
=
(
modalVisible
)
=>
{
const
{
dispatch
,
form
}
=
this
.
props
;
dispatch
({
type
:
'integral/integralModelStudentsList'
,
payload
:
{
},
});
dispatch
({
type
:
'integral/updateState'
,
payload
:
{
editScoreVisible
:
modalVisible
,
},
});
}
handleScoreSubmit
=
(
e
)
=>
{
const
{
dispatch
,
form
,
handleScoreCancel
}
=
this
.
props
;
e
.
preventDefault
();
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
const
{
school_id
,
student_ids
,
number
,
remark
,
type
,
}
=
values
;
dispatch
({
type
:
'integral/integralModelScoreSave'
,
payload
:
{
school_id
,
student_ids
,
remark
,
number
:
type
==
0
?
number
:
-
number
,
},
});
}
});
}
integralBtn
=
()
=>
{
console
.
log
(
111
);
handleScoreCancel
=
()
=>
{
}
render
()
{
const
that
=
this
;
const
{
staticcenter
,
form
:
{
getFieldDecorator
,
getFieldValue
},
courseSubmiting
,
allStudentList
,
editScoreVisible
,
}
=
this
.
props
;
const
operations
=
<
Button
onClick
=
{()
=>
this
.
integralBtn
()}
type
=
"primary"
>
积分变动
<
/Button>
;
const
operations
=
<
Button
onClick
=
{()
=>
this
.
integralBtn
(
true
)}
type
=
"primary"
>
积分变动
<
/Button>
;
const
formItemModalLineLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
},
};
return
(
<
div
className
=
{
pageStyle
.
container
}
>
<
Tabs
defaultActiveKey
=
"
2
"
onChange
=
{
this
.
callback
}
tabBarExtraContent
=
{
operations
}
>
<
Tabs
defaultActiveKey
=
"
1
"
onChange
=
{
this
.
callback
}
tabBarExtraContent
=
{
operations
}
>
<
TabPane
tab
=
"积分设置"
key
=
"1"
>
<
Integralsetting
/>
<
/TabPane
>
...
...
@@ -37,18 +99,96 @@ class Integralmanage extends React.Component {
<
Storesetting
/>
<
/TabPane
>
<
TabPane
tab
=
"操作日志"
key
=
"3"
>
Content
of
Tab
Pane
3
<
Operationlog
/>
<
/TabPane
>
<
/Tabs
>
<
Modal
visible
=
{
editScoreVisible
}
title
=
"积分变动"
okText
=
"保存"
onCancel
=
{()
=>
this
.
integralBtn
(
false
)}
onOk
=
{
this
.
handleScoreSubmit
}
confirmLoading
=
{
courseSubmiting
}
centered
width
=
{
586
}
destroyOnClose
>
<
Form
labelAlign
=
"left"
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"学员"
>
{
getFieldDecorator
(
'student_ids'
,
{
rules
:
[
{
required
:
true
,
message
:
'请选择学员'
,
},
],
})(
<
Select
placeholder
=
"请选择学员"
style
=
{{
width
:
174
}}
showSearch
onChange
=
{
this
.
handleStudentChange
}
>
{
allStudentList
.
map
(
ele
=>
<
Option
value
=
{
ele
.
id
}
>
{
ele
.
name
}
<
/Option>
)
}
<
/Select>
,
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"类型"
>
{
getFieldDecorator
(
'type'
,
{
initialValue
:
0
,
rules
:
[
{
required
:
true
,
message
:
'请选择类型'
,
},
],
})(
<
Radio
.
Group
>
<
Radio
value
=
{
0
}
>
增加积分
<
/Radio
>
<
Radio
value
=
{
-
1
}
>
减少积分
<
/Radio
>
<
/Radio.Group>
,
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"积分值"
>
{
getFieldDecorator
(
'number'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入积分值'
,
},
],
})(
<
InputNumber
/>
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"备注"
>
{
getFieldDecorator
(
'remark'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入备注'
,
},
],
})(
<
TextArea
autosize
=
{{
minRows
:
3
,
maxRows
:
5
}}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
/Form
>
<
/Modal
>
<
/div
>
);
}
}
Integralmanage
.
propTypes
=
{
ClassMgtForm
.
propTypes
=
{
};
const
ClassMgt
=
Form
.
create
()(
ClassMgtForm
);
function
mapStateToProps
(
state
)
{
const
{
courseSubmiting
,
editScoreVisible
,
allStudentList
,
}
=
state
.
integral
;
return
{
courseSubmiting
,
editScoreVisible
,
allStudentList
,
};
}
export
default
connect
(
mapStateToProps
)(
Integralmanage
);
export
default
connect
(
mapStateToProps
)(
ClassMgt
);
src/pages/integralmanage/integralsetting/index.js
View file @
6c9749d1
This diff is collapsed.
Click to expand it.
src/pages/integralmanage/integralsetting/index.less
View file @
6c9749d1
...
...
@@ -41,3 +41,12 @@
line-height:22px;
margin-left: 15px;
}
.formItem {
display: flex;
align-items: center;
margin-top: 15px;
.formflex {
display: flex;
align-items: center;
}
}
src/pages/integralmanage/operationlog/index.js
0 → 100644
View file @
6c9749d1
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
{
Form
,
Icon
,
Button
,
Tabs
,
Modal
,
Row
,
Col
,
Tag
,
Divider
,
Table
,
Pagination
,
message
}
from
'antd'
;
import
pageStyle
from
'./index.less'
;
import
{
hasBtnPower
,
imagify
}
from
'../../../utils'
;
const
{
TabPane
}
=
Tabs
;
const
FormItem
=
Form
.
Item
;
class
StoreMgt
extends
React
.
Component
{
componentDidUpdate
()
{
}
componentWillUnmount
()
{
// 卸载
}
changePagination
=
(
page
,
perPage
)
=>
{
console
.
log
(
page
,
perPage
);
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'integral/paginationchange'
,
payload
:
{
params
:
{
page
,
perPage
,
},
},
});
}
render
()
{
const
{
recordList
,
recordListTotal
,
}
=
this
.
props
;
console
.
log
(
recordList
);
const
columns
=
[
{
title
:
'姓名'
,
dataIndex
:
'student.name'
,
},
{
title
:
'积分操作'
,
dataIndex
:
'change_integral'
,
render
:
(
text
,
row
)
=>
{
if
(
row
.
type
==
2
)
{
return
<
div
>-
{
text
}
<
/div>
;
}
return
<
div
>
{
text
}
<
/div>
;
},
},
{
title
:
'操作时间'
,
dataIndex
:
'created_at'
,
},
{
title
:
'操作人'
,
dataIndex
:
'operator.nickname'
,
},
];
return
(
<
div
className
=
{
pageStyle
.
container
}
>
<
div
className
=
{
pageStyle
.
tablebox
}
>
<
Table
dataSource
=
{
recordList
}
columns
=
{
columns
}
pagination
=
{
false
}
footer
=
{()
=>
(
<
div
className
=
"tablefooterbox"
>
<
span
className
=
"tablefooterstatic"
>
共
{
recordListTotal
}
条数据
<
/span
>
<
Pagination
showSizeChanger
showQuickJumper
onShowSizeChange
=
{
this
.
sizeChange
}
total
=
{
Number
(
recordListTotal
)}
onChange
=
{
this
.
changePagination
}
/
>
<
/div
>
)}
/
>
<
/div
>
<
/div
>
);
}
}
StoreMgt
.
propTypes
=
{
};
function
mapStateToProps
(
state
)
{
const
{
recordList
,
editCouponModalShow
,
classSubmitting
,
recordListTotal
,
}
=
state
.
integral
;
return
{
recordList
,
editCouponModalShow
,
classSubmitting
,
recordListTotal
,
};
}
export
default
connect
(
mapStateToProps
)(
StoreMgt
);
src/pages/integralmanage/operationlog/index.less
0 → 100644
View file @
6c9749d1
.container {
background-color: #fff;
padding: 24px 0 0;
position: relative;
overflow-y: hidden;
}
.tablebox {
padding: 20px 0;
background: #fff;
}
src/pages/integralmanage/storesetting/CouponAddModal.js
0 → 100644
View file @
6c9749d1
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
message
,
Row
,
Col
,
Input
,
Select
,
Modal
,
Form
,
InputNumber
}
from
'antd'
;
import
{
imagify
,
pageIn
}
from
'../../../utils/index'
;
import
pageStyle
from
'./CouponAddModal.less'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
const
FormItem
=
Form
.
Item
;
class
CouponAddModal
extends
React
.
Component
{
state
=
{
classRoomId
:
''
,
title
:
''
,
};
componentWillMount
()
{
}
componentDidUpdate
()
{
}
componentWillUpdate
()
{
}
componentDidMount
()
{
// 挂载
pageIn
(
'积分管理'
);
}
componentWillUnmount
()
{
// 卸载
}
componentWillReceiveProps
(
nextProps
)
{
}
save
=
()
=>
{
const
{
form
,
save
,
editCouponInfo
,
couponImg
,
}
=
this
.
props
;
console
.
log
(
couponImg
,
'couponImg'
);
if
(
editCouponInfo
.
id
==
0
&&
(
couponImg
==
''
||
couponImg
==
undefined
))
{
message
.
error
(
'请上传卡券封面'
,
0.5
);
return
;
}
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
console
.
log
(
values
,
'values'
);
const
{
price
,
title
,
cover
,
inventory
,
remark
,
type
,
status
,
}
=
values
;
save
({
price
,
title
,
cover
,
remark
,
inventory
,
type
,
status
,
});
}
});
}
close
=
()
=>
{
const
{
form
,
close
}
=
this
.
props
;
form
.
resetFields
();
close
();
}
uploadAvator
=
(
e
)
=>
{
const
{
uploadAvator
}
=
this
.
props
;
uploadAvator
({
files
:
e
.
target
,
uploadtype
:
'goodsAvatorupload'
,
});
}
render
()
{
const
{
visible
,
isEdit
,
couponImg
,
uploadAvator
,
editCouponInfo
,
form
:
{
getFieldDecorator
,
getFieldValue
},
}
=
this
.
props
;
console
.
log
(
this
.
props
);
const
{
classRoomId
,
title
}
=
this
.
state
;
const
formItemModalLineLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
6
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
18
},
},
};
return
(
<
Modal
visible
=
{
visible
}
title
=
{
isEdit
==
1
?
'编辑卡券'
:
'新增卡券'
}
okText
=
"确定"
onCancel
=
{
this
.
close
}
onOk
=
{
this
.
save
}
className
=
"modifyclassModal"
maskClosable
=
{
false
}
zIndex
=
{
110
}
>
<
Form
className
=
"modalform"
labelAlign
=
"left"
>
<
FormItem
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
}}
>
<
div
className
=
{
pageStyle
.
thumb
}
>
<
img
className
=
{
pageStyle
.
avatar
}
src
=
{
imagify
(
couponImg
)
?
imagify
(
couponImg
)
:
imagify
(
editCouponInfo
.
cover
)}
alt
=
""
/>
<
span
className
=
{
pageStyle
.
uploadThumb
}
>
<
input
type
=
"file"
id
=
"uploadinput"
className
=
{
pageStyle
.
fileuploadinput
}
onChange
=
{(
e
)
=>
{
this
.
uploadAvator
(
e
);
}}
accept
=
"image/*"
/>
新增图片
<
/span
>
<
div
className
=
{
pageStyle
.
thumbTip
}
><
span
>
建议尺寸:
310
*
270
最多上传
1
张
<
/span></
div
>
<
/div
>
<
/FormItem
>
{
getFieldDecorator
(
'type'
,
{
initialValue
:
2
})(
<
Input
type
=
"hidden"
/>
)}
{
getFieldDecorator
(
'status'
,
{
initialValue
:
1
})(
<
Input
type
=
"hidden"
/>
)}
<
FormItem
{...
formItemModalLineLayout
}
label
=
"卡券标题"
>
{
getFieldDecorator
(
'title'
,
{
initialValue
:
editCouponInfo
.
title
,
rules
:
[
{
required
:
true
,
message
:
'请输入卡券标题'
,
},
],
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"兑换卡券需要"
>
{
getFieldDecorator
(
'price'
,
{
initialValue
:
editCouponInfo
.
price
,
rules
:
[
{
required
:
true
,
message
:
'请输入积分'
,
},
],
})(
<
InputNumber
min
=
{
0
}
/>
)
}
<
span
className
=
"ant-form-text"
>
积分
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"该卡券数量"
>
{
getFieldDecorator
(
'inventory'
,
{
initialValue
:
editCouponInfo
.
inventory
,
rules
:
[
{
required
:
true
,
message
:
'请输入数量'
,
},
],
})(
<
InputNumber
min
=
{
0
}
/>
)
}
<
span
className
=
"ant-form-text"
>
件
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"其他说明"
>
{
getFieldDecorator
(
'remark'
,
{
initialValue
:
editCouponInfo
.
remark
,
})(
<
TextArea
autosize
=
{{
minRows
:
3
,
maxRows
:
5
}}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
/Form
>
<
/Modal
>
);
}
}
CouponAddModal
.
propTypes
=
{
isEdit
:
false
,
};
CouponAddModal
.
defaultProps
=
{
isEdit
:
false
,
};
const
ClassMgt
=
Form
.
create
()(
CouponAddModal
);
export
default
ClassMgt
;
src/pages/integralmanage/storesetting/CouponAddModal.less
0 → 100644
View file @
6c9749d1
.thumb {
display: flex;
position: relative;
.thumbTip {
position: absolute;
font-size:14px;
font-family:PingFangSC;
font-weight:400;
color:rgba(0,0,0,0.85);
line-height:22px;
top: 50px;
left: 160px;
}
}
.avatar {
width: 130px;
height: 110px;
background-color: #D8D8D8;
margin-right: 30px;
}
.uploadThumb {
width: 78px;
height: 32px;
position: relative;
background-color: #1890FF;
border-radius: 4px;
text-align: center;
line-height: 32px;
color: #fff;
cursor: pointer;
}
.changeOperate {
margin-left: 10px;
}
.fileuploadinput {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
:global {
.addstudentcontent {
.ant-form-item {
margin-bottom: 20px;
}
}
}
src/pages/integralmanage/storesetting/GoodsAddModal.js
0 → 100644
View file @
6c9749d1
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
message
,
Row
,
Col
,
Input
,
Select
,
Modal
,
Form
,
InputNumber
}
from
'antd'
;
import
{
imagify
,
pageIn
}
from
'../../../utils/index'
;
import
pageStyle
from
'./GoodsAddModal.less'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
const
FormItem
=
Form
.
Item
;
class
GoodsAddModal
extends
React
.
Component
{
state
=
{
};
componentWillMount
()
{
}
componentDidUpdate
()
{
}
componentWillUpdate
()
{
}
componentDidMount
()
{
// 挂载
pageIn
(
'积分管理'
);
}
componentWillUnmount
()
{
// 卸载
}
componentWillReceiveProps
(
nextProps
)
{
}
save
=
()
=>
{
const
{
form
,
save
,
editCouponInfo
,
couponImg
,
}
=
this
.
props
;
console
.
log
(
couponImg
,
'couponImg'
);
if
(
editCouponInfo
.
id
==
0
&&
(
couponImg
==
''
||
couponImg
==
undefined
))
{
message
.
error
(
'请上传卡券封面'
,
0.5
);
return
;
}
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
console
.
log
(
values
,
'values'
);
const
{
price
,
title
,
cover
,
inventory
,
remark
,
type
,
status
,
}
=
values
;
save
({
price
,
title
,
cover
,
remark
,
inventory
,
type
,
status
,
});
}
});
}
close
=
()
=>
{
const
{
form
,
close
}
=
this
.
props
;
form
.
resetFields
();
close
();
}
uploadAvator
=
(
e
)
=>
{
const
{
uploadAvator
}
=
this
.
props
;
uploadAvator
({
files
:
e
.
target
,
uploadtype
:
'goodsAvatorupload'
,
});
}
render
()
{
const
{
visible
,
isEdit
,
couponImg
,
uploadAvator
,
editCouponInfo
,
form
:
{
getFieldDecorator
,
getFieldValue
},
}
=
this
.
props
;
console
.
log
(
this
.
props
);
const
{
classRoomId
,
title
}
=
this
.
state
;
const
formItemModalLineLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
6
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
18
},
},
};
return
(
<
Modal
visible
=
{
visible
}
title
=
{
isEdit
==
1
?
'编辑商品'
:
'新增商品'
}
okText
=
"确定"
onCancel
=
{
this
.
close
}
onOk
=
{
this
.
save
}
className
=
"modifyclassModal"
maskClosable
=
{
false
}
zIndex
=
{
110
}
>
<
Form
className
=
"modalform"
labelAlign
=
"left"
>
<
FormItem
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
}}
>
<
div
className
=
{
pageStyle
.
thumb
}
>
<
img
className
=
{
pageStyle
.
avatar
}
src
=
{
imagify
(
couponImg
)
?
imagify
(
couponImg
)
:
imagify
(
editCouponInfo
.
cover
)}
alt
=
""
/>
<
span
className
=
{
pageStyle
.
uploadThumb
}
>
<
input
type
=
"file"
id
=
"uploadinput"
className
=
{
pageStyle
.
fileuploadinput
}
onChange
=
{(
e
)
=>
{
this
.
uploadAvator
(
e
);
}}
accept
=
"image/*"
/>
新增图片
<
/span
>
<
div
className
=
{
pageStyle
.
thumbTip
}
><
span
>
建议尺寸:
310
*
270
最多上传
1
张
<
/span></
div
>
<
/div
>
<
/FormItem
>
<
FormItem
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
}}
>
<
div
className
=
{
pageStyle
.
banner
}
>
<
img
className
=
{
pageStyle
.
avatar
}
src
=
{
imagify
(
couponImg
)
?
imagify
(
couponImg
)
:
imagify
(
editCouponInfo
.
cover
)}
alt
=
""
/>
<
span
className
=
{
pageStyle
.
uploadThumb
}
>
<
input
type
=
"file"
id
=
"uploadinput"
className
=
{
pageStyle
.
fileuploadinput
}
onChange
=
{(
e
)
=>
{
this
.
uploadAvator
(
e
);
}}
accept
=
"image/*"
/>
新增图片
<
/span
>
<
div
className
=
{
pageStyle
.
thumbTip
}
><
span
>
建议尺寸:
750
*
310
最多上传
4
张
<
/span></
div
>
<
/div
>
<
/FormItem
>
{
getFieldDecorator
(
'type'
,
{
initialValue
:
1
})(
<
Input
type
=
"hidden"
/>
)}
{
getFieldDecorator
(
'status'
,
{
initialValue
:
1
})(
<
Input
type
=
"hidden"
/>
)}
<
FormItem
{...
formItemModalLineLayout
}
label
=
"卡券标题"
>
{
getFieldDecorator
(
'title'
,
{
initialValue
:
editCouponInfo
.
title
,
rules
:
[
{
required
:
true
,
message
:
'请输入卡券标题'
,
},
],
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"兑换卡券需要"
>
{
getFieldDecorator
(
'price'
,
{
initialValue
:
editCouponInfo
.
price
,
rules
:
[
{
required
:
true
,
message
:
'请输入积分'
,
},
],
})(
<
InputNumber
min
=
{
0
}
/>
)
}
<
span
className
=
"ant-form-text"
>
积分
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"该卡券数量"
>
{
getFieldDecorator
(
'inventory'
,
{
initialValue
:
editCouponInfo
.
inventory
,
rules
:
[
{
required
:
true
,
message
:
'请输入数量'
,
},
],
})(
<
InputNumber
min
=
{
0
}
/>
)
}
<
span
className
=
"ant-form-text"
>
件
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"其他说明"
>
{
getFieldDecorator
(
'remark'
,
{
initialValue
:
editCouponInfo
.
remark
,
})(
<
TextArea
autosize
=
{{
minRows
:
3
,
maxRows
:
5
}}
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
/Form
>
<
/Modal
>
);
}
}
GoodsAddModal
.
propTypes
=
{
isEdit
:
false
,
};
GoodsAddModal
.
defaultProps
=
{
isEdit
:
false
,
};
const
ClassMgt
=
Form
.
create
()(
GoodsAddModal
);
export
default
ClassMgt
;
src/pages/integralmanage/storesetting/GoodsAddModal.less
0 → 100644
View file @
6c9749d1
.thumb {
display: flex;
position: relative;
.thumbTip {
position: absolute;
font-size:14px;
font-family:PingFangSC;
font-weight:400;
color:rgba(0,0,0,0.85);
line-height:22px;
top: 50px;
left: 160px;
}
.avatar {
width: 130px;
height: 110px;
background-color: #D8D8D8;
margin-right: 30px;
}
}
.banner {
display: flex;
position: relative;
.thumbTip {
position: absolute;
font-size:14px;
font-family:PingFangSC;
font-weight:400;
color:rgba(0,0,0,0.85);
line-height:22px;
top: 50px;
left: 252px;
}
.avatar {
width: 223px;
height: 92px;
background-color: #D8D8D8;
margin-right: 30px;
}
}
.uploadThumb {
width: 78px;
height: 32px;
position: relative;
background-color: #1890FF;
border-radius: 4px;
text-align: center;
line-height: 32px;
color: #fff;
cursor: pointer;
}
.changeOperate {
margin-left: 10px;
}
.fileuploadinput {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
:global {
.addstudentcontent {
.ant-form-item {
margin-bottom: 20px;
}
}
}
src/pages/integralmanage/storesetting/index.js
View file @
6c9749d1
...
...
@@ -3,6 +3,9 @@ import React from 'react';
import
{
Form
,
Icon
,
Button
,
Tabs
,
Modal
,
Row
,
Col
,
Tag
,
Divider
,
Table
,
Pagination
,
message
}
from
'antd'
;
import
pageStyle
from
'./index.less'
;
import
{
hasBtnPower
,
imagify
}
from
'../../../utils'
;
import
CouponAddModal
from
'./CouponAddModal'
;
import
GoodsAddModal
from
'./GoodsAddModal'
;
import
Cropper
from
'../../../components/Cropper'
;
const
{
TabPane
}
=
Tabs
;
const
FormItem
=
Form
.
Item
;
class
StoreMgt
extends
React
.
Component
{
...
...
@@ -11,6 +14,29 @@ class StoreMgt extends React.Component {
this
.
state
=
{
previewVisible
:
false
,
previewImage
:
''
,
isEdit
:
2
,
avatorUploader
:
{
maxsize
:
8192
,
// 奖品图片最大尺寸KBcropper: {
cropper
:
{
croppered_params
:
[],
// 图片裁剪后的参数
config
:
{
dragMode
:
'move'
,
viewMode
:
1
,
aspectRatio
:
1
,
autoCropArea
:
0.8
,
guides
:
!
1
,
center
:
!
0
,
highlight
:
!
1
,
dragCrop
:
!
1
,
cropBoxMovable
:
!
1
,
cropBoxResizable
:
!
1
,
zoom
:
-
0.2
,
checkImageOrigin
:
!
0
,
background
:
!
1
,
rotatable
:
!
0
,
},
},
},
};
}
componentDidUpdate
()
{
...
...
@@ -24,7 +50,6 @@ class StoreMgt extends React.Component {
});
};
deleteItem
=
(
item
)
=>
{
console
.
log
(
item
);
const
me
=
this
;
const
{
dispatch
}
=
me
.
props
;
Modal
.
confirm
({
...
...
@@ -49,13 +74,140 @@ class StoreMgt extends React.Component {
},
});
};
addGoods
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
this
.
setState
({
isEdit
:
2
,
});
dispatch
({
type
:
'integral/updateState'
,
payload
:
{
editGoodsModalShow
:
true
,
editCouponInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
},
});
}
addCoupon
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
this
.
setState
({
isEdit
:
2
,
});
dispatch
({
type
:
'integral/updateState'
,
payload
:
{
editCouponModalShow
:
true
,
editCouponInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
},
});
}
editCoupon
=
(
record
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'integral/integralModelGoodEdit'
,
payload
:
{
record
,
},
});
}
closeCouponModal
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'integral/updateState'
,
payload
:
{
editCouponModalShow
:
false
,
editCouponInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
},
});
}
closeGoodsModal
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'integral/updateState'
,
payload
:
{
editGoodsModalShow
:
false
,
editGoodsInfo
:
{
id
:
0
,
title
:
''
,
cover
:
''
,
price
:
0
,
inventory
:
0
,
},
},
});
}
uploadAvator
=
({
files
,
uploadtype
})
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'uploader/queryimgsignature'
,
payload
:
{
files
,
avatorUploader
:
this
.
state
.
avatorUploader
,
uploadtype
,
},
});
}
getCropperUrl
=
(
url
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'uploader/updateState'
,
payload
:
{
cropperUrl
:
url
,
},
});
}
cancelCropper
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'uploader/cancelcropper'
,
});
}
sureCropper
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'uploader/surecropper'
,
payload
:
{
},
});
}
save
=
(
value
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'integral/integralModelGoodAdd'
,
payload
:
value
,
});
}
render
()
{
const
{
goodsList
,
editCouponModalShow
,
studentSubmiting
,
cropperboxShow
,
uploadImgUrl
,
avatorUploader
,
couponImg
,
editCouponInfo
,
editGoodsModalShow
,
}
=
this
.
props
;
const
{
previewVisible
,
previewImage
,
previewVisible
,
previewImage
,
isEdit
,
type
,
}
=
this
.
state
;
const
columns
=
[
{
...
...
@@ -93,8 +245,7 @@ class StoreMgt extends React.Component {
<
span
>
<
a
href
=
"javascript:;"
onClick
=
{()
=>
{
}}
onClick
=
{()
=>
this
.
editCoupon
(
row
)}
>
编辑
<
/a
>
...
...
@@ -114,8 +265,8 @@ class StoreMgt extends React.Component {
return
(
<
div
className
=
{
pageStyle
.
container
}
>
<
Row
>
<
Col
span
=
{
2
}
>
<
Button
onClick
=
{
()
=>
this
.
addCoupon
()
}
type
=
"primary"
><
Icon
type
=
"credit-card"
/>
添加卡券
<
/Button></
Col
>
<
Col
span
=
{
2
}
>
<
Button
onClick
=
{()
=>
this
.
integralBtn
()}
type
=
"primary"
><
Icon
type
=
"shopping"
/>
添加商品
<
/Button></
Col
>
<
Col
span
=
{
2
}
>
<
Button
onClick
=
{
this
.
addCoupon
}
type
=
"primary"
><
Icon
type
=
"credit-card"
/>
添加卡券
<
/Button></
Col
>
<
Col
span
=
{
2
}
>
<
Button
onClick
=
{()
=>
this
.
addGoods
()}
type
=
"primary"
><
Icon
type
=
"shopping"
/>
添加商品
<
/Button></
Col
>
<
/Row
>
<
div
className
=
{
pageStyle
.
tablebox
}
>
<
Table
...
...
@@ -132,6 +283,33 @@ class StoreMgt extends React.Component {
>
<
img
alt
=
"example"
style
=
{{
width
:
'100%'
}}
src
=
{
previewImage
}
/
>
<
/Modal
>
<
CouponAddModal
visible
=
{
editCouponModalShow
}
isEdit
=
{
isEdit
}
studentSubmiting
=
{
studentSubmiting
}
close
=
{
this
.
closeCouponModal
}
save
=
{
this
.
save
}
uploadAvator
=
{
this
.
uploadAvator
}
couponImg
=
{
couponImg
}
editCouponInfo
=
{
editCouponInfo
}
/
>
<
GoodsAddModal
visible
=
{
editGoodsModalShow
}
isEdit
=
{
isEdit
}
studentSubmiting
=
{
studentSubmiting
}
close
=
{
this
.
closeGoodsModal
}
save
=
{
this
.
save
}
uploadAvator
=
{
this
.
uploadAvator
}
couponImg
=
{
couponImg
}
editCouponInfo
=
{
editCouponInfo
}
/
>
{
cropperboxShow
&&
<
Cropper
avatorUploader
=
{
this
.
state
.
avatorUploader
}
cancelCropper
=
{
this
.
cancelCropper
}
getCropperUrl
=
{
this
.
getCropperUrl
}
sureCropper
=
{
this
.
sureCropper
}
uploadImgUrl
=
{
uploadImgUrl
}
/>
}
<
/div
>
);
}
...
...
@@ -139,11 +317,29 @@ class StoreMgt extends React.Component {
StoreMgt
.
propTypes
=
{
};
function
mapStateToProps
(
state
)
{
const
{
cropperboxShow
,
uploadImgUrl
,
avatorUploader
,
}
=
state
.
uploader
;
const
{
goodsList
,
editCouponModalShow
,
editCouponInfo
,
studentSubmiting
,
couponImg
,
editGoodsModalShow
,
}
=
state
.
integral
;
return
{
goodsList
,
editCouponModalShow
,
studentSubmiting
,
cropperboxShow
,
uploadImgUrl
,
avatorUploader
,
couponImg
,
editCouponInfo
,
editGoodsModalShow
,
};
}
export
default
connect
(
mapStateToProps
)(
StoreMgt
);
...
...
src/services/integral.js
View file @
6c9749d1
import
qs
from
'qs'
;
import
request
from
'../utils/request'
;
import
api
from
'../common/api'
;
export
function
journalList
(
parmas
)
{
const
data
=
qs
.
stringify
(
parmas
);
return
request
({
url
:
`
${
api
.
integralsetting
.
journalList
}
?
${
data
}
`
,
method
:
'GET'
,
data
,
});
}
export
function
goodsList
(
parmas
)
{
const
data
=
qs
.
stringify
(
parmas
);
return
request
({
...
...
@@ -17,3 +25,28 @@ export function goodsDelete(params) {
data
,
});
}
export
function
scoreSave
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
integralsetting
.
scoreSave
}
`
,
method
:
'POST'
,
data
,
});
}
export
function
goodsEdit
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
integralsetting
.
goodsEdit
}
/
${
params
.
id
}
`
,
method
:
'PUT'
,
data
,
});
}
export
function
goodsAdd
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
integralsetting
.
goodsAdd
}
`
,
method
:
'POST'
,
data
,
});
}
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