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
c9e1c443
Commit
c9e1c443
authored
Sep 03, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
91e5778c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
207 additions
and
8 deletions
+207
-8
api.js
src/common/api.js
+1
-0
classdetail.js
src/models/classdetail.js
+15
-1
login.js
src/models/login.js
+4
-2
usersetting.js
src/models/usersetting.js
+52
-1
EditClassModal.js
src/pages/classmgt/EditClassModal.js
+1
-1
index.js
src/pages/login/index.js
+1
-1
UpdateNickname.js
src/pages/usersetting/UpdateNickname.js
+85
-0
index.js
src/pages/usersetting/index.js
+39
-2
login.js
src/services/login.js
+9
-0
No files found.
src/common/api.js
View file @
c9e1c443
...
...
@@ -19,6 +19,7 @@ export default {
getVerifyCode
:
`
${
api
}
service/user/verify_code`
,
resetPassword
:
`
${
api
}
service/user/reset_password`
,
replenish
:
`
${
api
}
v1/user/replenish`
,
verifyCodeLogin
:
`
${
api
}
service/user/clock_login`
,
login
:
`
${
api
}
service/user/login`
,
videoupload
:
`
${
dakaapi
}
member/media_access`
,
imgupload
:
`
${
dakaapi
}
member/oss/access`
,
...
...
src/models/classdetail.js
View file @
c9e1c443
...
...
@@ -1183,7 +1183,7 @@ export default {
},
*
saveClass
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
classSubmitting
,
classId
}
=
yield
select
(
state
=>
state
.
classdetail
);
const
{
classSubmitting
,
classId
,
classDetail
}
=
yield
select
(
state
=>
state
.
classdetail
);
if
(
classSubmitting
)
{
return
;
}
...
...
@@ -1218,6 +1218,20 @@ export default {
yield
put
({
type
:
'queryClassDetail'
,
});
if
(
classDetail
.
course_id
!=
values
.
course_id
)
{
yield
put
({
type
:
'queryCoursePlansList'
,
payload
:
{
params
:
{},
},
});
yield
put
({
type
:
'queryClassStudentList'
,
payload
:
{
params
:
{},
},
});
}
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
...
...
src/models/login.js
View file @
c9e1c443
...
...
@@ -60,12 +60,15 @@ export default {
mobile
,
union_id
:
1
,
};
let
ajax
=
null
;
if
(
type
==
'verify'
)
{
param
.
verify_code
=
verifycode
;
ajax
=
login
.
verifyCodeLogin
;
}
else
{
param
.
password
=
password
;
ajax
=
login
.
login
;
}
const
loginData
=
yield
call
(
login
.
login
,
param
);
const
loginData
=
yield
call
(
ajax
,
param
);
// 判断用户是否完善信息
if
(
!
loginData
.
code
)
{
if
(
loginData
.
data
&&
loginData
.
data
.
token
)
{
...
...
@@ -80,7 +83,6 @@ export default {
logining
:
false
,
},
});
console
.
log
(
userInfo
,
'userInfo1'
);
if
(
newLoginData
.
code
==
200
)
{
if
(
newLoginData
.
data
&&
newLoginData
.
data
.
token
)
{
LocalStorage
.
setItem
(
'user'
,
{
...
...
src/models/usersetting.js
View file @
c9e1c443
...
...
@@ -39,6 +39,8 @@ export default {
previewQrcode
:
''
,
businessIsBind
:
false
,
checkoutVerifyCode
:
false
,
nicknameChangeShow
:
false
,
nicknameSubmitting
:
false
,
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
...
...
@@ -161,13 +163,62 @@ export default {
message
.
error
(
errorcode
[
data
.
code
].
cn
,
1
);
}
},
*
updateNickname
({
payload
},
{
call
,
put
,
select
})
{
const
{
nickname
,
callBack
}
=
payload
;
const
{
userInfo
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
nicknameSubmitting
}
=
yield
select
(
state
=>
state
.
usersetting
);
if
(
nicknameSubmitting
)
{
return
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
nicknameSubmitting
:
true
,
},
});
const
loading
=
message
.
loading
(
'昵称修改中...'
);
const
updateAvatarDate
=
yield
call
(
usersettingajax
.
updateAvatar
,
{
nickname
,
});
setTimeout
(
loading
);
yield
put
({
type
:
'updateState'
,
payload
:
{
nicknameSubmitting
:
false
,
},
});
if
(
updateAvatarDate
.
code
==
200
)
{
message
.
success
(
'修改成功'
,
1
);
userInfo
.
nickname
=
nickname
;
yield
put
({
type
:
'webapp/updateState'
,
payload
:
{
userInfo
:
{
...
userInfo
},
nicknameChangeShow
:
false
,
},
});
yield
put
({
type
:
'updateState'
,
payload
:
{
nicknameChangeShow
:
false
,
},
});
const
user
=
LocalStorage
.
getItem
(
'user'
);
user
.
nickname
=
nickname
;
LocalStorage
.
setItem
(
'user'
,
user
);
if
(
callBack
&&
(
typeof
callBack
==
'function'
))
{
callBack
();
}
}
else
{
message
.
error
(
'昵称修改失败'
);
}
},
*
updateUserAvatar
({
payload
},
{
call
,
put
,
select
})
{
const
{
userInfo
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
avatar
}
=
payload
;
const
loading
=
message
.
loading
(
'头像上传中...'
);
const
updateAvatarDate
=
yield
call
(
usersettingajax
.
updateAvatar
,
{
avatar
,
nickname
:
userInfo
.
nickname
,
});
setTimeout
(
loading
);
if
(
updateAvatarDate
.
code
==
200
)
{
...
...
src/pages/classmgt/EditClassModal.js
View file @
c9e1c443
...
...
@@ -117,7 +117,7 @@ class EditClassModal extends React.Component {
initialValue
:
editClassInfo
.
course_id
,
rules
:
[{
required
:
true
,
message
:
'课程不能为空'
}],
})(
(
is
Edit
==
1
||
is
StudentClass
==
1
)
?
(
isStudentClass
==
1
)
?
<
span
>
{
courseList
.
find
(
ele
=>
ele
.
id
==
editClassInfo
.
course_id
)
&&
courseList
.
find
(
ele
=>
ele
.
id
==
editClassInfo
.
course_id
).
title
}
<
/span>
:
<
Select
>
<
Option
value
=
""
>
请选择课程名称
<
/Option
>
...
...
src/pages/login/index.js
View file @
c9e1c443
...
...
@@ -75,7 +75,7 @@ class LoginForm extends React.Component {
dispatch
({
type
:
'register/getverifycode'
,
payload
:
{
type
:
4
,
type
:
5
,
mobile
,
dispatch
,
},
...
...
src/pages/usersetting/UpdateNickname.js
0 → 100644
View file @
c9e1c443
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
Row
,
Col
,
Modal
,
Form
,
Input
,
Button
,
message
}
from
'antd'
;
import
pageStyles
from
'./BindWx.less'
;
import
Cropper
from
'../../components/Cropper'
;
import
{
pageIn
,
imagify
}
from
'../../utils/index'
;
const
{
Search
}
=
Input
;
const
FormItem
=
Form
.
Item
;
class
UpdateNicknameForm
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
};
}
componentDidMount
()
{
}
componentWillUnmount
()
{
const
{
dispatch
}
=
this
.
props
;
}
sureBindWx
=
()
=>
{
const
{
form
,
updateNickname
}
=
this
.
props
;
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
updateNickname
(
values
,
()
=>
{
form
.
resetFields
();
});
}
});
}
onCancel
=
()
=>
{
const
{
form
,
onCancel
}
=
this
.
props
;
form
.
resetFields
();
onCancel
(
false
);
}
render
()
{
const
{
nickname
,
nicknameChangeShow
,
nicknameSubmitting
,
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
return
(
<
div
>
<
Modal
visible
=
{
nicknameChangeShow
}
title
=
"绑定微信"
okText
=
{
nicknameSubmitting
?
'提交中...'
:
'提交'
}
cancelText
=
"关闭"
zIndex
=
{
110
}
onOk
=
{
this
.
sureBindWx
}
onCancel
=
{
this
.
onCancel
}
maskClosable
=
{
false
}
confirmLoading
=
{
nicknameSubmitting
}
width
=
"540px"
>
<
Form
className
=
"modalform"
labelAlign
=
"left"
>
<
Form
.
Item
label
=
"昵称"
labelCol
=
{{
span
:
3
}}
wrapperCol
=
{{
span
:
21
}}
>
<
Row
gutter
=
{
8
}
>
<
Col
span
=
{
15
}
>
{
getFieldDecorator
(
'nickname'
,
{
initialValue
:
nickname
,
rules
:
[
{
required
:
true
,
message
:
'请输入昵称'
},
],
})(
<
Input
type
=
"text"
maxLength
=
{
20
}
placeholder
=
"请输入昵称"
/>
)}
<
/Col
>
<
/Row
>
<
/Form.Item
>
<
/Form
>
<
/Modal
>
<
/div
>
);
}
}
UpdateNicknameForm
.
propTypes
=
{
};
const
UpdateNickname
=
Form
.
create
()(
UpdateNicknameForm
);
export
default
UpdateNickname
;
src/pages/usersetting/index.js
View file @
c9e1c443
...
...
@@ -3,6 +3,7 @@ import { connect } from 'dva';
import
{
Row
,
Col
,
Modal
,
Form
,
Input
,
Button
,
message
}
from
'antd'
;
import
pageStyles
from
'./index.less'
;
import
BindWx
from
'./BindWx'
;
import
UpdateNickname
from
'./UpdateNickname'
;
import
Cropper
from
'../../components/Cropper'
;
import
QrcodeShow
from
'../../components/qrcodeShow'
;
import
{
pageIn
,
imagify
}
from
'../../utils/index'
;
...
...
@@ -201,6 +202,25 @@ class UserSettingForm extends React.Component {
},
});
}
updateNickname
=
(
value
,
callBack
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'usersetting/updateNickname'
,
payload
:
{
nickname
:
value
.
nickname
,
callBack
,
},
});
}
toupdateNickanem
=
(
visible
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'usersetting/updateState'
,
payload
:
{
nicknameChangeShow
:
visible
,
},
});
}
render
()
{
const
{
cropperboxShow
,
...
...
@@ -218,6 +238,8 @@ class UserSettingForm extends React.Component {
previewQrcode
,
businessIsBind
,
checkoutVerifyCode
,
nicknameChangeShow
,
nicknameSubmitting
,
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
return
(
...
...
@@ -243,11 +265,15 @@ class UserSettingForm extends React.Component {
<
/div
>
<
/div
>
<
div
className
=
{
pageStyles
.
infoline
}
>
<
div
className
=
{
pageStyles
.
infodetail
}
>
手
&
nbsp
;
&
nbsp
;
机
&
nbsp
;
&
nbsp
;
号
:
&
nbsp
;
&
nbsp
;{
userInfo
.
mobile
}
<
/div
>
<
div
className
=
{
pageStyles
.
infodetail
}
>
昵
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
称:
&
nbsp
;
&
nbsp
;{
userInfo
.
nickname
}
<
/div
>
<
div
className
=
{
pageStyles
.
infooperate
}
onClick
=
{()
=>
this
.
toupdateNickanem
(
true
)}
>
修改昵称
<
/div
>
<
/div
>
<
div
className
=
{
pageStyles
.
infoline
}
>
<
div
className
=
{
pageStyles
.
infodetail
}
>
手
&
nbsp
;
&
nbsp
;
机
&
nbsp
;
&
nbsp
;
号:
&
nbsp
;
&
nbsp
;{
userInfo
.
mobile
}
<
/div
>
<
div
className
=
{
pageStyles
.
infooperate
}
onClick
=
{()
=>
this
.
toResetPsd
(
true
)}
>
修改密码
<
/div
>
<
/div
>
<
div
className
=
{
pageStyles
.
infoline
}
>
<
div
className
=
{
pageStyles
.
infodetail
}
>
绑定微信
:
&
nbsp
;
&
nbsp
;{
businessIsBind
?
'已绑定'
:
'未绑定'
}
<
/div
>
<
div
className
=
{
pageStyles
.
infodetail
}
>
绑定微信
:
&
nbsp
;
&
nbsp
;{
businessIsBind
?
'已绑定'
:
'未绑定'
}
<
/div
>
{
!
businessIsBind
&&
<
div
className
=
{
pageStyles
.
infooperate
}
onClick
=
{()
=>
this
.
BindWxDiaVisible
(
true
)}
>
立即绑定
<
/div>
}
{
businessIsBind
&&
<
div
className
=
{
pageStyles
.
infooperate
}
style
=
{{
opacity
:
0
}}
>
立即绑定
<
/div>
}
<
/div
>
...
...
@@ -378,6 +404,13 @@ class UserSettingForm extends React.Component {
bindWxPost
=
{
this
.
bindWxPost
}
checkoutVerifyCode
=
{
checkoutVerifyCode
}
/
>
<
UpdateNickname
nickname
=
{
userInfo
.
nickname
}
updateNickname
=
{
this
.
updateNickname
}
nicknameChangeShow
=
{
nicknameChangeShow
}
onCancel
=
{()
=>
this
.
toupdateNickanem
(
false
)}
nicknameSubmitting
=
{
nicknameSubmitting
}
/
>
<
/Row
>
);
}
...
...
@@ -411,6 +444,8 @@ function mapStateToProps(state) {
previewQrcode
,
businessIsBind
,
checkoutVerifyCode
,
nicknameChangeShow
,
nicknameSubmitting
,
}
=
state
.
usersetting
;
return
{
cropperboxShow
,
...
...
@@ -430,6 +465,8 @@ function mapStateToProps(state) {
previewQrcode
,
businessIsBind
,
checkoutVerifyCode
,
nicknameChangeShow
,
nicknameSubmitting
,
};
}
export
default
connect
(
mapStateToProps
)(
UserSetting
);
src/services/login.js
View file @
c9e1c443
...
...
@@ -10,6 +10,15 @@ export function login(params) {
data
,
});
}
export
function
verifyCodeLogin
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
verifyCodeLogin
}
`
,
method
:
'POST'
,
needAuth
:
false
,
data
,
});
}
export
function
newLogin
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
...
...
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