Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
姜敏
9 years ago
Commit
f9a8b3a245bead1d41915f281d7b1c4bf710153a
1 parent
e454b065
完善注释
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
92 deletions
apps/me/controllers/account.js
apps/me/controllers/address.js
apps/me/controllers/setting.js
apps/me/models/currency.js
apps/me/models/setting.js
public/js/me/currency.page.js
public/js/me/setting.page.js
public/js/me/setting/step1.js
public/js/me/setting/step2.js
apps/me/controllers/account.js
View file @
f9a8b3a
...
...
@@ -14,12 +14,9 @@ const accountModel = require('../models/account');
*/
const
changePwd
=
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid||"20000190" ;
let
pwd
=
req
.
body
.
password
;
accountModel
.
changePwd
(
uid
,
pwd
).
then
(
result
=>
{
// console.log("修改result", result);
res
.
send
(
result
);
});
};
...
...
@@ -31,14 +28,10 @@ const changePwd = (req, res) => {
*/
const
checkVerifyMobile
=
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid||"20000190";
let
mobile
=
req
.
body
.
mobile
;
let
area
=
req
.
body
.
area
;
// console.log(uid, mobile, area);
accountModel
.
checkVerifyMobile
(
uid
,
mobile
,
area
).
then
(
result
=>
{
// console.log("验证手机号码", result);
res
.
send
(
result
);
});
};
...
...
@@ -50,14 +43,10 @@ const checkVerifyMobile = (req, res)=> {
*/
const
sendMobileMsg
=
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid||"20000190";
let
mobile
=
req
.
body
.
mobile
;
let
area
=
req
.
body
.
area
||
'+86'
;
// console.log(uid, mobile, area);
accountModel
.
sendMobileMsg
(
uid
,
mobile
,
area
).
then
(
result
=>
{
// console.log("发送短信result", result);
res
.
send
(
result
);
});
};
...
...
@@ -74,7 +63,6 @@ const checkVerifyMsg = (req, res)=> {
let
area
=
req
.
body
.
area
||
'+86'
;
accountModel
.
checkVerifyMsg
(
code
,
mobile
,
area
).
then
(
result
=>
{
// console.log("短信验证result", result);
res
.
send
(
result
);
});
};
...
...
@@ -86,12 +74,9 @@ const checkVerifyMsg = (req, res)=> {
*/
const
sendVerifyEmail
=
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid||"20000190";
let
email
=
req
.
body
.
email
;
accountModel
.
sendVerifyEmail
(
uid
,
email
).
then
(
result
=>
{
// console.log("发送验证邮件result", result);
res
.
send
(
result
);
});
};
...
...
apps/me/controllers/address.js
View file @
f9a8b3a
...
...
@@ -21,7 +21,7 @@ const _setDefault = (id, uid) => {
* 收货地址页面加载
*/
const
index
=
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
||
'20000190'
;
let
uid
=
req
.
user
.
uid
;
addressModel
.
getAddressDataAsync
(
uid
,
20
).
then
(
result
=>
{
let
resultData
=
result
.
data
?
result
.
data
:
result
;
...
...
apps/me/controllers/setting.js
View file @
f9a8b3a
...
...
@@ -15,7 +15,6 @@ const co = Promise.coroutine;
const
captchaUrl
=
helpers
.
urlFormat
(
'/passport/images'
,
{
t
:
Date
.
now
()});
// const captchaUrl = 'http://localhost:6003/passport/images?t=' + new Date().getTime();
// 根据type获取标题
...
...
@@ -75,8 +74,6 @@ const _getTitle = (type)=> {
const
index
=
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid || "20000190";
settingModel
.
getUserInfo
(
uid
).
then
(
result
=>
{
result
.
info
.
gender
?
result
.
genders
[
result
.
info
.
gender
-
1
].
checked
=
true
:
result
.
genders
[
2
].
checked
=
true
;
...
...
@@ -107,8 +104,6 @@ const index = (req, res, next) => {
*/
const
editUserInfo
=
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid || "20000190";
let
query
=
req
.
body
;
settingModel
.
editUserInfo
(
uid
,
query
).
then
(
result
=>
{
...
...
@@ -122,8 +117,6 @@ const editUserInfo = (req, res)=> {
* */
const
bindMobile
=
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid || "20000190";
let
type
=
req
.
params
.
type
;
settingModel
.
getUserInfo
(
uid
).
then
(
result
=>
{
...
...
@@ -132,8 +125,7 @@ const bindMobile = (req, res, next) => {
info
.
ellipsisMobile
=
info
.
verify_mobile
.
substring
(
0
,
3
)
+
'****'
+
info
.
verify_mobile
.
substring
(
7
,
11
);
info
.
checkCode
=
settingModel
.
cipheriv
(
info
.
uid
+
'.completeverify'
);
// info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
...
...
@@ -159,8 +151,6 @@ const bindMobile = (req, res, next) => {
const
bindEmail
=
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid || "20000190";
let
type
=
req
.
params
.
type
;
settingModel
.
getUserInfo
(
uid
).
then
(
result
=>
{
...
...
@@ -169,8 +159,6 @@ const bindEmail = (req, res, next) => {
info
.
ellipsisEmail
=
info
.
verify_email
.
substring
(
0
,
3
)
+
'****'
+
info
.
verify_email
.
substring
(
7
,
11
);
info
.
checkCode
=
settingModel
.
cipheriv
(
info
.
uid
+
'.completeverify'
);
// info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
...
...
@@ -194,10 +182,8 @@ const bindEmail = (req, res, next) => {
const
modifyPassword
=
(
req
,
res
)
=>
{
let
type
=
req
.
params
.
type
;
let
checkCode
=
settingModel
.
cipheriv
(
req
.
user
.
uid
+
'.completeverify'
);
// let checkCode = settingModel.cipheriv("20000190" + ".completeverify");
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
...
...
@@ -225,7 +211,6 @@ const edit = (req, res)=> {
let
codes
=
code
.
split
(
'.'
);
if
(
parseInt
(
codes
[
0
],
10
)
===
req
.
user
.
uid
&&
codes
[
1
]
===
'completeverify'
)
{
// if (codes[0] === "20000190" && codes[1] === "completeverify") {
let
result
=
{
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
...
...
@@ -233,10 +218,8 @@ const edit = (req, res)=> {
isShowEmail
:
_getTitle
(
type
).
isModifyEmail
||
_getTitle
(
type
).
isBindEmail
,
isShowPassword
:
_getTitle
(
type
).
isShowPassword
};
let
checkCode
=
settingModel
.
cipheriv
(
req
.
user
.
uid
+
'.completeoperate'
);
// let checkCode = settingModel.cipheriv("20000190"+ ".completeoperate");
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
...
...
@@ -267,7 +250,6 @@ const success = (req, res)=> {
let
codes
=
code
.
split
(
'.'
);
if
(
parseInt
(
codes
[
0
],
10
)
===
req
.
user
.
uid
&&
codes
[
1
]
===
'completeoperate'
)
{
// if (codes[0] === "20000190" && codes[1] === "completeoperate") {
let
result
=
{
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
...
...
@@ -302,8 +284,6 @@ const success = (req, res)=> {
const
validate1
=
(
req
,
res
)
=>
{
co
(
function
*
()
{
let
type
=
req
.
params
.
type
;
// let uid = req.user.uid || "20000190";
let
uid
=
req
.
user
.
uid
;
let
body
=
req
.
body
;
...
...
@@ -330,8 +310,6 @@ const validate2 = (req, res)=> {
co
(
function
*
()
{
let
type
=
req
.
params
.
type
;
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid || "20000190";
let
body
=
req
.
body
;
if
(
type
===
'password'
)
{
...
...
apps/me/models/currency.js
View file @
f9a8b3a
...
...
@@ -28,7 +28,6 @@ const yohoCoinList = (uid, page, queryType, beginTime) => {
queryType
:
queryType
,
beginTime
:
beginTime
}).
then
(
result
=>
{
// console.log("列表接口",result);
let
coinList
=
[];
let
total
=
false
;
let
curPage
=
1
;
...
...
@@ -97,16 +96,22 @@ const yohoCoinTotal = (uid)=> {
method
:
'app.yoho.yohocoin'
,
uid
:
uid
}).
then
(
result
=>
{
// console.log("总数接口",result);
return
result
;
});
};
/**
* 获取yoho币相关数据
* @param uid
* @param page
* @param queryType
* @param beginTime
* @returns {*}
*/
const
getIndexData
=
(
uid
,
page
,
queryType
,
beginTime
)
=>
{
let
getData
=
[
yohoCoinList
(
uid
,
page
,
queryType
,
beginTime
),
yohoCoinTotal
(
uid
)];
return
Promise
.
all
(
getData
).
then
(
result
=>
{
// console.log("合并接口", result);
return
{
list
:
result
[
0
],
num
:
result
[
1
]
...
...
apps/me/models/setting.js
View file @
f9a8b3a
...
...
@@ -10,7 +10,7 @@ const api = global.yoho.API;
const
crypto
=
require
(
'crypto'
);
/**
* 查询个人信息
* 查询个人
详细
信息
* @param uid
* @returns {*}
*/
...
...
@@ -45,6 +45,12 @@ const _getUserInfo = (uid) => {
});
};
/**
* 查询个人联系信息
* @param uid
* @returns {*}
* @private
*/
const
_getUserContactInfo
=
(
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'web.passport.getUserContacts'
,
...
...
@@ -52,6 +58,11 @@ const _getUserContactInfo = (uid)=> {
}).
then
(
result
=>
result
.
data
);
};
/**
* 合并查询个人信息
* @param uid
* @returns {*}
*/
const
getUserInfo
=
(
uid
)
=>
{
let
getData
=
[
_getUserInfo
(
uid
),
_getUserContactInfo
(
uid
)];
...
...
@@ -64,14 +75,23 @@ const getUserInfo = (uid) => {
});
};
const
getVerifyInfo
=
(
uid
)
=>
{
/*
const getVerifyInfo = (uid)=> {
return api.get('', {
method: 'web.passport.getUserVerifyInfo',
uid: uid
}).then(result => result);
};
};*/
/**
* 编辑个人详细信息
* @param uid
* @param nickName
* @param username
* @param gender
* @param birthday
* @returns {*}
* @private
*/
const
_editInfo
=
(
uid
,
nickName
,
username
,
gender
,
birthday
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.passport.modifyBase'
,
...
...
@@ -83,6 +103,16 @@ const _editInfo = (uid, nickName, username, gender, birthday)=> {
}).
then
(
result
=>
result
);
};
/**
* 编辑个人联系信息
* @param uid
* @param areaCode
* @param mobile
* @param fullAddress
* @param zipCode
* @returns {*}
* @private
*/
const
_editUserContactInfo
=
(
uid
,
areaCode
,
mobile
,
fullAddress
,
zipCode
)
=>
{
return
api
.
get
(
''
,
{
method
:
'web.passport.modifyUserContacts'
,
...
...
@@ -94,6 +124,12 @@ const _editUserContactInfo = (uid, areaCode, mobile, fullAddress, zipCode)=> {
}).
then
(
result
=>
result
);
};
/**
* 合并编辑个人信息
* @param uid
* @param info
* @returns {*}
*/
const
editUserInfo
=
(
uid
,
info
)
=>
{
let
getData
=
[
_editInfo
(
uid
,
info
.
nick_name
,
info
.
username
,
info
.
gender
,
info
.
birthday
),
...
...
@@ -145,7 +181,6 @@ const decipheriv = (data) => {
module
.
exports
=
{
getUserInfo
:
getUserInfo
,
getVerifyInfo
:
getVerifyInfo
,
editUserInfo
:
editUserInfo
,
cipheriv
:
cipheriv
,
decipheriv
:
decipheriv
...
...
public/js/me/currency.page.js
View file @
f9a8b3a
...
...
@@ -4,6 +4,7 @@
* @date: 2016/07/11
*/
const
moment
=
require
(
'moment'
);
//时间格式化
const
convertUnitTime
=
(
src
)
=>
{
return
moment
.
unix
(
src
).
format
(
'YYYY-MM-DD'
);
...
...
@@ -13,11 +14,12 @@ var beginTime = convertUnitTime(new Date() / 1000 - 3600 * 24 * 90);
var
type
=
0
;
var
page
=
1
;
var
Bll
=
{
getQueryString
:
function
()
{
//获取路由中的请求参数
getQueryString
:
function
()
{
let
queryArr
=
location
.
search
.
substr
(
1
).
split
(
'&'
);
let
query
=
{};
queryArr
.
forEach
(
function
(
pair
)
{
queryArr
.
forEach
(
function
(
pair
)
{
let
arr
=
pair
.
split
(
'='
);
query
[
arr
[
0
]]
=
arr
[
1
];
...
...
@@ -29,7 +31,7 @@ var Bll = {
paying
:
1
,
delivering
:
2
},
getDataList
:
function
(
type1
,
page1
,
beginTime1
)
{
getDataList
:
function
(
type1
,
page1
,
beginTime1
)
{
let
query
=
[
'page='
+
page1
,
'queryType='
+
type1
,
'beginTime='
+
beginTime1
];
location
.
search
=
query
.
join
(
'&'
);
...
...
@@ -40,7 +42,7 @@ require('./me');
// tab切换
$
(
'.tabs li'
).
on
(
'click'
,
function
()
{
$
(
'.tabs li'
).
on
(
'click'
,
function
()
{
let
$this
=
$
(
this
);
type
=
Bll
.
typeMap
[
$this
.
data
(
'type'
)];
...
...
@@ -54,7 +56,9 @@ $('.tabs li').on('click', function() {
}
});
$
(
'#begin-time'
).
on
(
'change'
,
function
()
{
//时间控件切换
$
(
'#begin-time'
).
on
(
'change'
,
function
()
{
let
months
=
parseInt
(
$
(
this
).
val
(),
10
);
type
=
Bll
.
getQueryString
().
queryType
||
1
;
...
...
public/js/me/setting.page.js
View file @
f9a8b3a
...
...
@@ -9,7 +9,7 @@ var _dialog = dialog.Dialog;
var
_alert
=
dialog
.
Alert
;
var
Bll
=
{
setIcon
:
function
()
{
setIcon
:
function
()
{
var
html
=
[];
html
.
push
(
'<form id="upload_form" method="post" action="" onsubmit="return checkForm()">'
);
...
...
@@ -27,7 +27,7 @@ var Bll = {
return
html
.
join
(
''
);
},
validate
:
function
(
info
)
{
validate
:
function
(
info
)
{
var
regBirth
=
new
RegExp
(
/^
[
1-2
][
0-9
][
0-9
][
0-9
]
-
[
0-1
]{0,1}[
0-9
]
-
[
0-3
]{0,1}[
0-9
]
$/
);
var
regName
=
new
RegExp
(
/^
[\u
4e00-
\u
9fa5_-a-zA-Z0-9
]
+$/
);
var
birthdayForm
=
$
(
'#birthday'
);
...
...
@@ -55,14 +55,14 @@ require('../me/setting/step3');
// 编辑头像移入移出切换效果
$
(
'.user-icon'
).
hover
(
function
()
{
$
(
'.user-icon'
).
hover
(
function
()
{
$
(
this
).
find
(
'.show-ico '
).
addClass
(
'hide'
).
end
().
find
(
'.edit-ico'
).
removeClass
(
'hide'
);
},
function
()
{
},
function
()
{
$
(
this
).
find
(
'.show-ico'
).
removeClass
(
'hide'
).
end
().
find
(
'.edit-ico'
).
addClass
(
'hide'
);
});
// 编辑头像打开弹框
$
(
document
).
on
(
'click'
,
'.edit-ico'
,
function
()
{
$
(
document
).
on
(
'click'
,
'.edit-ico'
,
function
()
{
var
tip
=
new
_dialog
({
className
:
'settled-success'
,
title
:
'自定义头像'
,
...
...
@@ -72,7 +72,7 @@ $(document).on('click', '.edit-ico', function() {
id
:
'apply'
,
btnClass
:
[
'apply'
],
name
:
'保存'
,
cb
:
function
()
{
cb
:
function
()
{
tip
.
close
();
}
},
...
...
@@ -80,7 +80,7 @@ $(document).on('click', '.edit-ico', function() {
id
:
'cancel'
,
btnClass
:
[
'cancel'
],
name
:
'取消'
,
cb
:
function
()
{
cb
:
function
()
{
tip
.
close
();
}
}
...
...
@@ -89,7 +89,7 @@ $(document).on('click', '.edit-ico', function() {
});
$
(
document
).
on
(
'change'
,
'#avatar'
,
function
()
{
$
(
document
).
on
(
'change'
,
'#avatar'
,
function
()
{
/* var oFile = $("#avatar")[0].files[0];
var oImage = document.getElementById('post-picture');
var oReader = new FileReader();
...
...
@@ -102,7 +102,7 @@ $(document).on('change', '#avatar', function() {
});
$
(
function
()
{
$
(
function
()
{
var
address
=
cascadingAddress
({
el
:
'#address'
});
var
areaCode
=
$
(
'#area_code'
).
val
();
...
...
@@ -115,7 +115,7 @@ $(function() {
$
(
'.input-radio'
).
check
({
type
:
'radio'
,
group
:
'genders'
,
onChange
:
function
(
ele
,
checked
,
value
)
{
onChange
:
function
(
ele
,
checked
,
value
)
{
var
gender
=
$
(
'#gender'
).
val
();
checked
?
$
(
'#gender'
).
val
(
value
)
:
$
(
'#gender'
).
val
(
gender
);
...
...
@@ -125,7 +125,7 @@ $(function() {
/**
* 保存修改
*/
$
(
document
).
on
(
'click'
,
'#save-settings'
,
function
()
{
$
(
document
).
on
(
'click'
,
'#save-settings'
,
function
()
{
var
area
=
address
.
getAreaIds
();
var
body
=
{
...
...
@@ -134,11 +134,9 @@ $(function() {
gender
:
$
(
'#gender'
).
val
(),
birthday
:
$
(
'#birthday'
).
val
(),
area_code
:
area
.
split
(
','
)[
2
],
// todo 手机号码老接口必填
mobile
:
$
(
'#infoMobile'
).
val
(),
full_address
:
$
(
'#full_address'
).
val
(),
// todo 邮编老接口必填字段
zip_code
:
$
(
'#zip_code'
).
val
()
||
'210000'
};
...
...
@@ -149,10 +147,10 @@ $(function() {
url
:
'/me/setting/editUserInfo'
,
dataType
:
'json'
,
data
:
body
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
len
=
0
;
data
.
forEach
(
function
(
x
)
{
data
.
forEach
(
function
(
x
)
{
if
(
x
.
code
===
200
)
{
len
++
;
}
...
...
@@ -167,5 +165,3 @@ $(function() {
}
});
});
...
...
public/js/me/setting/step1.js
View file @
f9a8b3a
...
...
@@ -7,7 +7,7 @@ var $imgCaptchaInput = $('#captcha');
var
dialog
=
require
(
'../../plugins/dialog'
);
var
_alert
=
dialog
.
Alert
;
var
types
=
location
.
pathname
.
split
(
'/'
);
var
type
=
types
[
types
.
length
-
1
];
var
type
=
types
[
types
.
length
-
1
];
//界面操作类型
/**
...
...
@@ -58,6 +58,7 @@ $sms.click(function() {
});
});
//手机验证第一步提交
$
(
'#mobile-step1'
).
click
(
function
()
{
var
code
=
$
(
'#msg-code'
).
val
().
trim
();
var
mobile
=
$
(
'#real-mobile'
).
val
();
...
...
public/js/me/setting/step2.js
View file @
f9a8b3a
...
...
@@ -7,12 +7,12 @@ var dialog = require('../../plugins/dialog');
var
_alert
=
dialog
.
Alert
;
var
regValidate
=
require
(
'../../passport/common/mail-phone-regx'
);
var
types
=
location
.
pathname
.
split
(
'/'
);
var
type
=
types
[
types
.
length
-
1
];
var
type
=
types
[
types
.
length
-
1
];
//界面操作类型
var
$imgCaptchaInput
=
$
(
'#captcha'
);
var
second
=
60
;
var
$sms
=
$
(
'#send-code2'
);
// 发送短信验证码按钮
// 发送短信后倒计时显示
var
disableSMSBtn
=
function
()
{
var
disableSMSBtn
=
function
()
{
second
-=
1
;
if
(
second
<
0
)
{
second
=
60
;
...
...
@@ -27,7 +27,7 @@ var disableSMSBtn = function() {
};
// 校验手机号码格式
var
validatePhoneNumLocal
=
function
(
phoneNum
)
{
var
validatePhoneNumLocal
=
function
(
phoneNum
)
{
var
length
=
phoneNum
.
length
;
if
(
length
===
0
)
{
...
...
@@ -42,14 +42,14 @@ var validatePhoneNumLocal = function(phoneNum) {
};
/**
* 绑定手机号码
* 绑定手机号码
部分
*/
$
(
'#region'
).
on
(
'change'
,
function
()
{
$
(
'#region'
).
on
(
'change'
,
function
()
{
$
(
'#country-code'
).
text
(
$
(
this
).
val
());
});
// 校验手机号码
$
(
'#real-mobile'
).
blur
(
function
()
{
$
(
'#real-mobile'
).
blur
(
function
()
{
var
mobile
=
$
(
this
).
val
();
var
area
=
$
(
'#country-code'
).
text
();
var
self
=
$
(
'#real-mobile'
).
parent
();
...
...
@@ -63,7 +63,7 @@ $('#real-mobile').blur(function() {
mobile
:
mobile
,
area
:
area
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
self
.
find
(
'.tips-success'
).
addClass
(
'ok'
).
show
();
self
.
find
(
'.tips-error'
).
removeClass
(
'notok'
).
hide
();
...
...
@@ -79,7 +79,7 @@ $('#real-mobile').blur(function() {
// 发送手机验证码
$sms
.
click
(
function
()
{
$sms
.
click
(
function
()
{
var
mobile
=
$
(
'#real-mobile'
).
val
();
var
area
=
$
(
'#country-code'
).
text
();
...
...
@@ -95,7 +95,7 @@ $sms.click(function() {
mobile
:
mobile
,
area
:
area
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
!==
200
)
{
new
_alert
(
data
.
message
).
show
();
$sms
.
removeClass
(
'disable'
);
...
...
@@ -106,7 +106,8 @@ $sms.click(function() {
});
});
$
(
'#mobile-step2'
).
click
(
function
()
{
//绑定手机第二步提交
$
(
'#mobile-step2'
).
click
(
function
()
{
var
code
=
$
(
'#msg-code'
).
val
();
var
mobile
=
$
(
'#real-mobile'
).
val
();
var
self
=
$
(
'#msg-code'
).
parent
();
...
...
@@ -120,7 +121,7 @@ $('#mobile-step2').click(function() {
mobile
:
mobile
,
area
:
area
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
self
.
find
(
'.tips-success'
).
addClass
(
'ok'
).
show
();
self
.
find
(
'.tips-error'
).
removeClass
(
'notok'
).
hide
();
...
...
@@ -136,10 +137,10 @@ $('#mobile-step2').click(function() {
/**
* 修改密码
* 修改密码
部分
*/
// 输入确认密码
$
(
'#checkPwd'
).
blur
(
function
()
{
$
(
'#checkPwd'
).
blur
(
function
()
{
var
newPwd
=
$
(
'#newPwd'
).
val
().
trim
();
var
checkPwd
=
$
(
this
).
val
().
trim
();
var
self
=
$
(
this
).
parent
();
...
...
@@ -154,14 +155,14 @@ $('#checkPwd').blur(function() {
});
// 校验图片验证码
$imgCaptchaInput
.
blur
(
function
()
{
$imgCaptchaInput
.
blur
(
function
()
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/passport/images/check'
,
data
:
{
verifyCode
:
$imgCaptchaInput
.
val
()
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
$imgCaptchaInput
.
parent
().
find
(
'.tips-success'
).
addClass
(
'ok'
).
show
();
$imgCaptchaInput
.
parent
().
find
(
'.tips-error'
).
removeClass
(
'notok'
).
hide
();
...
...
@@ -174,7 +175,7 @@ $imgCaptchaInput.blur(function() {
});
// 提交修改密码
$
(
'#step2-pwd'
).
click
(
function
()
{
$
(
'#step2-pwd'
).
click
(
function
()
{
var
password
=
$
(
'#newPwd'
).
val
();
if
(
$
(
'.notok'
).
length
===
0
)
{
...
...
@@ -184,11 +185,10 @@ $('#step2-pwd').click(function() {
data
:
{
password
:
password
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/setting/step3/'
+
type
+
'?checkCode='
+
$
(
'#checkCode'
).
val
();
}
else
{
// location.href = '/me/setting/step3/' + type + "?checkCode=" + $("#checkCode").val();
new
_alert
(
data
.
message
).
show
();
}
}
...
...
Please
register
or
login
to post a comment