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
Plain Diff
Browse Files
Authored by
姜枫
9 years ago
Commit
ae37f4510581da3178f12d0f79512f0922ecd71d
2 parents
175f351c
5e397519
pay online page
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
301 additions
and
244 deletions
apps/me/controllers/account.js
apps/me/controllers/order.js
apps/me/controllers/setting.js
apps/me/router.js
apps/me/views/action/index.hbs
apps/me/views/partial/setting/act/step1.hbs
apps/me/views/partial/setting/act/step2.hbs
apps/me/views/partial/setting/act/step3.hbs
apps/me/views/partial/setting/content.hbs
apps/shopping/controllers/pay.js
apps/shopping/helpers/sign.js
apps/shopping/models/order.js
apps/shopping/models/pay.js
apps/shopping/router.js
apps/shopping/views/action/pay.hbs
public/js/me/setting.page.js
public/js/me/setting/step1.js
public/js/me/setting/step2.js
public/scss/editorial/_index.css
public/scss/me/setting/_act.css
apps/me/controllers/account.js
View file @
ae37f45
...
...
@@ -13,7 +13,9 @@ const accountModel = require('../models/account');
* @param res
*/
const
changePwd
=
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
||
'20000190'
;
let
uid
=
req
.
user
.
uid
;
// let uid = req.user.uid||"20000190" ;
let
pwd
=
req
.
body
.
password
;
accountModel
.
changePwd
(
uid
,
pwd
).
then
(
result
=>
{
...
...
@@ -29,6 +31,8 @@ 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
;
...
...
@@ -46,6 +50,8 @@ 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'
;
...
...
@@ -80,6 +86,8 @@ 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
=>
{
...
...
apps/me/controllers/order.js
View file @
ae37f45
...
...
@@ -12,10 +12,10 @@ const orderModel = require('../models/order');
/**
* 我的订单
*/
const
index
=
(
req
,
res
,
next
)
=>
{
const
index
=
(
req
,
res
)
=>
{
const
type
=
req
.
query
.
type
;
const
page
=
req
.
query
.
page
;
const
uid
=
global
.
yoho
.
uid
||
'13549567'
;
const
uid
=
req
.
user
.
uid
||
'13549567'
;
orderModel
.
getOrderData
(
uid
,
type
,
page
).
then
(
result
=>
{
res
.
display
(
'index'
,
{
...
...
@@ -27,12 +27,12 @@ const index = (req, res, next) => {
banner
:
'http://placehold.it/{width}x{height}'
},
result
)
});
})
.
catch
(
next
)
;
});
};
const
detail
=
(
req
,
res
,
next
)
=>
{
const
detail
=
(
req
,
res
)
=>
{
const
code
=
req
.
query
.
code
;
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
uid
=
req
.
user
.
uid
||
'7394907'
;
orderModel
.
getOrderDetail
(
uid
,
code
).
then
(
result
=>
{
res
.
display
(
'index'
,
{
...
...
@@ -44,13 +44,13 @@ const detail = (req, res, next) => {
banner
:
'http://placehold.it/{width}x{height}'
},
result
)
});
})
.
catch
(
next
)
;
});
};
const
getOrderList
=
(
req
,
res
,
next
)
=>
{
const
getOrderList
=
(
req
,
res
)
=>
{
const
type
=
req
.
query
.
type
;
const
page
=
req
.
query
.
page
;
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
uid
=
req
.
user
.
uid
||
'7394907'
;
orderModel
.
getOrderData
(
uid
,
type
,
page
).
then
(
result
=>
{
res
.
display
(
'order-table'
,
{
...
...
@@ -58,16 +58,14 @@ const getOrderList = (req, res, next) => {
page
:
'order'
,
isMe
:
true
,
orderList
:
result
.
order
.
orderList
,
paginationOpts
:
result
.
order
.
paginationOpts
,
emptyMsg
:
result
.
order
.
emptyMsg
,
showEmptyEn
:
result
.
order
.
showEmptyEn
paginationOpts
:
result
.
order
.
paginationOpts
});
})
.
catch
(
next
)
;
});
};
const
getOrderTotal
=
(
req
,
res
,
next
)
=>
{
const
getOrderTotal
=
(
req
,
res
)
=>
{
const
type
=
req
.
query
.
type
;
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
uid
=
req
.
user
.
uid
||
'7394907'
;
orderModel
.
getOrderData
(
uid
,
type
).
then
(
result
=>
{
...
...
@@ -76,44 +74,44 @@ const getOrderTotal = (req, res, next) => {
total
:
result
.
order
.
total
,
type
:
result
.
order
.
type
});
})
.
catch
(
next
)
;
});
};
const
cancelOrder
=
(
req
,
res
,
next
)
=>
{
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
data
=
req
.
query
;
const
cancelOrder
=
(
req
,
res
)
=>
{
const
uid
=
req
.
user
.
uid
||
'7394907'
;
const
code
=
req
.
query
.
orderCode
;
orderModel
.
cancelOrder
(
uid
,
data
).
then
(
result
=>
{
orderModel
.
cancelOrder
(
uid
,
code
).
then
(
result
=>
{
res
.
json
(
result
);
})
.
catch
(
next
)
;
});
};
const
deleteOrder
=
(
req
,
res
,
next
)
=>
{
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
deleteOrder
=
(
req
,
res
)
=>
{
const
uid
=
req
.
user
.
uid
||
'7394907'
;
const
code
=
req
.
query
.
orderCode
;
orderModel
.
deleteOrder
(
uid
,
code
).
then
(
result
=>
{
res
.
json
(
result
);
})
.
catch
(
next
)
;
});
};
const
getExpressInfo
=
(
req
,
res
,
next
)
=>
{
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
getExpressInfo
=
(
req
,
res
)
=>
{
const
uid
=
req
.
user
.
uid
||
'7394907'
;
const
code
=
req
.
query
.
orderCode
;
orderModel
.
getExpressInfo
(
uid
,
code
).
then
(
result
=>
{
res
.
json
(
result
);
})
.
catch
(
next
)
;
});
};
const
getCancelOrderReason
=
(
req
,
res
,
next
)
=>
{
const
getCancelOrderReason
=
(
req
,
res
)
=>
{
orderModel
.
getCancelOrderReason
().
then
(
result
=>
{
res
.
json
(
result
);
})
.
catch
(
next
)
;
});
};
const
editOrder
=
(
req
,
res
)
=>
{
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
uid
=
req
.
user
.
uid
||
'7394907'
;
const
query
=
req
.
query
;
query
.
uid
=
uid
;
...
...
@@ -123,16 +121,6 @@ const editOrder = (req, res) => {
});
};
const
reAddCart
=
(
req
,
res
)
=>
{
const
uid
=
global
.
yoho
.
uid
||
'7394907'
;
const
code
=
req
.
query
.
orderCode
;
orderModel
.
reAddCart
(
uid
,
code
).
then
(
result
=>
{
res
.
json
(
result
);
});
};
module
.
exports
=
{
index
:
index
,
detail
:
detail
,
...
...
@@ -142,6 +130,5 @@ module.exports = {
deleteOrder
:
deleteOrder
,
editOrder
:
editOrder
,
getExpressInfo
:
getExpressInfo
,
getCancelOrderReason
:
getCancelOrderReason
,
reAddCart
:
reAddCart
getCancelOrderReason
:
getCancelOrderReason
};
...
...
apps/me/controllers/setting.js
View file @
ae37f45
...
...
@@ -75,6 +75,8 @@ 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
;
...
...
@@ -82,7 +84,6 @@ const index = (req, res, next) => {
result
.
info
.
mobile
=
result
.
info
.
mobile
?
result
.
info
.
mobile
.
substring
(
0
,
3
)
+
'****'
+
result
.
info
.
mobile
.
substring
(
7
,
11
)
:
''
;
result
.
stepUrl
=
'/me/setting/step1'
;
console
.
log
(
'详情info:'
,
result
.
info
);
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
...
...
@@ -106,10 +107,11 @@ 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
=>
{
// console.log('修改result', result);
res
.
send
(
result
);
});
};
...
...
@@ -120,13 +122,19 @@ 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
=>
{
if
(
result
.
info
.
verify_mobile
!==
''
)
{
let
info
=
result
.
info
;
info
.
ellipsisMobile
=
info
.
mobile
.
substring
(
0
,
3
)
+
'****'
+
info
.
mobile
.
substring
(
7
,
11
);
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");
console
.
log
(
'info.checkCode:'
,
info
.
checkCode
);
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
...
...
@@ -137,7 +145,7 @@ const bindMobile = (req, res, next) => {
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
step1
:
true
,
validateStep
:
true
,
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
captchaUrl
:
captchaUrl
,
...
...
@@ -152,13 +160,18 @@ 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
=>
{
if
(
result
.
info
.
verify_email
!==
''
)
{
let
info
=
result
.
info
;
info
.
ellipsisEmail
=
info
.
email
.
substring
(
0
,
3
)
+
'****'
+
info
.
email
.
substring
(
7
,
11
);
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'
,
...
...
@@ -167,7 +180,7 @@ const bindEmail = (req, res, next) => {
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
step1
:
true
,
validateStep
:
true
,
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
captchaUrl
:
captchaUrl
,
...
...
@@ -183,6 +196,9 @@ 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'
,
...
...
@@ -191,11 +207,12 @@ const modifyPassword = (req, res) => {
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
step1
:
true
,
validateStep
:
true
,
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
captchaUrl
:
captchaUrl
,
isShowPassword
:
true
isShowPassword
:
true
,
checkCode
:
checkCode
}
});
};
...
...
@@ -205,30 +222,41 @@ const modifyPassword = (req, res) => {
* */
const
edit
=
(
req
,
res
)
=>
{
let
type
=
req
.
params
.
type
;
let
code
=
settingModel
.
decipheriv
(
req
.
query
.
checkCode
.
split
(
' '
).
join
(
'+'
));
let
codes
=
code
.
split
(
'.'
);
if
(
codes
[
0
]
===
req
.
user
.
uid
&&
codes
[
1
]
===
'completeverify'
)
{
// if (codes[0] === "20000190" && codes[1] === "completeverify") {
let
result
=
{
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
isShowMobile
:
_getTitle
(
type
).
isModifyMobile
||
_getTitle
(
type
).
isBindMobile
,
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'
,
isMe
:
true
,
content
:
Object
.
assign
({
region
:
passportHelper
.
getCountry
(),
location
:
'+86'
,
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
operateStep
:
true
,
stepUrl
:
'/me/setting/step3/'
+
type
,
captchaUrl
:
captchaUrl
,
checkCode
:
checkCode
},
result
)
});
}
let
result
=
{
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
isShowMobile
:
_getTitle
(
type
).
isModifyMobile
||
_getTitle
(
type
).
isBindMobile
,
isShowEmail
:
_getTitle
(
type
).
isModifyEmail
||
_getTitle
(
type
).
isBindEmail
,
isShowPassword
:
_getTitle
(
type
).
isShowPassword
};
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
isMe
:
true
,
content
:
Object
.
assign
({
region
:
passportHelper
.
getCountry
(),
location
:
'+86'
,
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
step2
:
true
,
stepUrl
:
'/me/setting/step3/'
+
type
,
captchaUrl
:
captchaUrl
},
result
)
});
};
/*
...
...
@@ -236,31 +264,37 @@ const edit = (req, res)=> {
* */
const
success
=
(
req
,
res
)
=>
{
let
type
=
req
.
params
.
type
;
let
code
=
settingModel
.
decipheriv
(
req
.
query
.
checkCode
.
split
(
' '
).
join
(
'+'
));
let
codes
=
code
.
split
(
'.'
);
let
result
=
{
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
isModifyMobile
:
_getTitle
(
type
).
isModifyMobile
,
isBindMobile
:
_getTitle
(
type
).
isBindMobile
,
isModifyEmail
:
_getTitle
(
type
).
isModifyEmail
,
isBindEmail
:
_getTitle
(
type
).
isBindEmail
,
isShowPassword
:
_getTitle
(
type
).
isShowPassword
};
if
(
codes
[
0
]
===
req
.
user
.
uid
&&
codes
[
1
]
===
'completeoperate'
)
{
// if (codes[0] === "20000190" && codes[1] === "completeoperate") {
let
result
=
{
title
:
_getTitle
(
type
).
typeName
,
proTitle
:
_getTitle
(
type
).
proName
,
isModifyMobile
:
_getTitle
(
type
).
isModifyMobile
,
isBindMobile
:
_getTitle
(
type
).
isBindMobile
,
isModifyEmail
:
_getTitle
(
type
).
isModifyEmail
,
isBindEmail
:
_getTitle
(
type
).
isBindEmail
,
isShowPassword
:
_getTitle
(
type
).
isShowPassword
};
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
isMe
:
true
,
content
:
Object
.
assign
({
region
:
passportHelper
.
getCountry
(),
location
:
'+86'
,
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
successStep
:
true
,
captchaUrl
:
captchaUrl
},
result
)
});
}
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'setting'
,
isMe
:
true
,
content
:
Object
.
assign
({
region
:
passportHelper
.
getCountry
(),
location
:
'+86'
,
nav
:
mcHandler
.
getMeCrumb
(
'个人设置'
),
navigation
:
mcHandler
.
getSideMenu
(
'个人设置'
),
banner
:
'http://placehold.it/150x120'
,
step3
:
true
,
captchaUrl
:
captchaUrl
},
result
)
});
};
/*
...
...
@@ -269,6 +303,8 @@ 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
;
...
...
@@ -295,6 +331,8 @@ 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/router.js
View file @
ae37f45
...
...
@@ -31,7 +31,8 @@ router.get('/cancelOrder', order.cancelOrder);
router
.
get
(
'/getCancelOrderReason'
,
order
.
getCancelOrderReason
);
router
.
get
(
'/getExpressInfo'
,
order
.
getExpressInfo
);
router
.
get
(
'/editOrder'
,
order
.
editOrder
);
router
.
get
(
'/reAdd'
,
order
.
reAddCart
);
// router.get('/reAdd', order.reAddCart);
// 退换货
router
.
get
(
'/return'
,
returns
.
index
);
...
...
apps/me/views/action/index.hbs
View file @
ae37f45
...
...
@@ -60,13 +60,13 @@
{{#if
setting
}}
{{>
setting
}}
{{/if}}
{{#if
step1
}}
{{#if
validateStep
}}
{{>
setting
/
act
/
step1
}}
{{/if}}
{{#if
step2
}}
{{#if
operateStep
}}
{{>
setting
/
act
/
step2
}}
{{/if}}
{{#if
s
tep3
}}
{{#if
s
uccessStep
}}
{{>
setting
/
act
/
step3
}}
{{/if}}
...
...
apps/me/views/partial/setting/act/step1.hbs
View file @
ae37f45
...
...
@@ -12,15 +12,14 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
已绑定的手机号码:
</lable>
<p
id=
"cur-mobile"
>
{{
ellipsisMobile
}}
</p>
<input
id=
"real-mobile"
type=
"hidden"
value=
"
{{
mobile
}}
"
>
<input
id=
"real-mobile"
type=
"hidden"
value=
"
{{
verify_mobile
}}
"
>
<input
type=
"hidden"
id=
"checkCode"
value=
"
{{
checkCode
}}
"
>
</div>
{{/
data
}}
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
手机验证码:
</lable>
<lable
class=
"label-name"
>
手机验证码:
</lable>
<input
id=
"msg-code"
type=
"text"
class=
"input small-input"
>
<span
id=
"send-code"
class=
"btn white"
>
发送验证码
</span>
<span
class=
"tips-success blue ok"
>
成功
</span>
<span
class=
"tips-error notok"
>
失败
</span>
</div>
<div
class=
"form-group"
>
<span
id=
"mobile-step1"
class=
"btn submit"
>
提交
</span>
...
...
@@ -33,9 +32,8 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
已绑定的邮箱:
</lable>
<p>
{{
ellipsisEmail
}}
</p>
<!--<p>169****691@qq.com</p>-->
<input
type=
"hidden"
id=
"real-email"
value=
"
{{
email
}}
"
>
<!--<input type="hidden" id="real-email" value="1691164691@qq.com">-->
<input
type=
"hidden"
id=
"real-email"
value=
"
{{
verify_email
}}
"
>
<input
type=
"hidden"
id=
"checkCode"
value=
"
{{
checkCode
}}
"
>
</div>
{{/
data
}}
<div
class=
"form-group"
>
...
...
@@ -61,14 +59,15 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
请输入登录密码:
</lable>
<input
id=
"verifyPwd"
type=
"password"
class=
"input"
>
<input
type=
"hidden"
id=
"checkCode"
value=
"
{{
checkCode
}}
"
>
</div>
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
验证码:
</lable>
<input
id=
"captcha"
type=
"text"
class=
"input small-input"
>
<img
id=
"captcha-img"
class=
"captcha-img"
src=
"
{{
captchaUrl
}}
"
alt=
""
>
<a
class=
"change-captcha operation"
><span
class=
"iconfont gray operation"
>

</span></a>
<span
class=
"tips-success blue ok"
>
成功
</span>
<span
class=
"tips-error notok"
>
失败
</span>
<span
class=
"tips-success blue ok"
>
{{>
icon
/
round-hook
}}
</span>
<span
class=
"tips-error notok"
>
{{>
icon
/
error-round
}}
</span>
</div>
<div
class=
"form-group"
>
<span
id=
"pwd-step1"
class=
"btn submit"
>
提交
</span>
...
...
apps/me/views/partial/setting/act/step2.hbs
View file @
ae37f45
...
...
@@ -17,11 +17,12 @@
</select>
<span
id=
"country-code"
class=
"country-code"
>
{{
location
}}
</span>
<input
id=
"real-mobile"
type=
"text"
class=
"input"
>
<span
class=
"tips-success blue ok"
>
成功
</span>
<span
class=
"tips-error notok"
>
失败
</span>
<span
class=
"tips-success blue ok"
>
{{>
icon
/
round-hook
}}
</span>
<span
class=
"tips-error notok"
>
{{>
icon
/
error-round
}}
</span>
<input
type=
"hidden"
id=
"checkCode"
value=
"
{{
checkCode
}}
"
>
</div>
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
手机验证码:
</lable>
<lable
class=
"label-name"
>
手机验证码:
</lable>
<input
id=
"msg-code"
type=
"text"
class=
"input small-input"
>
<span
id=
"send-code2"
class=
"btn white"
>
发送验证码
</span>
</div>
...
...
@@ -35,9 +36,10 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
我的邮箱:
</lable>
<input
type=
"text"
class=
"input"
>
<input
type=
"hidden"
id=
"checkCode"
value=
"
{{
checkCode
}}
"
>
</div>
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
验证码:
</lable>
<lable
class=
"label-name"
>
验证码:
</lable>
<input
id=
"captcha"
type=
"text"
class=
"input small-input"
>
<img
id=
"captcha-img"
class=
"captcha-img"
src=
"
{{
captchaUrl
}}
"
alt=
""
>
<a
class=
"change-captcha operation"
><span
class=
"iconfont gray operation"
>

</span></a>
...
...
@@ -59,20 +61,21 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
输入新密码:
</lable>
<input
id=
"newPwd"
type=
"password"
class=
"input"
>
<input
type=
"hidden"
id=
"checkCode"
value=
"
{{
checkCode
}}
"
>
</div>
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
验证新密码:
</lable>
<input
id=
"checkPwd"
type=
"password"
class=
"input"
>
<span
class=
"tips-success blue ok"
>
成功
</span>
<span
class=
"tips-error notok"
>
失败
</span>
<span
class=
"tips-success blue ok"
>
{{>
icon
/
round-hook
}}
</span>
<span
class=
"tips-error notok"
>
{{>
icon
/
error-round
}}
</span>
</div>
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
验证码:
</lable>
<lable
class=
"label-name"
>
验证码:
</lable>
<input
id=
"captcha"
type=
"text"
class=
"input small-input"
>
<img
id=
"captcha-img"
class=
"captcha-img"
src=
"
{{
captchaUrl
}}
"
alt=
""
>
<a
class=
"change-captcha operation"
><span
class=
"iconfont gray operation"
>

</span></a>
<span
class=
"tips-success blue ok"
>
成功
</span>
<span
class=
"tips-error notok"
>
失败
</span>
<span
class=
"tips-success blue ok"
>
{{>
icon
/
round-hook
}}
</span>
<span
class=
"tips-error notok"
>
{{>
icon
/
error-round
}}
</span>
</div>
<div
class=
"form-group"
>
<span
id=
"step2-pwd"
class=
"btn submit"
>
提交
</span>
...
...
apps/me/views/partial/setting/act/step3.hbs
View file @
ae37f45
...
...
@@ -8,28 +8,28 @@
</div>
{{#if
isModifyMobile
}}
<div
class=
"operate2"
>
<p
class=
"bold"
>
恭喜您,您已经成功更换了绑定手机
</p>
<p>
今后您可以使用新的手机号码+密码尽情登录
</p>
<p
class=
"bold"
><span>
{{>
icon
/
round-hook
}}
</span>
恭喜您,您已经成功更换了绑定手机
</p>
<p>
今后您可以使用新的手机号码+密码进行登录
</p>
</div>
{{/if}}
{{#if
isModifyEmail
}}
<div
class=
"operate2"
>
<p
class=
"bold"
>
恭喜您,您已经成功修改了绑定邮箱
</p>
<p
class=
"bold"
>
<span>
{{>
icon
/
round-hook
}}
</span>
恭喜您,您已经成功修改了绑定邮箱
</p>
</div>
{{/if}}
{{#if
isShowPassword
}}
<div
class=
"operate2"
>
<p
class=
"bold"
>
恭喜您,您已经成功修改了登录密码
</p>
<p
class=
"bold"
>
<span>
{{>
icon
/
round-hook
}}
</span>
恭喜您,您已经成功修改了登录密码
</p>
</div>
{{/if}}
{{#if
isBindMobile
}}
<div
class=
"operate2"
>
<p
class=
"bold"
>
恭喜您,您已经成功绑定手机!
</p>
<p
class=
"bold"
>
<span>
{{>
icon
/
round-hook
}}
</span>
恭喜您,您已经成功绑定手机!
</p>
</div>
{{/if}}
{{#if
isBindEmail
}}
<div
class=
"operate2"
>
<p
class=
"bold"
>
恭喜您,您已经成功绑定了邮箱
</p>
<p
class=
"bold"
>
<span>
{{>
icon
/
round-hook
}}
</span>
恭喜您,您已经成功绑定了邮箱
</p>
</div>
{{/if}}
</div>
...
...
apps/me/views/partial/setting/content.hbs
View file @
ae37f45
...
...
@@ -4,6 +4,7 @@
<input
id=
"gender"
type=
"hidden"
value=
"
{{
info
.
gender
}}
"
>
<input
id=
"area_code"
type=
"hidden"
value=
"
{{
concat
.
area_code
}}
"
>
<input
id=
"zip_code"
type=
"hidden"
value=
"
{{
concat
.
zip_code
}}
"
>
<input
id=
"infoMobile"
type=
"hidden"
value=
"
{{
info
.
mobile
}}
"
>
<div
class=
"form-group"
>
<label
class=
"label-name"
>
真实姓名:
</label>
<input
id=
"username"
class=
"input"
type=
"text"
placeholder=
"请输入2-12个汉字或英文"
...
...
@@ -54,6 +55,7 @@
<div
class=
"form-group"
>
<label
class=
"label-name"
>
出生日期:
</label>
<input
id=
"birthday"
class=
"input"
type=
"text"
value=
"
{{
info
.
birthday
}}
"
>
<span
class=
"blue error-tips"
>
{{>
icon
/
error-round
}}
出生日期格式不对
</span>
</div>
<div
class=
"form-group-address"
>
<label
class=
"label-name"
>
居住地址:
</label>
...
...
apps/shopping/controllers/pay.js
View file @
ae37f45
...
...
@@ -6,34 +6,30 @@
'use strict'
;
const
Pay
Service
=
require
(
'../models/pay'
);
const
Pay
Data
=
require
(
'../models/pay'
);
const
online
=
(
req
,
res
,
next
)
=>
{
PayService
.
getPayInfo
().
then
(
result
=>
{
let
orderCode
=
req
.
query
.
code
;
let
uid
=
req
.
user
.
uid
;
PayData
.
getPayInfo
(
uid
,
orderCode
).
then
(
result
=>
{
console
.
log
(
result
);
res
.
render
(
'pay'
,
Object
.
assign
({
res
.
display
(
'pay'
,
Object
.
assign
({
defaultHeader
:
false
,
module
:
'shopping'
,
page
:
'pay'
,
title
:
'支付页面'
},
result
));
}).
catch
(
next
);
};
const
wechat
=
{
callback
:
(
req
,
res
,
next
)
=>
{
}
};
const
alipay
=
{
callback
:
(
req
,
res
,
next
)
=>
{
}
const
callback
=
()
=>
{
};
module
.
exports
=
{
online
,
wechat
,
alipay
callback
};
...
...
apps/shopping/helpers/sign.js
0 → 100644
View file @
ae37f45
/**
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/22
*/
...
...
apps/shopping/models/order.js
View file @
ae37f45
...
...
@@ -183,8 +183,17 @@ const submit = (uid, other) => {
return
_submit
(
uid
,
theOther
).
then
(
result
=>
result
);
};
const
orderDetail
=
(
uid
,
code
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.SpaceOrders.detail'
,
uid
:
uid
,
order_code
:
code
},
{
code
:
200
});
};
module
.
exports
=
{
index
,
compute
,
submit
submit
,
orderDetail
};
...
...
apps/shopping/models/pay.js
View file @
ae37f45
...
...
@@ -8,8 +8,10 @@
const
api
=
require
(
'./pay-api'
);
const
order
=
require
(
'./order'
);
const
Promise
=
require
(
'bluebird'
);
const
co
=
Promise
.
coroutine
;
const
camelCase
=
global
.
yoho
.
camelCase
;
const
_
=
require
(
'lodash'
);
...
...
@@ -31,8 +33,6 @@ const getOnlinePayProvider = () => {
})
.
value
();
console
.
dir
(
online
);
let
nav
=
[
{
id
:
'onlinePay'
,
...
...
@@ -48,35 +48,25 @@ const getOnlinePayProvider = () => {
});
};
const
get
ReceiverInfo
=
(
)
=>
{
const
get
OrderInfo
=
(
uid
,
code
)
=>
{
return
co
(
function
*
()
{
return
{
address
:
'江苏省南京市二条巷9号304室'
,
name
:
'把明扬'
,
phoneNum
:
'131****9719'
,
payType
:
'在线支付'
,
deliveryTime
:
'只工作日送货(双休日、节假日不送)'
};
})();
};
let
orderData
=
yield
order
.
orderDetail
(
uid
,
code
);
const
getOrderInfo
=
()
=>
{
return
co
(
function
*
()
{
return
{
id
:
121345
,
cash
:
'¥1000'
};
if
(
orderData
&&
orderData
.
data
)
{
return
camelCase
(
orderData
.
data
);
}
else
{
return
{};
}
})();
};
const
getPayInfo
=
()
=>
{
const
getPayInfo
=
(
uid
,
code
)
=>
{
return
co
(
function
*
()
{
let
payment
=
yield
Promise
.
all
([
getOnlinePayProvider
(),
get
ReceiverInfo
(),
getOrderInfo
(
)]);
let
payment
=
yield
Promise
.
all
([
getOnlinePayProvider
(),
get
OrderInfo
(
uid
,
code
)]);
return
{
pay
:
payment
[
0
],
receiver
:
payment
[
1
],
order
:
payment
[
2
]
order
:
payment
[
1
]
};
})();
};
...
...
apps/shopping/router.js
View file @
ae37f45
...
...
@@ -38,7 +38,6 @@ router.get('/pay/online', pay.online);
router
.
get
(
'/pay/online/success'
,
finish
.
success
);
// 支付回调
router
.
get
(
'/pay/wechat/callback'
,
pay
.
wechat
.
callback
);
router
.
get
(
'/pay/alipay/callback'
,
pay
.
alipay
.
callback
);
router
.
get
(
'/pay/callback/:type'
,
pay
.
callback
);
module
.
exports
=
router
;
...
...
apps/shopping/views/action/pay.hbs
View file @
ae37f45
{{>
sign-header
}}
<div
class=
"center-content pay-online-wrapper"
>
{{#
order
}}
<div
class=
"title"
>
<div
class=
"content"
>
<span
class=
"desc left"
>
订单已提交成功,请您尽快付款!订单编号:
{{
id
}}
</span>
<span
class=
"cash right"
>
应付金额:
{{
cash
}}
</span>
<span
class=
"desc left"
>
订单已提交成功,请您尽快付款!订单编号:
{{
orderId
}}
</span>
<span
class=
"cash right"
>
应付金额:
{{
paymentAmount
}}
</span>
</div>
<div
class=
"footer"
>
<span
class=
"desc left"
>
PADDY.BA
<span
class=
"blue"
>
2小时
</span>
内您无法完成付款,系统会将您的订单取消
</span>
<span
id=
"orderDetailCtrl"
class=
"right"
>
收起详情
<span
class=
"iconfont"
>

</span></span>
</div>
</div>
{{/
order
}}
{{#
receiver
}}
<div
class=
"order-detail"
>
<div
class=
"row"
>
<div
class=
"item"
>
...
...
@@ -26,17 +23,17 @@
<div
class=
"row"
>
<div
class=
"item"
>
<span
class=
"label"
>
收
货
人:
</span>
<span>
{{
n
ame
}}
</span>
<span>
{{
userN
ame
}}
</span>
</div>
<div
class=
"item"
>
<span
class=
"label"
>
联系方式:
</span>
<span>
{{
phoneNum
}}
</span>
<span>
{{
mobile
}}
</span>
</div>
</div>
<div
class=
"row"
>
<div
class=
"item"
>
<span
class=
"label"
>
支付方式:
</span>
<span>
{{
payType
}}
</span>
<span>
在线支付
</span>
</div>
<div
class=
"item"
>
<span
class=
"label"
>
送货时间:
</span>
...
...
@@ -44,8 +41,7 @@
</div>
</div>
</div>
{{/
receiver
}}
{{/
order
}}
{{#
pay
}}
<div
class=
"pay-type"
>
<div
class=
"pay-nav"
>
...
...
@@ -87,4 +83,4 @@
<a
class=
"btn btn-shape right"
>
去
<span
id=
"payTypeName"
>
支付宝
</span>
支付
</a>
</div>
</div>
\ No newline at end of file
</div>
...
...
public/js/me/setting.page.js
View file @
ae37f45
...
...
@@ -30,6 +30,17 @@ var Bll = {
html
.
push
(
'</form>'
);
return
html
.
join
(
''
);
},
validate
:
function
(
info
)
{
var
reg
=
new
RegExp
(
/^
[
1-2
][
0-9
][
0-9
][
0-9
]
-
[
0-1
]{0,1}[
0-9
]
-
[
0-3
]{0,1}[
0-9
]
$/
);
var
birthdayForm
=
$
(
'#birthday'
);
var
flag
=
true
;
!
reg
.
test
(
info
.
birthday
)
?
birthdayForm
.
next
().
show
()
:
birthdayForm
.
next
().
hide
();
if
(
!
reg
.
test
(
info
.
birthday
))
{
flag
=
false
;
}
return
flag
;
}
};
...
...
@@ -116,33 +127,38 @@ $(function() {
gender
:
$
(
'#gender'
).
val
(),
birthday
:
$
(
'#birthday'
).
val
(),
area_code
:
area
.
split
(
','
)[
2
],
mobile
:
'15195959898'
,
// todo 手机号码老接口必填
mobile
:
$
(
'#infoMobile'
).
val
(),
full_address
:
$
(
'#full_address'
).
val
(),
// todo 邮编老接口必填字段
zip_code
:
$
(
'#zip_code'
).
val
()
||
'210000'
};
$
.
ajax
({
type
:
'POST'
,
url
:
'/me/setting/editUserInfo'
,
dataType
:
'json'
,
data
:
body
,
success
:
function
(
data
)
{
var
len
=
0
;
data
.
forEach
(
function
(
x
)
{
if
(
x
.
code
===
200
)
{
len
++
;
// console.log(body);
if
(
Bll
.
validate
(
body
))
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/me/setting/editUserInfo'
,
dataType
:
'json'
,
data
:
body
,
success
:
function
(
data
)
{
var
len
=
0
;
data
.
forEach
(
function
(
x
)
{
if
(
x
.
code
===
200
)
{
len
++
;
}
});
if
(
len
===
2
)
{
new
_alert
(
'修改成功!'
).
show
();
}
else
{
new
_alert
(
'修改失败!'
).
show
();
}
});
if
(
len
===
2
)
{
new
_alert
(
'修改成功!'
).
show
();
}
else
{
new
_alert
(
'修改失败!'
).
show
();
}
}
});
});
}
});
});
...
...
public/js/me/setting/step1.js
View file @
ae37f45
...
...
@@ -61,7 +61,6 @@ $sms.click(function() {
$
(
'#mobile-step1'
).
click
(
function
()
{
var
code
=
$
(
'#msg-code'
).
val
().
trim
();
var
mobile
=
$
(
'#real-mobile'
).
val
();
var
self
=
$
(
'#msg-code'
).
parent
();
var
area
=
'+86'
;
$
.
ajax
({
...
...
@@ -74,47 +73,16 @@ $('#mobile-step1').click(function() {
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
self
.
find
(
'.tips-success'
).
addClass
(
'ok'
).
show
();
self
.
find
(
'.tips-error'
).
removeClass
(
'notok'
).
hide
();
location
.
href
=
'/me/setting/step2/'
+
type
;
location
.
href
=
'/me/setting/step2/'
+
type
+
'?checkCode='
+
$
(
'#checkCode'
).
val
();
}
else
{
// location.href = '/me/setting/step2/' + type + "?checkCode=" + $("#checkCode").val();
new
_alert
(
'验证码不正确!'
).
show
();
self
.
find
(
'.tips-success'
).
removeClass
(
'ok'
).
hide
();
self
.
find
(
'.tips-error'
).
addClass
(
'notok'
).
show
();
$
(
'#msg-code'
).
val
(
''
);
}
}
});
});
/**
* 邮箱验证
*/
$
(
'#email-step1'
).
click
(
function
()
{
var
a
=
$
(
'.notok'
).
length
;
if
(
a
===
0
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/me/setting/step1/email'
,
data
:
{
email
:
$
(
'#real-email'
).
val
()
},
success
:
function
(
data
)
{
// todo 发送邮件
if
(
data
.
code
===
200
)
{
$
(
'.operate1'
).
hide
();
$
(
'.operate2'
).
show
();
$
(
'.footer-tips'
).
eq
(
0
).
hide
();
$
(
'.footer-tips'
).
eq
(
2
).
show
();
}
else
{
new
_alert
(
data
.
message
).
show
();
}
}
});
}
});
/**
* 密码校验
...
...
@@ -162,7 +130,7 @@ $('#pwd-step1').click(function() {
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/setting/step2/'
+
type
;
location
.
href
=
'/me/setting/step2/'
+
type
+
'?checkCode='
+
$
(
'#checkCode'
).
val
()
;
}
else
{
new
_alert
(
'登录密码校验错误!'
).
show
();
}
...
...
@@ -170,3 +138,31 @@ $('#pwd-step1').click(function() {
});
}
});
/**
* 邮箱验证
*/
$
(
'#email-step1'
).
click
(
function
()
{
if
(
$
(
'.notok'
).
length
===
0
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/me/setting/step1/email'
,
data
:
{
email
:
$
(
'#real-email'
).
val
()
},
success
:
function
(
data
)
{
// todo 发送邮件
if
(
data
.
code
===
200
)
{
$
(
'.operate1'
).
hide
();
$
(
'.operate2'
).
show
();
$
(
'.footer-tips'
).
eq
(
0
).
hide
();
$
(
'.footer-tips'
).
eq
(
2
).
show
();
}
else
{
new
_alert
(
data
.
message
).
show
();
}
}
});
}
});
...
...
public/js/me/setting/step2.js
View file @
ae37f45
...
...
@@ -124,7 +124,7 @@ $('#mobile-step2').click(function() {
if
(
data
.
code
===
200
)
{
self
.
find
(
'.tips-success'
).
addClass
(
'ok'
).
show
();
self
.
find
(
'.tips-error'
).
removeClass
(
'notok'
).
hide
();
location
.
href
=
'/me/setting/step3/'
+
type
;
location
.
href
=
'/me/setting/step3/'
+
type
+
'?checkCode='
+
$
(
'#checkCode'
).
val
()
;
}
else
{
new
_alert
(
data
.
message
).
show
();
self
.
find
(
'.tips-success'
).
removeClass
(
'ok'
).
hide
();
...
...
@@ -187,8 +187,9 @@ $('#step2-pwd').click(function() {
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/setting/step3/
modifyPassword'
;
location
.
href
=
'/me/setting/step3/
'
+
type
+
'?checkCode='
+
$
(
'#checkCode'
).
val
()
;
}
else
{
// location.href = '/me/setting/step3/' + type + "?checkCode=" + $("#checkCode").val();
new
_alert
(
data
.
message
).
show
();
}
}
...
...
public/scss/editorial/_index.css
View file @
ae37f45
...
...
@@ -5,6 +5,7 @@
border-bottom
:
1px
solid
#eee
;
padding-left
:
300px
;
padding-bottom
:
5px
;
overflow
:
hidden
;
li
{
float
:
left
;
...
...
public/scss/me/setting/_act.css
View file @
ae37f45
.progress
{
margin
:
5px
195px
0
;
width
:
600px
;
margin
:
5px
auto
;
height
:
300px
;
.progress-pic1
{
...
...
@@ -32,23 +33,25 @@
}
.operate1
,
.operate2
{
margin
:
50px
0
0
100px
;
margin
:
50px
0
;
.form-group
{
clear
:
both
;
width
:
640px
;
margin-bottom
:
20px
;
width
:
600px
;
margin
:
10px
auto
;
padding-left
:
100px
;
.label-name
{
font-size
:
14px
;
text-align
:
left
;
float
:
left
;
text-align
:
right
;
line-height
:
26px
;
margin-right
:
30px
;
margin-right
:
20px
;
width
:
150px
;
display
:
inline-block
;
}
p
{
line-height
:
26px
;
display
:
inline-block
;
}
span
{
display
:
inline-block
;
...
...
@@ -61,6 +64,10 @@
display
:
inline-block
;
height
:
26px
;
}
span
{
font-size
:
14px
;
margin-left
:
5px
;
}
.tips-success
{
display
:
none
;
}
...
...
@@ -69,27 +76,30 @@
display
:
none
;
}
.white
{
width
:
1
0
0px
;
width
:
1
2
0px
;
}
select
{
height
:
26px
;
}
.submit
{
margin-left
:
150px
;
}
}
}
.operate2
{
margin
:
50px
0
0
100px
;
p
{
padding-bottom
:
20px
;
text-align
:
center
;
font-size
:
18px
;
span
{
color
:
#369ed6
;
}
}
.btn
{
width
:
90px
;
}
}
}
.submit
{
margin-left
:
150px
;
}
...
...
Please
register
or
login
to post a comment