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
31a0ea7f
Commit
31a0ea7f
authored
Sep 05, 2019
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分管理bug修改
parent
9049c51c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
173 additions
and
67 deletions
+173
-67
api.js
src/common/api.js
+4
-2
integral.js
src/models/integral.js
+28
-16
index.js
src/pages/integralmanage/index.js
+12
-6
index.js
src/pages/integralmanage/integralsetting/index.js
+22
-10
index.less
src/pages/integralmanage/integralsetting/index.less
+10
-13
index.js
src/pages/integralmanage/operationlog/index.js
+1
-1
CouponAddModal.js
src/pages/integralmanage/storesetting/CouponAddModal.js
+12
-1
CouponAddModal.less
src/pages/integralmanage/storesetting/CouponAddModal.less
+14
-2
GoodsAddModal.js
src/pages/integralmanage/storesetting/GoodsAddModal.js
+18
-6
GoodsAddModal.less
src/pages/integralmanage/storesetting/GoodsAddModal.less
+18
-4
index.js
src/pages/integralmanage/storesetting/index.js
+34
-6
No files found.
src/common/api.js
View file @
31a0ea7f
...
...
@@ -4,8 +4,10 @@ const basepath = `${location.protocol}//${pathify(window.location.host)}/`;
let
api
=
''
;
let
dakaapi
=
''
;
if
(
ENVIRONMENT
==
'pro'
)
{
api
=
'https://wx.m.shangjiadao.cn/v2/api/'
;
dakaapi
=
'https://qxapi.qingxiao.online/daka/v3/'
;
api
=
'https://test.wp53.cn/v2/api/'
;
dakaapi
=
'https:clock.wp53.cn/v3/'
;
// api = 'https://wx.m.shangjiadao.cn/v2/api/';
// dakaapi = 'https://qxapi.qingxiao.online/daka/v3/';
}
else
if
(
ENVIRONMENT
==
'dev'
)
{
api
=
'https://test.wp53.cn/v2/api/'
;
dakaapi
=
'https:clock.wp53.cn/v3/'
;
...
...
src/models/integral.js
View file @
31a0ea7f
...
...
@@ -162,8 +162,7 @@ export default {
});
yield
put
({
type
:
'integralModeljournalList'
,
payload
:
{
},
payload
:
{},
});
}
else
if
(
scoreAdd
.
code
==
4000
)
{
message
.
error
(
scoreAdd
.
msg
,
1
);
...
...
@@ -281,7 +280,10 @@ export default {
yield
put
({
type
:
'updateState'
,
payload
:
{
editCouponInfo
:
{
...
record
,
banner
:
record
.
banner
==
''
?
[]
:
JSON
.
parse
(
record
.
banner
)
},
editCouponInfo
:
{
...
record
,
banner
:
record
.
banner
==
''
?
[]
:
JSON
.
parse
(
record
.
banner
),
},
editGoodsModalShow
:
true
,
},
});
...
...
@@ -308,8 +310,7 @@ export default {
});
yield
put
({
type
:
'integralModelList'
,
payload
:
{
},
payload
:
{},
});
}
else
{
yield
put
({
...
...
@@ -324,13 +325,11 @@ export default {
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
:
payload
.
page
?
payload
.
page
:
1
,
perPage
:
payload
.
perPage
?
payload
.
perPage
:
10
,
});
setTimeout
(
loadmessage
);
if
(
courselistinfo
.
code
==
200
)
{
if
(
courselistinfo
.
data
.
total
!=
undefined
)
{
newClassListTotal
=
courselistinfo
.
data
.
total
;
...
...
@@ -425,6 +424,7 @@ export default {
},
});
const
loadmessage
=
message
.
loading
(
'数据保存中...'
,
0
);
console
.
log
(
type1
,
'type1'
);
const
data
=
{
1
:
{
single
:
type1
.
checked
==
false
?
0
:
type1
.
single
||
0
,
...
...
@@ -485,13 +485,11 @@ export default {
if
(
ruleData
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
},
payload
:
{},
});
yield
put
({
type
:
'integralModelRuleList'
,
payload
:
{
},
payload
:
{},
});
}
else
{
yield
put
({
...
...
@@ -507,11 +505,9 @@ export default {
},
*
integralModelRuleList
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
loadmessage
=
message
.
loading
(
'数据加载中...'
,
0
);
const
rulelistinfo
=
yield
call
(
goodsAjax
.
ruleSelect
,
{
school_id
:
sid
,
});
setTimeout
(
loadmessage
);
if
(
rulelistinfo
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
...
...
@@ -543,6 +539,22 @@ export default {
});
}
},
*
focusChange
({
payload
},
{
call
,
put
,
select
})
{
const
{
index
}
=
payload
;
const
state
=
yield
select
(
state
=>
state
.
integral
);
if
(
state
[
`type
${
index
}
`
].
unlimited
==
false
)
{
return
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
[
`type
${
index
}
`
]:
{
...
state
[
`type
${
index
}
`
],
unlimited
:
false
,
},
},
});
},
*
moveGoodsimg
({
payload
},
{
call
,
put
,
select
})
{
const
{
index
,
direction
}
=
payload
;
const
{
editCouponInfo
}
=
yield
select
(
state
=>
state
.
integral
);
...
...
@@ -563,13 +575,13 @@ export default {
},
*
deleteGoodsImg
({
payload
},
{
call
,
put
,
select
})
{
const
{
index
}
=
payload
;
const
{
goodsBanner
}
=
yield
select
(
state
=>
state
.
integral
);
const
newBannerImg
=
JSON
.
parse
(
JSON
.
stringify
(
goodsBanner
))
;
const
{
editCouponInfo
}
=
yield
select
(
state
=>
state
.
integral
);
const
newBannerImg
=
editCouponInfo
.
banner
;
newBannerImg
.
splice
(
index
,
1
);
yield
put
({
type
:
'updateState'
,
payload
:
{
goodsBanner
:
newBannerImg
,
editCouponInfo
:
{
...
editCouponInfo
}
,
},
});
},
...
...
src/pages/integralmanage/index.js
View file @
31a0ea7f
...
...
@@ -90,12 +90,12 @@ class ClassMgtForm extends React.Component {
const
operations
=
<
Button
onClick
=
{()
=>
this
.
integralBtn
(
true
)}
type
=
"primary"
>
积分变动
<
/Button>
;
const
formItemModalLineLayout
=
{
labelCol
:
{
xs
:
{
span
:
2
4
},
sm
:
{
span
:
2
4
},
xs
:
{
span
:
4
},
sm
:
{
span
:
4
},
},
wrapperCol
:
{
xs
:
{
span
:
2
4
},
sm
:
{
span
:
2
4
},
xs
:
{
span
:
2
0
},
sm
:
{
span
:
2
0
},
},
};
return
(
...
...
@@ -156,13 +156,15 @@ class ClassMgtForm extends React.Component {
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"积分值"
>
{
getFieldDecorator
(
'number'
,
{
initialValue
:
0
,
rules
:
[
{
required
:
true
,
message
:
'请输入积分值'
,
message
:
'请输入正整数'
,
pattern
:
new
RegExp
(
/^
[
1-9
]\d
*$/
,
'g'
),
},
],
})(
<
InputNumber
/>
)}
})(
<
InputNumber
min
=
{
0
}
/>
)
}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"备注"
>
{
getFieldDecorator
(
'remark'
,
{
...
...
@@ -171,6 +173,10 @@ class ClassMgtForm extends React.Component {
required
:
true
,
message
:
'请输入备注'
,
},
{
max
:
500
,
message
:
'不能超过500个字符'
,
},
],
})(
<
TextArea
autosize
=
{{
minRows
:
3
,
maxRows
:
5
}}
...
...
src/pages/integralmanage/integralsetting/index.js
View file @
31a0ea7f
This diff is collapsed.
Click to expand it.
src/pages/integralmanage/integralsetting/index.less
View file @
31a0ea7f
...
...
@@ -20,7 +20,7 @@
align-items: center;
font-size:16px;
font-family:PingFangSC;
font-weight:
5
00;
font-weight:
6
00;
color:rgba(0,0,0,0.85);
line-height:24px;
margin-right: 30px;
...
...
@@ -39,7 +39,7 @@
font-size:12px;
font-family:PingFangSC;
font-weight:400;
color:
#999
;
color:
rgba(0,0,0,0.45)
;
line-height:22px;
margin-left: 15px;
}
...
...
@@ -54,14 +54,14 @@
margin-left: 40px;
margin-bottom: 20px;
.number {
width:
4
0px;
height:
24
px;
line-height:
24
px;
width:
6
0px;
height:
30
px;
line-height:
30
px;
}
.numberActive {
width:
56
px;
height: 3
2
px;
line-height: 3
2
px;
width:
80
px;
height: 3
5
px;
line-height: 3
5
px;
}
.switch {
width: 40px;
...
...
@@ -96,14 +96,11 @@
height: 24px;
line-height: 24px;
}
.ant-input-number-input {
width: 40px;
height: 24px;
line-height: 24px;
}
}
.checkLeftTip {
margin-left: 24px;
font-weight: 500;
font-family:PingFangSC;
}
.direction {
text-align: right;
...
...
src/pages/integralmanage/operationlog/index.js
View file @
31a0ea7f
...
...
@@ -53,7 +53,7 @@ class StoreMgt extends React.Component {
if
(
row
.
type
==
2
)
{
return
<
div
>-
{
text
}
<
/div>
;
}
return
<
div
>
{
text
}
<
/div>
;
return
<
div
>
+
{
text
}
<
/div>
;
},
},
{
...
...
src/pages/integralmanage/storesetting/CouponAddModal.js
View file @
31a0ea7f
...
...
@@ -115,6 +115,7 @@ class CouponAddModal extends React.Component {
sm
:
{
span
:
24
},
}}
>
<
div
className
=
{
pageStyle
.
topTip
}
>
卡券封面:
<
/div
>
<
div
className
=
{
pageStyle
.
thumb
}
>
<
img
className
=
{
pageStyle
.
avatar
}
src
=
{
imagify
(
couponImg
)
?
imagify
(
couponImg
)
:
imagify
(
editCouponInfo
.
cover
)}
alt
=
""
/>
<
span
className
=
{
pageStyle
.
uploadThumb
}
>
...
...
@@ -134,8 +135,12 @@ class CouponAddModal extends React.Component {
required
:
true
,
message
:
'请输入卡券标题'
,
},
{
max
:
25
,
message
:
'卡券标题不能超过25个字符'
,
},
],
})(
<
Input
placeholder
=
"请输入"
/>
)}
})(
<
Input
placeholder
=
"请输入
卡券标题
"
/>
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"兑换卡券需要"
>
{
getFieldDecorator
(
'price'
,
{
...
...
@@ -164,6 +169,12 @@ class CouponAddModal extends React.Component {
<
FormItem
{...
formItemModalLineLayout
}
label
=
"其他说明"
>
{
getFieldDecorator
(
'remark'
,
{
initialValue
:
editCouponInfo
.
remark
,
rules
:
[
{
max
:
100
,
message
:
'不能超过100个字符'
,
},
],
})(
<
TextArea
autosize
=
{{
minRows
:
3
,
maxRows
:
5
}}
placeholder
=
"请输入"
...
...
src/pages/integralmanage/storesetting/CouponAddModal.less
View file @
31a0ea7f
.topTip {
font-size:14px;
font-family:PingFangSC;
font-weight:400;
color:rgba(0,0,0,0.85);
line-height: 22px;
margin-bottom: 10px;
}
.thumb {
display: flex;
position: relative;
...
...
@@ -6,8 +14,8 @@
position: absolute;
font-size:14px;
font-family:PingFangSC;
font-weight:
4
00;
color:rgba(0,0,0,0.8
5
);
font-weight:
3
00;
color:rgba(0,0,0,0.8);
line-height:22px;
top: 50px;
left: 160px;
...
...
@@ -18,6 +26,7 @@
height: 110px;
background-color: #D8D8D8;
margin-right: 30px;
border-right: 2px;
}
.uploadThumb {
width: 78px;
...
...
@@ -49,4 +58,7 @@
margin-bottom: 20px;
}
}
.ant-modal-body {
padding: 10px 24px;
}
}
src/pages/integralmanage/storesetting/GoodsAddModal.js
View file @
31a0ea7f
...
...
@@ -172,6 +172,7 @@ class GoodsAddModal extends React.Component {
sm
:
{
span
:
24
},
}}
>
<
div
className
=
{
pageStyle
.
topTip
}
>
商品封面:
<
/div
>
<
div
className
=
{
pageStyle
.
thumb
}
>
<
img
className
=
{
pageStyle
.
avatar
}
src
=
{
imagify
(
couponImg
)
?
imagify
(
couponImg
)
:
imagify
(
editCouponInfo
.
cover
)}
alt
=
""
/>
<
span
className
=
{
pageStyle
.
uploadThumb
}
>
...
...
@@ -191,6 +192,7 @@ class GoodsAddModal extends React.Component {
sm
:
{
span
:
24
},
}}
>
<
div
className
=
{
pageStyle
.
topTip
}
>
商品详情图:
<
/div
>
<
div
className
=
{
pageStyle
.
banner
}
>
<
div
className
=
{
pageStyle
.
bannerBox
}
>
{
editCouponInfo
.
banner
.
length
>
0
&&
...
...
@@ -254,18 +256,22 @@ class GoodsAddModal extends React.Component {
<
/FormItem
>
{
getFieldDecorator
(
'type'
,
{
initialValue
:
1
})(
<
Input
type
=
"hidden"
/>
)}
{
getFieldDecorator
(
'status'
,
{
initialValue
:
1
})(
<
Input
type
=
"hidden"
/>
)}
<
FormItem
{...
formItemModalLineLayout
}
label
=
"
卡券
标题"
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"
商品
标题"
>
{
getFieldDecorator
(
'title'
,
{
initialValue
:
editCouponInfo
.
title
,
rules
:
[
{
required
:
true
,
message
:
'请输入卡券标题'
,
message
:
'请输入商品标题'
,
},
{
max
:
25
,
message
:
'商品标题不能超过25个字符'
,
},
],
})(
<
Input
placeholder
=
"请输入"
/>
)}
})(
<
Input
placeholder
=
"请输入
商品标题
"
/>
)}
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"兑换
卡券
需要"
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"兑换
商品
需要"
>
{
getFieldDecorator
(
'price'
,
{
initialValue
:
editCouponInfo
.
price
,
rules
:
[
...
...
@@ -277,7 +283,7 @@ class GoodsAddModal extends React.Component {
})(
<
InputNumber
min
=
{
0
}
/>
)
}
<
span
className
=
"ant-form-text"
>
积分
<
/span
>
<
/FormItem
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"该
卡券
数量"
>
<
FormItem
{...
formItemModalLineLayout
}
label
=
"该
商品
数量"
>
{
getFieldDecorator
(
'inventory'
,
{
initialValue
:
editCouponInfo
.
inventory
,
rules
:
[
...
...
@@ -292,9 +298,15 @@ class GoodsAddModal extends React.Component {
<
FormItem
{...
formItemModalLineLayout
}
label
=
"其他说明"
>
{
getFieldDecorator
(
'remark'
,
{
initialValue
:
editCouponInfo
.
remark
,
rules
:
[
{
max
:
100
,
message
:
'不能超过100个字符'
,
},
],
})(
<
TextArea
autosize
=
{{
minRows
:
3
,
maxRows
:
5
}}
placeholder
=
"请输入"
placeholder
=
"请输入
其他说明
"
/>
)}
<
/FormItem
>
<
/Form
>
...
...
src/pages/integralmanage/storesetting/GoodsAddModal.less
View file @
31a0ea7f
.topTip {
font-size:14px;
font-family:PingFangSC;
font-weight:400;
color:rgba(0,0,0,0.85);
line-height: 22px;
margin-bottom: 10px;
}
.thumb {
display: flex;
position: relative;
...
...
@@ -6,8 +14,8 @@
position: absolute;
font-size:14px;
font-family:PingFangSC;
font-weight:
4
00;
color:rgba(0,0,0,0.8
5
);
font-weight:
3
00;
color:rgba(0,0,0,0.8);
line-height:22px;
top: 50px;
left: 160px;
...
...
@@ -17,6 +25,7 @@
height: 110px;
background-color: #D8D8D8;
margin-right: 30px;
border-right: 2px;
}
}
.bannerBox {
...
...
@@ -25,6 +34,7 @@
background-color: #D8D8D8;
margin-right: 30px;
position: relative;
border-right: 2px;
}
.banner {
display: flex;
...
...
@@ -34,8 +44,8 @@
position: absolute;
font-size:14px;
font-family:PingFangSC;
font-weight:
4
00;
color:rgba(0,0,0,0.8
5
);
font-weight:
3
00;
color:rgba(0,0,0,0.8);
line-height:22px;
top: 50px;
left: 252px;
...
...
@@ -45,6 +55,7 @@
height: 92px;
background-color: #D8D8D8;
margin-right: 30px;
border-right: 2px;
}
}
...
...
@@ -84,6 +95,9 @@
overflow: hidden;
background-color: #D8D8D8;
}
.ant-modal-body {
padding: 10px 24px;
}
}
@import '../../../less/variables.less';
@images: '@{imagesroot}/webapp/';
...
...
src/pages/integralmanage/storesetting/index.js
View file @
31a0ea7f
...
...
@@ -22,7 +22,7 @@ class StoreMgt extends React.Component {
config
:
{
dragMode
:
'move'
,
viewMode
:
1
,
aspectRatio
:
1
,
aspectRatio
:
270
/
310
,
autoCropArea
:
0.8
,
guides
:
!
1
,
center
:
!
0
,
...
...
@@ -52,6 +52,10 @@ class StoreMgt extends React.Component {
deleteItem
=
(
item
)
=>
{
const
me
=
this
;
const
{
dispatch
}
=
me
.
props
;
if
(
item
.
consumption
>
0
)
{
message
.
error
(
`奖品已经有
${
item
.
consumption
}
人兑奖,无法删除`
,
1
);
return
;
}
Modal
.
confirm
({
title
:
`确定删除“
${
item
.
title
}
”?`
,
content
:
'删除后不可恢复,请谨慎操作!'
,
...
...
@@ -182,11 +186,13 @@ class StoreMgt extends React.Component {
}
uploadBanner
=
({
files
,
uploadtype
})
=>
{
const
{
dispatch
}
=
this
.
props
;
const
avatorConfig
=
this
.
state
.
avatorUploader
;
avatorConfig
.
cropper
.
config
.
aspectRatio
=
750
/
310
;
dispatch
({
type
:
'uploader/queryimgsignature'
,
payload
:
{
files
,
avatorUploader
:
this
.
state
.
avatorUploader
,
avatorUploader
:
avatorConfig
,
uploadtype
,
},
});
...
...
@@ -242,6 +248,18 @@ class StoreMgt extends React.Component {
{
title
:
'商品名称'
,
dataIndex
:
'title'
,
render
:
(
text
)
=>
{
return
(
<
div
style
=
{{
width
:
'200px'
,
overflow
:
'hidden'
,
whiteSpace
:
'nowrap'
,
textOverflow
:
'ellipsis'
,
}}
>
{
text
}
<
/div
>
);
},
},
{
title
:
'类型'
,
...
...
@@ -261,7 +279,12 @@ class StoreMgt extends React.Component {
this
.
handlePreview
((
imagify
(
text
)));
}}
src
=
{(
imagify
(
text
))}
style
=
{{
height
:
70
,
width
:
80
,
cursor
:
'pointer'
}}
style
=
{{
height
:
70
,
width
:
80
,
cursor
:
'pointer'
,
borderRadius
:
'2px'
,
}}
/
>
);
},
...
...
@@ -273,6 +296,11 @@ class StoreMgt extends React.Component {
{
title
:
'库存'
,
dataIndex
:
'inventory'
,
render
:
(
text
,
row
)
=>
{
return
(
<
div
>
{
row
.
inventory
-
row
.
consumption
}
<
/div
>
);
},
},
{
title
:
'操作'
,
...
...
@@ -300,9 +328,9 @@ class StoreMgt extends React.Component {
];
return
(
<
div
className
=
{
pageStyle
.
container
}
>
<
Row
gutter
=
{
16
}
>
<
Col
xs
=
{
10
}
sm
=
{
8
}
md
=
{
6
}
lg
=
{
4
}
xl
=
{
3
}
>
<
Button
onClick
=
{
this
.
addCoupon
}
type
=
"primary"
><
Icon
type
=
"credit-card"
/>
添加卡券
<
/Button></
Col
>
<
Col
xs
=
{
10
}
sm
=
{
8
}
md
=
{
6
}
lg
=
{
4
}
xl
=
{
3
}
>
<
Button
onClick
=
{()
=>
this
.
addGoods
()}
type
=
"primary"
><
Icon
type
=
"shopping"
/>
添加商品
<
/Button></
Col
>
<
Row
gutter
=
{
16
}
type
=
"flex"
justify
=
"start"
>
<
Col
>
<
Button
onClick
=
{
this
.
addCoupon
}
type
=
"primary"
><
Icon
type
=
"credit-card"
/>
添加卡券
<
/Button></
Col
>
<
Col
>
<
Button
onClick
=
{()
=>
this
.
addGoods
()}
type
=
"primary"
><
Icon
type
=
"shopping"
/>
添加商品
<
/Button></
Col
>
<
/Row
>
<
div
className
=
{
pageStyle
.
tablebox
}
>
<
Table
...
...
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