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
yyq
9 years ago
Commit
58cafb0bfe49a4ea82940b26074e22c901df6eba
2 parents
101822fe
f07cc7dc
master
...
develop
feature/catch
feature/docker
feature/login-msg
feature/login-ua-ip
feature/removCamel
feature/safe-bug
feature/sessionKey
feature/setting
feature/vip
feature/webpack2
feature/wsl5.3
gray
release/2.0
release/fontBack2.0
Merge branch 'release/1.0' of git.yoho.cn:fe/yoho-blk into release/1.0
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
320 additions
and
154 deletions
apps/editorial/controllers/editorial.js
apps/editorial/models/editorial.js
apps/editorial/views/action/detail.hbs
apps/me/models/order.js
apps/me/models/setting.js
apps/me/views/partial/address/table.hbs
apps/me/views/partial/order/detail/goods-list.hbs
apps/me/views/partial/order/table-body.hbs
apps/me/views/partial/returns-change.hbs
apps/passport/views/action/back/reset-success.hbs
apps/product/controllers/list.js
apps/product/controllers/query.js
apps/product/controllers/shop.js
apps/product/views/partial/list/shop-sort.hbs
apps/shopping/controllers/cart.js
apps/shopping/controllers/order.js
apps/shopping/controllers/pay.js
apps/shopping/helpers/index.js
apps/shopping/models/cart.js
apps/shopping/models/pay.js
apps/shopping/views/action/pay-success.hbs
apps/shopping/views/partial/cart/cart-list-body.hbs
public/helper/showStorage.js
public/js/me/order-detail.page.js
public/js/me/order.page.js
public/js/me/order/cancel-order.js
public/js/me/order/countdown.js
public/js/me/setting.page.js
public/js/shopping/pay.page.js
public/scss/channel/_home.css
public/scss/channel/_new-arrival.css
public/scss/channel/_style-icon.css
public/scss/me/order/_detail.css
public/scss/me/return/_change.css
public/scss/product/_shop.css
public/scss/shopping/_cart-products.css
public/scss/shopping/_order.css
apps/editorial/controllers/editorial.js
View file @
58cafb0
...
...
@@ -20,19 +20,21 @@ const index = (req, res, next) => {
let
limit
=
req
.
query
.
limit
||
20
;
let
appType
=
1
;
let
udid
=
md5
(
req
.
ip
);
let
channel
=
req
.
cookies
.
_Channel
||
'men'
;
let
channel
=
req
.
cookies
.
_Channel
||
'
wo
men'
;
let
gender
=
''
;
let
name
=
''
;
if
(
channel
===
'men'
)
{
gender
=
'1,3'
;
name
=
'MEN首页'
;
}
else
if
(
channel
===
'women'
)
{
gender
=
'2,3'
;
name
=
'WOMEN首页'
;
}
else
{
gender
=
'3,3'
;
name
=
' LIFESTYLE首页'
;
}
console
.
log
(
gender
);
editorialModel
.
getIndexData
(
pageNum
,
limit
,
appType
,
udid
,
gender
).
then
((
result
)
=>
{
res
.
display
(
'index'
,
{
...
...
@@ -44,7 +46,7 @@ const index = (req, res, next) => {
{
link
:
'/editorial?type=0'
,
pathTitle
:
'首页'
,
name
:
'MEN首页'
name
:
name
},
{
pathTitle
:
'资讯'
,
...
...
@@ -79,8 +81,22 @@ const list = (req, res) => {
let
tag
=
req
.
query
.
query
;
let
authorId
=
req
.
query
.
authorId
;
let
udid
=
md5
(
req
.
ip
);
let
channel
=
req
.
cookies
.
_Channel
||
'men'
;
let
gender
=
''
;
let
name
=
''
;
if
(
channel
===
'men'
)
{
gender
=
'1,3'
;
name
=
'MEN首页'
;
}
else
if
(
channel
===
'women'
)
{
gender
=
'2,3'
;
name
=
'WOMEN首页'
;
}
else
{
gender
=
'3,3'
;
name
=
' LIFESTYLE首页'
;
}
editorialModel
.
getListData
(
pageNum
,
limit
,
tag
,
authorId
,
udid
).
then
((
result
)
=>
{
editorialModel
.
getListData
(
pageNum
,
limit
,
tag
,
authorId
,
udid
,
gender
).
then
((
result
)
=>
{
res
.
display
(
'list'
,
{
module
:
'editorial'
,
...
...
@@ -91,7 +107,7 @@ const list = (req, res) => {
{
link
:
'/editorial?type=0'
,
pathTitle
:
'首页'
,
name
:
'MEN首页'
name
:
name
},
{
link
:
'/editorial?type=1'
,
...
...
@@ -130,8 +146,6 @@ const detail = (req, res, next) => {
let
id
=
req
.
params
.
id
;
let
appType
=
1
;
// let clientType = 'pc';
editorialModel
.
getDetailData
(
id
,
appType
).
then
((
result
)
=>
{
res
.
display
(
'detail'
,
{
module
:
'editorial'
,
...
...
@@ -161,10 +175,13 @@ const detail = (req, res, next) => {
userInfo
:
result
.
head
,
comment
:
result
.
comment
,
brands
:
result
.
brands
,
article
:
{
nextChapter
:
'来来来,让我们好好聊聊'
,
lastChapter
:
'除了黑白灰'
},
// article: {
// nextChapter: '来来来,让我们好好聊聊',
// lastChapter: '除了黑白灰'
// },
nextArticle
:
result
.
nextArticle
,
perArticle
:
result
.
perArticle
,
share
:
{
shareImg
:
result
.
content
.
shareImg
,
shareDesc
:
result
.
head
.
title
,
...
...
apps/editorial/models/editorial.js
View file @
58cafb0
...
...
@@ -50,8 +50,6 @@ const _processListData = (list) => {
});
listData
.
tabs
=
list
.
list
.
artList
;
// console.log(listData)
return
listData
;
};
...
...
@@ -73,7 +71,6 @@ const getIndexData = (pageNum, limit, appType, udid, gender) => {
gender
:
gender
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
// console.log(result)
return
_processListData
(
result
.
data
);
}
else
{
logger
.
error
(
'Information page list data return code is not 200'
);
...
...
@@ -90,11 +87,12 @@ const getIndexData = (pageNum, limit, appType, udid, gender) => {
* @param authorId
* @returns {*}
*/
const
getListData
=
(
pageNum
,
limit
,
tag
,
authorId
,
udid
)
=>
{
const
getListData
=
(
pageNum
,
limit
,
tag
,
authorId
,
udid
,
gender
)
=>
{
let
param
=
{
page
:
pageNum
,
limit
:
limit
,
udid
:
udid
udid
:
udid
,
gender
:
gender
};
if
(
tag
)
{
...
...
@@ -140,6 +138,7 @@ const _getAuthorData = (id) => {
* @returns {*}
*/
const
_processHeadData
=
(
list
)
=>
{
return
co
(
function
*
()
{
list
=
list
||
[];
list
=
camelCase
(
list
);
...
...
@@ -157,7 +156,7 @@ const _processHeadData = (list) => {
data
.
isFavor
=
data
.
isFavor
===
'Y'
;
newData
.
headData
=
{
title
:
data
.
intro
,
title
:
data
.
title
,
click
:
data
.
viewNum
,
time
:
data
.
publishTime
,
isLike
:
data
.
isPraise
,
...
...
@@ -191,8 +190,8 @@ const _processHeadData = (list) => {
}
});
// newData.headData.time = newData.headData.time.replace(/-/g, '/');
// newData.headData.time = newData.headData.time.replace(':00', '', 2);
newData
.
headData
.
time
=
newData
.
headData
.
time
.
replace
(
/-/g
,
'/'
);
newData
.
headData
.
time
=
newData
.
headData
.
time
.
replace
(
':00'
,
''
,
2
);
let
id
=
newData
.
headData
.
authorId
;
...
...
@@ -249,8 +248,6 @@ const _processContentData = (list) => {
list
=
list
||
[];
list
=
camelCase
(
list
);
// console.log(list)
let
contentData
=
{
contents
:
[]
};
...
...
@@ -335,7 +332,6 @@ const _processContentData = (list) => {
return
contentData
;
});
// console.log(contentData)
return
contentData
;
};
...
...
@@ -441,18 +437,68 @@ const _getRelateBrand = (id) => {
});
};
/**
* 获取详情页上一篇
* @param id
* @returns {*}
*/
const
_getArticlePre
=
(
id
,
appType
)
=>
{
return
serviceAPI
.
get
(
'guang/api/*/article/getArticlePre'
,
{
return
serviceAPI
.
get
(
'/guang/api/*/article/getArticlePre'
,
{
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
let
perArticle
=
{};
perArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdPre
}.
html
`
;
_getHeadData
(
result
.
data
.
articleIdPre
,
appType
).
then
((
list
)
=>
{
perArticle
.
lastChapter
=
list
.
title
;
}).
then
(()
=>
{
return
perArticle
;
});
return
perArticle
;
}
else
{
logger
.
error
(
'In the previous is not 200'
);
return
{};
}
});
};
/**
* 获取详情页下一篇
* @param id
* @returns {*}
*/
const
_getArticleNext
=
(
id
,
appType
)
=>
{
return
serviceAPI
.
get
(
'/guang/api/*/article/getArticleNext'
,
{
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
// console.log(1)
// let id = result.data.articleIdPre;
// _getHeadData(id, appType);
return
result
;
let
nextArticle
=
{};
nextArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdNext
}.
html
`
;
_getHeadData
(
result
.
data
.
articleIdNext
,
appType
).
then
((
list
)
=>
{
nextArticle
.
lastChapter
=
list
.
title
;
}).
then
(()
=>
{
return
nextArticle
;
});
return
nextArticle
;
}
else
{
logger
.
error
(
'
上一篇不是
200'
);
logger
.
error
(
'
The next article is not
200'
);
return
{};
}
});
...
...
@@ -572,6 +618,7 @@ const getDetailData = (id, appType) => {
_getContentData
(
id
),
_getCommentsData
(
id
),
_getArticlePre
(
id
,
appType
),
_getArticleNext
(
id
,
appType
),
_getRelateBrand
(
id
)]);
let
res
=
yield
_processHeadData
([
result
[
0
],
result
[
1
],
result
[
3
]]);
...
...
@@ -580,7 +627,9 @@ const getDetailData = (id, appType) => {
tags
:
res
.
tags
,
content
:
result
[
2
],
comment
:
result
[
3
],
brands
:
result
[
5
]
brands
:
result
[
6
],
nextArticle
:
result
[
4
],
perArticle
:
result
[
5
]
};
})();
};
...
...
apps/editorial/views/action/detail.hbs
View file @
58cafb0
...
...
@@ -141,16 +141,22 @@
</div>
<div
class=
"chapter"
>
{{#
article
}}
<p
class=
"chapter-right"
>
<span>
下一篇
</span><br>
{{#
nextArticle
}}
<a
href=
"
{{
href
}}
"
>
{{
nextChapter
}}
</a>
{{/
nextArticle
}}
</p>
<p
class=
"chapter-left"
>
<span>
上一篇
</span><br>
{{#
perArticle
}}
<a
href=
"
{{
href
}}
"
>
{{
lastChapter
}}
</a>
{{/
perArticle
}}
</p>
{{/
article
}}
</div>
<div
id=
"comment-area"
class=
"comment-area"
>
...
...
apps/me/models/order.js
View file @
58cafb0
...
...
@@ -141,7 +141,7 @@ const isMobileOrder = {
// 转换时间戳
const
_convertUnixTime
=
src
=>
{
return
moment
.
unix
(
src
).
format
(
'YYYY-MM-DD
HH
:mm:ss'
);
return
moment
.
unix
(
src
).
format
(
'YYYY-MM-DD
hh
:mm:ss'
);
};
/**
...
...
@@ -264,7 +264,6 @@ const _getUserOrder = (uid, type, page) => {
orderList
.
forEach
(
item
=>
{
const
ot
=
parseInt
(
item
.
orderType
,
10
);
const
st
=
parseInt
(
item
.
status
,
10
);
const
payleftTime
=
parseInt
(
item
.
payLefttime
,
10
);
let
hasRefund
=
false
;
let
canRefund
=
false
;
...
...
@@ -294,7 +293,7 @@ const _getUserOrder = (uid, type, page) => {
// 没有取消订单并且状态为0的时候显示付款按钮
if
(
item
.
isCancel
===
'N'
&&
st
===
0
&&
payleftTime
!==
0
)
{
st
===
0
)
{
item
.
showPayButton
=
true
;
}
...
...
@@ -316,10 +315,6 @@ const _getUserOrder = (uid, type, page) => {
if
(
item
.
isCancel
===
'Y'
)
{
item
.
showBuyBtn
=
true
;
item
.
statusStr
=
'已取消'
;
}
else
if
(
payleftTime
===
0
)
{
item
.
showBuyBtn
=
true
;
item
.
showPayButton
=
false
;
item
.
statusStr
=
'已取消'
;
}
else
if
(
item
.
isOnlinePaid
)
{
item
.
statusStr
=
statusMap
[
st
].
valueStr
;
}
...
...
@@ -440,13 +435,11 @@ const getOrderData = (uid, type, page) => {
},
2
:
{
emptyMsg
:
'没有待付款的订单哦~'
,
showEmptyEn
:
true
,
btnText
:
'查看全部订单'
,
url
:
'/me/'
},
3
:
{
emptyMsg
:
'没有待收货的订单哦~'
,
showEmptyEn
:
true
,
btnText
:
'查看全部订单'
,
url
:
'/me/'
}
...
...
@@ -505,6 +498,12 @@ const getOrderDetail = (uid, code) => {
title
:
'订单详情'
};
detail
.
orderGoods
.
forEach
(
good
=>
{
let
cnAlphabet
=
good
.
cnAlphabet
?
good
.
cnAlphabet
:
''
;
good
.
goodUrl
=
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
good
.
productId
}
_$
{
good
.
goodsId
}
/${cnAlphabet}.html`
)
;
});
detail
.
createTime
=
_convertUnixTime
(
detail
.
createTime
);
if
(
detail
.
isCancel
===
'N'
&&
...
...
@@ -548,14 +547,6 @@ const getOrderDetail = (uid, code) => {
detail
.
invoice
=
false
;
}
if
(
detail
.
payLefttime
===
'0'
)
{
detail
.
showLeftTime
=
false
;
detail
.
statusStr
=
'已取消'
;
detail
.
steps
=
false
;
detail
.
btns
=
false
;
}
detail
.
paymentTypeStr
=
paymentTypeStr
[
detail
.
paymentType
];
detail
.
allAddress
=
detail
.
area
+
detail
.
address
;
...
...
apps/me/models/setting.js
View file @
58cafb0
...
...
@@ -148,14 +148,24 @@ const _editInfo = (uid, nickName, username, gender, birthday)=> {
* @private
*/
const
_editUserContactInfo
=
(
uid
,
areaCode
,
mobile
,
fullAddress
,
zipCode
)
=>
{
return
api
.
get
(
''
,
{
let
param
=
{
method
:
'web.passport.modifyUserContacts'
,
uid
:
uid
,
area_code
:
areaCode
,
mobile
:
mobile
,
full_address
:
fullAddress
,
zip_code
:
zipCode
}).
then
(
result
=>
result
);
uid
:
uid
};
if
(
mobile
)
{
param
.
mobile
=
mobile
;
}
if
(
zipCode
)
{
param
.
zip_code
=
zipCode
;
}
if
(
areaCode
)
{
param
.
area_code
=
areaCode
;
}
if
(
fullAddress
)
{
param
.
full_address
=
fullAddress
;
}
return
api
.
get
(
''
,
param
).
then
(
result
=>
result
);
};
/**
...
...
@@ -170,7 +180,9 @@ const editUserInfo = (uid, info) => {
_editUserContactInfo
(
uid
,
info
.
area_code
,
info
.
mobile
,
info
.
full_address
,
info
.
zip_code
)
];
return
Promise
.
all
(
getData
).
then
(
result
=>
result
);
return
Promise
.
all
(
getData
).
then
(
result
=>
{
return
result
;
});
};
/**
...
...
apps/me/views/partial/address/table.hbs
View file @
58cafb0
...
...
@@ -21,11 +21,11 @@
<td
class=
"width-opearte"
>
<div>
<span
class=
"blue opreation update-address"
data-id=
"
{{
address_id
}}
"
>
修改
</span>
<em
class=
"op-sep"
>
|
</em>
<span
class=
"blue opreation del-address"
data-id=
"
{{
address_id
}}
"
>
删除
</span>
{{#if
default
}}
<span
class=
"btn set-default opreation current-default"
data-id=
{{
address_id
}}
>
默认地址</span
>
{{else}}
<em
class=
"op-sep"
>
|
</em>
<span
class=
"blue opreation del-address"
data-id=
"
{{
address_id
}}
"
>
删除
</span>
<span
class=
"btn set-default opreation "
data-id=
{{
address_id
}}
>
设为默认</span
>
{{/if}}
</div>
...
...
apps/me/views/partial/order/detail/goods-list.hbs
View file @
58cafb0
...
...
@@ -6,7 +6,7 @@
<span
class=
"iconfont show-package"
>

</span>
<div
class=
"package-list hide"
>
<div
class=
"package-up-icon"
></div>
{{#
each
packageList
}}
{{#
each
..
/
packageList
}}
<div
class=
"package-item"
>
<p
class=
"package-title bold"
>
包裹
{{
math
@index
'+'
1
}}
:
{{#if
@first
}}
总仓发货
{{^}}
异地调拨
{{/if}}
</p>
<ul
class=
"package-goods clearfix"
>
...
...
apps/me/views/partial/order/table-body.hbs
View file @
58cafb0
...
...
@@ -27,7 +27,7 @@
<span
class=
"btn red hide-when-invalid"
>
立即付款
</span>
</a>
{{/if}}
<p
class=
"subtext cancel
hide-when-invalid
"
>
取消订单
</p>
<p
class=
"subtext cancel"
>
取消订单
</p>
</div>
{{/if}}
{{#if
showEditOption
}}
...
...
apps/me/views/partial/returns-change.hbs
View file @
58cafb0
<div
class=
"returns-wrap user-order change"
>
<a
href=
"/help?id=43"
target=
"_blank"
>
<span
class=
"btn white change-tips"
>
换货须知
</span>
</a>
{{#
returnsChange
}}
{{>
common
/
subtitle
}}
<div
class=
"order"
data-code=
"
{{
orderCode
}}
"
>
...
...
apps/passport/views/action/back/reset-success.hbs
View file @
58cafb0
...
...
@@ -43,7 +43,7 @@
<div
class=
"success-text"
>
<div
class=
"small-title"
>
恭喜您设置完成,请妥善保存您的密码!
</div>
<div
class=
"time"
>
页面将在
<span
id=
"count-down"
class=
"blue"
>
5
</span>
秒后将跳转至
首页
</div>
<div
class=
"time"
>
页面将在
<span
id=
"count-down"
class=
"blue"
>
5
</span>
秒后将跳转至
登录页面
</div>
</div>
</ul>
</div>
...
...
apps/product/controllers/list.js
View file @
58cafb0
...
...
@@ -17,7 +17,7 @@ const list = {
// 列表页
index
:
(
req
,
res
,
next
)
=>
{
let
q
=
req
.
query
;
let
channel
=
req
.
cookies
.
_Channel
||
req
.
query
.
_Channel
||
'men'
;
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
...
...
@@ -69,7 +69,7 @@ const list = {
// 新品到着
newPage
:
(
req
,
res
,
next
)
=>
{
let
q
=
req
.
query
;
let
channel
=
req
.
cookies
.
_Channel
||
req
.
query
.
_Channel
||
'men'
;
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
...
...
apps/product/controllers/query.js
View file @
58cafb0
...
...
@@ -17,7 +17,7 @@ const Query = {
index
:
(
req
,
res
,
next
)
=>
{
let
q
=
req
.
query
;
let
query
=
q
.
query
||
''
;
let
channel
=
req
.
cookies
.
_Channel
||
req
.
query
.
_Channel
||
'men'
;
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
...
...
apps/product/controllers/shop.js
View file @
58cafb0
...
...
@@ -91,7 +91,8 @@ const shop = {
page
:
'shop-list'
,
title
:
'店铺列表'
};
let
nav
=
[
DataHelper
.
getChannelNav
()];
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
let
nav
=
[
DataHelper
.
getChannelNav
(
channel
)];
let
domain
=
req
.
params
.
domain
;
let
uid
=
req
.
user
.
uid
;
let
q
=
req
.
query
;
...
...
@@ -99,6 +100,7 @@ const shop = {
q
.
order
=
q
.
order
||
's_n_desc'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
channel
=
channel
;
ShopData
.
getShopHeadData
(
domain
,
uid
).
then
(
result
=>
{
data
.
banner
=
result
;
...
...
apps/product/views/partial/list/shop-sort.hbs
View file @
58cafb0
<div
class=
"shop-sort"
>
<div
class=
"all"
>
所有商品
</div>
<div
class=
"sort-list"
>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=2,3"
>
女装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=1,3"
>
男装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=1,3"
>
男士
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=2,3"
>
女士
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?_Channel=lifestyle"
>
生活
</a></div>
{{#
each
banner
.
sorts
}}
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?misort=
{{
sortId
}}
"
>
{{
sortName
}}
</a></div>
{{/
each
}}
...
...
apps/shopping/controllers/cart.js
View file @
58cafb0
...
...
@@ -16,6 +16,9 @@ exports.index = (req, res, next) => {
cartModel
.
getCartData
(
shoppingKey
,
uid
).
then
((
result
)
=>
{
if
(
result
.
code
===
200
)
{
res
.
header
(
'Cache-Control'
,
'no-cache'
);
res
.
display
(
'cart'
,
_
.
merge
({
module
:
'shopping'
,
page
:
'cart'
,
...
...
apps/shopping/controllers/order.js
View file @
58cafb0
...
...
@@ -17,54 +17,61 @@ const index = (req, res, next) => {
orderModel
.
index
(
req
.
user
.
uid
).
then
(
result
=>
{
let
data
=
result
.
data
;
// 设置头部路径索引focus
data
.
bcNavFocus
=
2
;
// 构造诡异的配送方式数据【显示普通快递的文字,确用顺丰发货和顺丰的快递费】
data
.
delivery_way
=
_
.
concat
(
_
.
assign
(
_
.
find
(
data
.
delivery_way
,
{
delivery_way_id
:
2
}),
{
delivery_way_name
:
'普通快递'
}));
// 发票抬头
data
.
invoices
.
invoiceTitle
=
[
{
name
:
'个人'
,
value
:
1
,
myClass
:
'personal'
},
{
name
:
'单位'
,
value
:
2
}
];
// 返回购物车链接
data
.
goCartLink
=
helper
.
urlFormat
(
'/shopping/cart'
);
// 拆单是否显示左右切换
_
.
forEach
(
data
.
shopping_cart_data
.
package_list
,
i
=>
{
if
(
i
.
goods_list
.
length
>
4
)
{
i
.
showToggle
=
true
;
}
});
if
(
data
.
goods_list
&&
data
.
goods_list
.
length
>
0
)
{
// 设置头部路径索引focus
data
.
bcNavFocus
=
2
;
// 构造诡异的配送方式数据【显示普通快递的文字,确用顺丰发货和顺丰的快递费】
data
.
delivery_way
=
_
.
concat
(
_
.
assign
(
_
.
find
(
data
.
delivery_way
,
{
delivery_way_id
:
2
}),
{
delivery_way_name
:
'普通快递'
}));
// 发票抬头
data
.
invoices
.
invoiceTitle
=
[
{
name
:
'个人'
,
value
:
1
,
myClass
:
'personal'
},
{
name
:
'单位'
,
value
:
2
}
];
// 返回购物车链接
data
.
goCartLink
=
helper
.
urlFormat
(
'/shopping/cart'
);
// 拆单是否显示左右切换
_
.
forEach
(
data
.
shopping_cart_data
.
package_list
,
i
=>
{
if
(
i
.
goods_list
.
length
>
4
)
{
i
.
showToggle
=
true
;
}
});
// 是否打印价格radio
data
.
printPriceRadio
=
[
{
value
:
'1'
,
name
:
'是'
},
{
value
:
'0'
,
name
:
'否'
,
checked
:
true
}
];
res
.
header
(
'Cache-Control'
,
'no-cache'
);
res
.
display
(
'order'
,
{
content
:
data
,
defaultHeader
:
false
});
}
else
{
res
.
redirect
(
'/shopping/cart'
);
}
// 是否打印价格radio
data
.
printPriceRadio
=
[
{
value
:
'1'
,
name
:
'是'
},
{
value
:
'0'
,
name
:
'否'
,
checked
:
true
}
];
res
.
display
(
'order'
,
{
content
:
data
,
defaultHeader
:
false
});
}).
catch
(
next
);
};
...
...
apps/shopping/controllers/pay.js
View file @
58cafb0
...
...
@@ -11,6 +11,7 @@ const OrderData = require('../models/order');
const
PayHelpers
=
require
(
'../helpers/payment'
);
const
camelCase
=
global
.
yoho
.
camelCase
;
const
helpers
=
global
.
yoho
.
helpers
;
const
_
=
require
(
'lodash'
);
/**
...
...
@@ -24,13 +25,39 @@ const online = (req, res, next) => {
let
uid
=
req
.
user
.
uid
;
PayData
.
getPayInfo
(
uid
,
orderCode
).
then
(
result
=>
{
res
.
display
(
'pay'
,
Object
.
assign
({
defaultHeader
:
false
,
module
:
'shopping'
,
page
:
'pay'
,
title
:
'支付页面'
,
username
:
req
.
user
.
username
},
result
));
let
order
=
result
.
order
;
let
promotion
=
order
.
promotionFormulas
;
let
coin
=
0
;
let
amount
=
_
.
toNumber
(
order
.
paymentAmount
);
_
.
forEach
(
promotion
,
p
=>
{
if
(
p
.
promotion
===
'YOHO币'
)
{
coin
=
_
.
toNumber
(
p
.
promotionAmount
.
substring
(
2
,
p
.
promotionAmount
.
length
))
*
100
;
}
});
if
(
amount
>
0
)
{
res
.
display
(
'pay'
,
Object
.
assign
({
defaultHeader
:
false
,
module
:
'shopping'
,
page
:
'pay'
,
title
:
'支付页面'
,
username
:
req
.
user
.
username
},
result
));
}
else
{
res
.
display
(
'pay-success'
,
{
defaultHeader
:
false
,
content
:
{
cost
:
order
.
paymentAmount
,
orderNum
:
order
.
orderCode
,
coin
:
coin
,
orderHref
:
helpers
.
urlFormat
(
'/me/order/detail'
,
{
orderCode
:
order
.
orderCode
}),
walkHref
:
helpers
.
urlFormat
(
'/'
)
}
});
}
}).
catch
(
next
);
};
...
...
@@ -76,16 +103,25 @@ const callback = (req, res) => {
let
query
=
req
.
query
;
PayHelpers
.
afterPay
(
query
,
payId
,
req
.
user
).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
let
data
=
result
.
data
;
if
(
result
.
code
===
200
&&
result
.
data
&&
result
.
data
.
order
)
{
let
order
=
result
.
data
.
order
;
let
promotion
=
order
.
promotionFormulas
;
let
coin
=
0
;
_
.
forEach
(
promotion
,
p
=>
{
if
(
p
.
promotion
===
'YOHO币'
)
{
coin
=
_
.
toNumber
(
p
.
promotionAmount
.
substring
(
2
,
p
.
promotionAmount
.
length
))
*
100
;
}
});
res
.
display
(
'pay-success'
,
{
defaultHeader
:
false
,
content
:
{
cost
:
data
.
pay
,
orderNum
:
data
.
orderCode
,
onlineCost
:
data
.
pay
,
orderHref
:
helpers
.
urlFormat
(
'/me/order/detail'
,
{
orderCode
:
data
.
orderCode
}),
cost
:
order
.
paymentAmount
,
orderNum
:
order
.
orderCode
,
coin
:
coin
,
orderHref
:
helpers
.
urlFormat
(
'/me/order/detail'
,
{
orderCode
:
order
.
orderCode
}),
walkHref
:
helpers
.
urlFormat
(
'/'
)
}
});
...
...
apps/shopping/helpers/index.js
View file @
58cafb0
...
...
@@ -46,9 +46,9 @@ exports.lte = (num1, num2, options) => {
exports
.
showStorage
=
(
leftNumber
)
=>
{
leftNumber
=
+
leftNumber
;
if
(
leftNumber
<=
3
&&
leftNumber
>
0
)
{
if
(
leftNumber
<=
3
&&
leftNumber
>
=
0
)
{
return
`仅剩
$
{
leftNumber
}
件`
;
}
else
if
(
leftNumber
<
=
0
)
{
}
else
if
(
leftNumber
<
0
)
{
return
'库存不足'
;
}
};
...
...
apps/shopping/models/cart.js
View file @
58cafb0
...
...
@@ -282,7 +282,7 @@ const filterCartData = (result, uid) => {
ordinaryGoods
=
_
.
concat
(
ordinaryGoods
,
ordinaryCartData
.
goods_list
,
soldOutWithStorage
);
// 正常商品
invalidGoods
=
_
.
concat
(
invalidGoods
,
ordinaryCartData
.
off_shelves_goods_list
,
soldOutWithoutStorage
);
// 失效商品
_
.
forEach
(
ordinaryGoods
,
function
(
good
)
{
_
.
forEach
(
ordinaryGoods
,
good
=>
{
buyNumber
=
parseInt
(
good
.
buy_number
,
10
);
storageNumber
=
parseInt
(
good
.
storage_number
,
10
);
totalNum
+=
buyNumber
;
...
...
apps/shopping/models/pay.js
View file @
58cafb0
...
...
@@ -221,8 +221,7 @@ const procOrderData = (payResult, uid) => {
code
:
200
,
message
:
'支付成功,请等待发货'
,
data
:
{
pay
:
amount
,
orderCode
:
orderCode
order
:
order
}
};
...
...
apps/shopping/views/action/pay-success.hbs
View file @
58cafb0
...
...
@@ -18,8 +18,8 @@
!
</p>
<p
class=
"order-num"
>
订单编号:
{{
orderNum
}}
</p>
{{#if
onlineCost
}}
<p
class=
"payment-online"
>
在线支付:¥
{{
round
onlineCost
2
}}
</p>
{{#if
cost
}}
<p
class=
"payment-online"
>
在线支付:¥
{{
round
cost
2
}}
</p>
{{/if}}
{{#if
coin
}}
<p
class=
"payment-coin"
>
有货币支付:
{{
coin
}}
</p>
...
...
@@ -43,4 +43,4 @@
</div>
{{/
content
}}
</div>
</div>
\ No newline at end of file
</div>
...
...
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
58cafb0
...
...
@@ -79,7 +79,7 @@
</a>
</li>
<li
class=
"pro-info"
>
{{!-- <div class="brand-name">{{brandName}}</div> --}}
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank"
>
{{
product_name
}}
</a></div>
<div
class=
"color-size editable"
data-productId=
"
{{
product_id
}}
"
id=
"edit_
{{
product_id
}}
"
data-productSkn=
"
{{
product_skn
}}
"
>
{{#if
color_name
}}
...
...
@@ -124,6 +124,7 @@
</a>
</li>
<li
class=
"pro-info"
>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"javascript:void(0)"
>
{{
product_name
}}
</a></div>
<div>
{{#if
color_name
}}
...
...
public/helper/showStorage.js
View file @
58cafb0
...
...
@@ -6,9 +6,9 @@
module
.
exports
=
function
(
leftNumber
)
{
leftNumber
=
+
leftNumber
;
if
(
leftNumber
<=
3
&&
leftNumber
>
0
)
{
if
(
leftNumber
<=
3
&&
leftNumber
>
=
0
)
{
return
'仅剩'
+
leftNumber
+
'件'
;
}
else
if
(
leftNumber
<
=
0
)
{
}
else
if
(
leftNumber
<
0
)
{
return
'库存不足'
;
}
};
...
...
public/js/me/order-detail.page.js
View file @
58cafb0
...
...
@@ -2,6 +2,9 @@ var cancelOrder = require('./order/cancel-order');
var
editOrder
=
require
(
'./order/edit-order'
);
var
countDown
=
require
(
'./order/countdown'
);
var
lazyLoad
=
require
(
'yoho-jquery-lazyload'
);
lazyLoad
(
$
(
'img.lazy'
));
function
reload
()
{
location
.
reload
();
...
...
public/js/me/order.page.js
View file @
58cafb0
...
...
@@ -41,6 +41,7 @@ var typeMap = {
};
require
(
'../common/foreach-polyfill'
);
require
(
'../common/bind-polyfill'
);
// 个人中心共用代码加载
require
(
'./me'
);
...
...
public/js/me/order/cancel-order.js
View file @
58cafb0
...
...
@@ -2,6 +2,9 @@ var dialog = require('../../plugins/dialog');
var
_dialog
=
dialog
.
Dialog
;
var
_alert
=
dialog
.
Alert
;
require
(
'../../common/foreach-polyfill'
);
// 添加.check方法
require
(
'../../plugins/check'
);
...
...
public/js/me/order/countdown.js
View file @
58cafb0
...
...
@@ -32,6 +32,7 @@ module.exports = {
if
(
src
<=
0
)
{
timeStr
=
'已失效'
;
$
(
'.hide-when-invalid'
).
hide
();
$
(
'.user-order .table .common-column .pay-operation .left-time'
).
css
(
'margin-left'
,
'0'
);
return
timeStr
;
}
...
...
public/js/me/setting.page.js
View file @
58cafb0
...
...
@@ -34,7 +34,7 @@ var Bll = {
},
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
regName
=
new
RegExp
(
/^
[\u
4e00-
\u
9fa5_
a-zA-Z0-9-
]
+$/
);
var
regRealName
=
new
RegExp
(
/^
[\u
4e00-
\u
9fa5a-zA-Z
]{2,12}
$/
);
var
birthdayForm
=
$
(
'#birthday'
);
var
nickForm
=
$
(
'#nick_name'
);
...
...
public/js/shopping/pay.page.js
View file @
58cafb0
...
...
@@ -87,3 +87,5 @@ $('#go-pay-btn').click(function() {
}
});
});
console
.
log
(
window
.
history
);
...
...
public/scss/channel/_home.css
View file @
58cafb0
...
...
@@ -14,6 +14,10 @@
height
:
$
sliderHeight
;
}
.slide-pagination
{
bottom
:
110px
;
}
.slide-thumb-container
{
height
:
510px
;
}
...
...
@@ -85,12 +89,12 @@
&.prev
{
left
:
50%
;
margin-left
:
-
515
px
;
margin-left
:
-
620
px
;
}
&
.next
{
right
:
50%
;
margin-right
:
-
515
px
;
margin-right
:
-
620
px
;
}
&
:hover
{
...
...
@@ -270,7 +274,7 @@
.main-container
{
position
:
relative
;
top
:
-
60
px
;
top
:
-
85
px
;
margin
:
0
auto
;
box-sizing
:
border-box
;
}
...
...
public/scss/channel/_new-arrival.css
View file @
58cafb0
.new-arrival
{
$
textHeight
:
47px
;
$
imgHeight
:
49
0
px
;
$
imgHeight
:
49
6
px
;
@extend
.resource-container;
...
...
public/scss/channel/_style-icon.css
View file @
58cafb0
...
...
@@ -36,7 +36,7 @@
.brand-text-box
{
$
size
:
16px
;
$
line-height
:
1.
2
;
$
line-height
:
1.
4
;
$
lines-to-show
:
3
;
width
:
0
;
...
...
@@ -58,7 +58,8 @@
left
:
calc
(
$
width
/
2
-
$
buttonWidth
/
2
);
/* stylelint-disable-line */
}
*
{
p
,
h4
{
display
:
none
;
}
}
...
...
public/scss/me/order/_detail.css
View file @
58cafb0
...
...
@@ -20,7 +20,7 @@
height
:
7px
;
background
:
url(/shopping/package-up.png)
;
top
:
-7px
;
left
:
28
2px
;
left
:
39
2px
;
+
.package-item
.package-title
{
border-top
:
none
;
...
...
public/scss/me/return/_change.css
View file @
58cafb0
...
...
@@ -13,6 +13,8 @@
}
&
.change
{
position
:
relative
;
.sub-column
{
margin-top
:
30px
;
...
...
@@ -21,6 +23,14 @@
}
}
.change-tips
{
position
:
absolute
;
top
:
0
;
right
:
0
;
border-color
:
#f1f1f1
;
color
:
#1b1b1b
;
}
.btn
{
&.confirm
{
width
:
130px
;
...
...
public/scss/product/_shop.css
View file @
58cafb0
...
...
@@ -233,6 +233,8 @@
float
:
left
;
height
:
30px
;
line-height
:
30px
;
width
:
1000px
;
overflow
:
hidden
;
div
{
float
:
left
;
margin
:
0
5px
;
...
...
public/scss/shopping/_cart-products.css
View file @
58cafb0
...
...
@@ -53,8 +53,9 @@ $hoverColor: #379ed6;
padding
:
24px
30px
;
li
{
float
:
left
;
display
:
table-cell
;
height
:
134px
;
vertical-align
:
middle
;
}
.chk
{
...
...
@@ -92,10 +93,17 @@ $hoverColor: #379ed6;
width
:
342px
;
padding-left
:
42px
;
font-size
:
12px
;
font-weight
:
bold
;
.brand-name
{
margin-bottom
:
19px
;
display
:
block
;
font-size
:
18px
;
font-weight
:
bold
;
line-height
:
50px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
max-width
:
300px
;
}
.size
{
...
...
@@ -108,11 +116,10 @@ $hoverColor: #379ed6;
}
.pro-name
{
height
:
3
0
px
;
height
:
3
6
px
;
width
:
234px
;
word-wrap
:
break-word
;
margin-bottom
:
13px
;
line-height
:
1.3em
;
margin-bottom
:
5px
;
overflow
:
hidden
;
:hover
{
cursor
:
pointer
;
...
...
@@ -123,6 +130,7 @@ $hoverColor: #379ed6;
.pro-name
>
a
{
height
:
100%
;
display
:
block
;
line-height
:
18px
;
}
.price
{
...
...
@@ -165,7 +173,7 @@ $hoverColor: #379ed6;
}
.editable
{
padding
:
5px
;
padding
:
5px
0
;
width
:
200px
;
position
:
relative
;
...
...
public/scss/shopping/_order.css
View file @
58cafb0
...
...
@@ -427,6 +427,10 @@
.brand-name
{
display
:
block
;
line-height
:
50px
;
width
:
338px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.name
{
...
...
Please
register
or
login
to post a comment