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
96a7b808
Commit
96a7b808
authored
Sep 25, 2019
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学员消课购课优化
parent
756466c6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
48 deletions
+111
-48
api.js
src/common/api.js
+8
-8
createtheme.js
src/models/createtheme.js
+0
-3
index.js
src/pages/classdetail/index.js
+9
-0
RenewEdit.js
src/pages/student/RenewEdit.js
+6
-6
eliminateEdit.js
src/pages/student/eliminateEdit.js
+81
-30
index.js
src/pages/student/index.js
+7
-1
No files found.
src/common/api.js
View file @
96a7b808
...
...
@@ -4,15 +4,15 @@ const basepath = `${location.protocol}//${pathify(window.location.host)}/`;
let
api
=
''
;
let
dakaapi
=
''
;
if
(
ENVIRONMENT
==
'pro'
)
{
//
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/'
;
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://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/';
api
=
'https://test.wp53.cn/v2/api/'
;
dakaapi
=
'https:clock.wp53.cn/v3/'
;
}
else
if
(
ENVIRONMENT
==
'testenv'
)
{
api
=
'https://test.wp53.cn/v2/api/'
;
dakaapi
=
'https:clock.wp53.cn/v3/'
;
...
...
src/models/createtheme.js
View file @
96a7b808
...
...
@@ -133,7 +133,6 @@ export default {
let
new_rest_dates
=
[];
new_rest_dates
=
[...
new
Set
(
new_rest_dates
.
concat
(...
rest_dates
))];
const
loadmessage
=
message
.
loading
(
'保存中...'
,
0
);
console
.
log
(
new_rest_dates
,
'rest_datesd提交的数据'
);
for
(
let
i
=
0
;
i
<
new_rest_dates
.
length
;
i
++
)
{
new_rest_dates
[
i
]
=
moment
(
new_rest_dates
[
i
]).
format
(
'YYYY-M-DD'
);
}
...
...
@@ -240,7 +239,6 @@ export default {
}
}
}
console
.
log
(
newWeekDay
,
'删除后的数据'
);
yield
put
({
type
:
'updateState'
,
payload
:
{
...
...
@@ -484,7 +482,6 @@ export default {
type
:
'img'
,
value
:
imageUrl
,
});
console
.
log
(
jobParams
,
'jobParams'
);
yield
put
({
type
:
'updateState'
,
payload
:
{
...
...
src/pages/classdetail/index.js
View file @
96a7b808
...
...
@@ -884,6 +884,15 @@ class ClassDetailForm extends React.Component {
},
});
}
toDetail
=
(
id
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'classdetail/toDetail'
,
payload
:
{
id
,
},
});
}
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
...
...
src/pages/student/RenewEdit.js
View file @
96a7b808
...
...
@@ -236,7 +236,7 @@ class RenewEdit extends React.Component {
<
div
className
=
{
pageStyle
.
buytimebox
}
>
<
Col
className
=
{
pageStyle
.
course
}
>
<
Form
.
Item
label
=
"购买
课时
"
label
=
"购买
天数
"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
...
...
@@ -250,18 +250,18 @@ class RenewEdit extends React.Component {
rules
:
[
{
required
:
false
,
message
:
'请输入购买
课时
'
,
message
:
'请输入购买
天数
'
,
},
],
})(
<
InputNumber
placeholder
=
"请输入购买
课时
"
style
=
{{
width
:
200
}}
/>
,
<
InputNumber
placeholder
=
"请输入购买
天数
"
style
=
{{
width
:
200
}}
/>
,
)}
&
nbsp
;
&
nbsp
;
天
<
/Form.Item
>
<
/Col
>
<
Col
className
=
{
pageStyle
.
course
}
>
<
Form
.
Item
label
=
"赠送
课时
"
label
=
"赠送
天数
"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
...
...
@@ -275,11 +275,11 @@ class RenewEdit extends React.Component {
rules
:
[
{
required
:
false
,
message
:
'请输入赠送
课时
'
,
message
:
'请输入赠送
天数
'
,
},
],
})(
<
InputNumber
placeholder
=
"请输入赠送
课时
"
style
=
{{
width
:
200
}}
/>
,
<
InputNumber
placeholder
=
"请输入赠送
天数
"
style
=
{{
width
:
200
}}
/>
,
)}
&
nbsp
;
&
nbsp
;
天
<
/Form.Item
>
...
...
src/pages/student/eliminateEdit.js
View file @
96a7b808
...
...
@@ -7,8 +7,14 @@ const { Option } = Select;
const
{
TextArea
}
=
Input
;
class
eliminateEdit
extends
React
.
Component
{
state
=
{
currentCourse
:
{},
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
currentCourse
:
{
course_mode
:
1
,
},
expendValue
:
0
,
};
}
componentDidMount
()
{
// 挂载
}
...
...
@@ -32,6 +38,12 @@ class eliminateEdit extends React.Component {
...
values
,
course_mode
:
this
.
state
.
currentCourse
.
course_mode
,
});
this
.
setState
({
currentCourse
:
{
surplus
:
0
,
},
expendValue
:
0
,
});
}
});
}
...
...
@@ -43,13 +55,25 @@ class eliminateEdit extends React.Component {
});
}
close
=
()
=>
{
const
{
close
,
form
}
=
this
.
props
;
const
{
close
,
form
,
dispatch
}
=
this
.
props
;
form
.
resetFields
();
this
.
setState
({
currentCourse
:
{},
currentCourse
:
{
surplus
:
0
,
},
});
close
();
}
expendChange
=
(
e
)
=>
{
const
{
currentCourse
}
=
this
.
state
;
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
this
.
setState
({
expendValue
:
Number
(
currentCourse
.
surplus
-
Number
(
e
.
target
.
value
)),
});
}
});
}
render
()
{
const
{
visible
,
...
...
@@ -60,9 +84,9 @@ class eliminateEdit extends React.Component {
operator
,
toChangeOperator
,
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
getFieldDecorator
,
getFieldValue
}
=
this
.
props
.
form
;
const
courseExcludeClassTypeList
=
(
studentinfo
.
student_courses
&&
studentinfo
.
student_courses
.
filter
(
ele
=>
ele
.
course_mode
!=
3
))
||
[];
const
{
currentCourse
}
=
this
.
state
;
const
{
currentCourse
,
expendValue
}
=
this
.
state
;
return
(
<
Modal
visible
=
{
visible
}
...
...
@@ -81,11 +105,11 @@ class eliminateEdit extends React.Component {
label
=
"已购课程"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
sm
:
{
span
:
5
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
20
},
sm
:
{
span
:
19
},
}}
>
{
getFieldDecorator
(
'student_course_id'
,
{
...
...
@@ -95,33 +119,37 @@ class eliminateEdit extends React.Component {
{
courseExcludeClassTypeList
.
map
(
ele
=>
<
Option
value
=
{
ele
.
id
}
>
{
ele
.
course
.
title
}
<
/Option>
)
}
<
/Select>
)
}
<
/Form.Item
>
<
Form
.
Item
label
=
"剩余课时"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
20
},
}}
>
{
currentCourse
.
course_mode
==
1
&&
{
getFieldValue
(
'student_course_id'
)
!=
undefined
?
(
<
Form
.
Item
label
=
"当前剩余"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
19
},
}}
>
{
currentCourse
.
course_mode
==
1
&&
<
span
>
{
currentCourse
.
surplus
||
0
}
课时
<
/span
>
}
{
currentCourse
.
course_mode
==
2
&&
}
{
currentCourse
.
course_mode
==
2
&&
<
span
>
{
currentCourse
.
surplus
||
0
}
天
<
/span
>
}
<
/Form.Item
>
}
<
/Form.Item
>
)
:
(
''
)}
<
Form
.
Item
label
=
"
消耗课时
"
label
=
"
本次消耗
"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
sm
:
{
span
:
5
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
20
},
sm
:
{
span
:
19
},
}}
>
{
getFieldDecorator
(
'expend'
,
{
...
...
@@ -141,18 +169,41 @@ class eliminateEdit extends React.Component {
},
],
})(
<
InputNumber
placeholder
=
"请输入消课次数
"
style
=
{{
width
:
200
}}
/>
,
<
InputNumber
onBlur
=
{
e
=>
this
.
expendChange
(
e
)}
placeholder
=
"请输入消课数量
"
style
=
{{
width
:
200
}}
/>
,
)}
<
span
className
=
"ant-form-text"
>
{
currentCourse
.
course_mode
===
1
?
'课时'
:
'天'
}
<
/span
>
<
/Form.Item
>
{
getFieldValue
(
'student_course_id'
)
!=
undefined
?
(
<
Form
.
Item
label
=
"消耗后剩余"
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
19
},
}}
>
{
currentCourse
.
course_mode
==
1
&&
<
span
>
{
expendValue
||
0
}
课时
<
/span
>
}
{
currentCourse
.
course_mode
==
2
&&
<
span
>
{
expendValue
||
0
}
天
<
/span
>
}
<
/Form.Item
>
)
:
(
''
)}
<
Form
.
Item
label
=
{
<
span
>&
nbsp
;
&
nbsp
;
操
&
nbsp
;
&
nbsp
;
作
&
nbsp
;
&
nbsp
;
人
<
/span>
}
labelCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
4
},
sm
:
{
span
:
5
},
}}
wrapperCol
=
{{
xs
:
{
span
:
24
},
sm
:
{
span
:
20
},
sm
:
{
span
:
19
},
}}
>
{
getFieldDecorator
(
'operator_id'
,
{
...
...
src/pages/student/index.js
View file @
96a7b808
...
...
@@ -151,7 +151,7 @@ class StudentMgt extends React.Component {
values
,
},
});
//
form.resetFields();
form
.
resetFields
();
}
sureRenewCourse
=
(
values
,
callBack
)
=>
{
const
{
dispatch
}
=
this
.
props
;
...
...
@@ -234,6 +234,12 @@ class StudentMgt extends React.Component {
selectdeStudent
:
record
,
},
});
dispatch
({
type
:
'students/studentsList'
,
payload
:
{
params
:
{},
},
});
}
searchCourseRelateClass
=
(
courseId
,
callBack
)
=>
{
const
{
dispatch
}
=
this
.
props
;
...
...
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