Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
f70a6081e2e91192fdef1373465eca80d3bd4e00
2 parents
85fba634
45eda8f6
Merge branch 'gray' into 'master'
Gray See merge request
!367
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
49 additions
and
19 deletions
apps/cart/views/action/order-ensure.hbs
apps/home/views/action/home/address/address.hbs
apps/home/views/action/home/orders/order-detail.hbs
apps/product/models/sale.js
apps/shopping/views/action/pay.hbs
doraemon/views/partial/common/simple-header.hbs
package.json
public/js/cart/order/address.js
public/js/cart/order/invoice.js
public/js/header.js
public/js/simple-header.js
utils/cleanHtml.js
utils/helpers.js
apps/cart/views/action/order-ensure.hbs
View file @
f70a608
...
...
@@ -12,11 +12,11 @@
{{#
deliveryAddress
}}
<div
class=
"addr-item
{{#
isY
is_default
}}
addr-default
{{/
isY
}}{{#if
selected
}}
addr-select
{{/if}}
"
data-id=
"
{{
id
}}
"
data-consignee=
"
{{
consignee
}}
"
data-mobile=
"
{{
mobile
}}
"
data-phone=
"
{{
phone
}}
"
data-area=
"
{{
area
}}
"
data-code=
"
{{
area_code
}}
"
data-address=
"
{{
address
}}
"
{{#
isY
is_default
}}
data-default=
"1"
{{/
isY
}}{{#
isY
is_support
}}
data-delivery=
"1"
{{/
isY
}}{{#
isY
is_cash_delivery
}}
data-cashdelivery=
"1"
{{/
isY
}}
>
<p
class=
"name"
>
{{{
consignee
}}}
{{{
htmlEncode
consignee
}}}
<span
class=
"right"
>
{{
mobile
}}
</span>
</p>
<p
class=
"area"
>
{{
area
}}
</p>
<p
class=
"street fw300"
>
{{{
address
}}}
</p>
<p
class=
"street fw300"
>
{{{
htmlEncode
address
}}}
</p>
<p
class=
"option"
>
<label
class=
"set-default"
>
设为默认
</label>
<label
class=
"default-tip"
>
默认地址
</label>
...
...
apps/home/views/action/home/address/address.hbs
View file @
f70a608
...
...
@@ -14,9 +14,9 @@
{{#
each
addressList
}}
<li
class=
"address-content
{{#if
isPreferred
}}
preferred
{{/if}}
"
addressId=
{{
id
}}
>
<div
class=
"address-detail"
>
<strong>
收货人:
{{{
addressee
}}}
</strong>
<strong>
收货人:
{{{
htmlEncode
addressee
}}}
</strong>
<br>
收货地址:
{{{
address
}}}
收货地址:
{{{
htmlEncode
address
}}}
<br>
联系电话:
{{
phone
}}
<br>
...
...
apps/home/views/action/home/orders/order-detail.hbs
View file @
f70a608
...
...
@@ -103,14 +103,14 @@
</p>
<div
class=
"content"
>
{{#if
normal
}}
<p>
收货人:
{{{
receiver
}}}
</p>
<p>
收货地址:
{{{
address
}}}
</p>
<p>
收货人:
{{{
htmlEncode
receiver
}}}
</p>
<p>
收货地址:
{{{
htmlEncode
address
}}}
</p>
<p>
联系电话:
{{
phone
}}
</p>
{{/if}}
{{#if
offlineByExpress
}}
<p>
收货人:
{{{
receiver
}}}
</p>
<p>
收货地址:
{{{
address
}}}
</p>
<p>
收货人:
{{{
htmlEncode
receiver
}}}
</p>
<p>
收货地址:
{{{
htmlEncode
address
}}}
</p>
<p>
联系电话:
{{
phone
}}
</p>
<p>
下单门店:
{{
offlineStore
}}
</p>
...
...
@@ -135,7 +135,7 @@
{{#if
pdfUrl
}}
<a
class=
"invoice-button"
href=
"
{{
pdfUrl
}}
"
>
电子发票下载
</a>
{{/if}}
</div>
<p>
发票抬头:
{{
title
}}
</p>
<p>
发票抬头:
{{
{
title
}
}}
</p>
{{^}}
<p>
暂不需要发票
{{/if}}
...
...
apps/product/models/sale.js
View file @
f70a608
...
...
@@ -527,7 +527,11 @@ function getSalebreakingYardsData(params, channel) {
finalResult
.
filters
=
publicHandler
.
handleSaleFilterData
(
Object
.
assign
(
subResult
[
1
].
data
.
filter
,
{
size
:
result
[
2
].
data
}),
params
,
baseUrl
);
// 断码区尺码筛选无效,去除尺码筛选项
_
.
unset
(
finalResult
.
filters
,
'size'
);
}
Object
.
assign
(
finalResult
,
{
goods
:
productProcess
.
processProductList
(
subResult
[
1
].
data
.
product_list
),
opts
:
publicHandler
.
handleSaleOptsData
(
params
,
subResult
[
1
].
data
.
total
,
''
,
baseUrl
),
...
...
apps/shopping/views/action/pay.hbs
View file @
f70a608
...
...
@@ -13,7 +13,7 @@
<h2>
您的订单已成功,现在就去付款吧~
</h2>
<h3>
您的订单号:
<strong
class=
"order-num"
>
{{
order_code
}}
</strong>
应付金额:
<strong>
{{
payment_amount
}}
</strong>
元
支付方式:在线支付
送货时间:
{{
deliveryTimes
}}
</h3>
<h4>
{{{
..
/
username
}}}
,如果2小时内您无法完成付款,系统会将您的订单取消。
</h4>
<h4>
{{{
htmlEncode
..
/
username
}}}
,如果2小时内您无法完成付款,系统会将您的订单取消。
</h4>
</div>
{{/
order
}}
...
...
doraemon/views/partial/common/simple-header.hbs
View file @
f70a608
...
...
@@ -13,7 +13,7 @@
<li>
<span>
Hi~
</span>
{{#
user
}}
<a
href=
"
{{
userCenter
}}
"
>
{{
.
}}
</a>
<a
href=
"
{{
userCenter
}}
"
>
{{
htmlEncode
.
}}
</a>
{{/
user
}}
{{#
loginHref
}}
...
...
package.json
View file @
f70a608
{
"name"
:
"yohobuy-node"
,
"version"
:
"6.6.1
2
"
,
"version"
:
"6.6.1
4
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
public/js/cart/order/address.js
View file @
f70a608
...
...
@@ -10,6 +10,7 @@ var $ = require('yoho-jquery'),
dialog
=
require
(
'../../common/dialog'
);
var
stringHandle
=
require
(
'../../common/stringHandle'
);
var
cleanHtml
=
require
(
'../../../../utils/cleanHtml'
);
var
Dialog
=
dialog
.
Dialog
,
Confirm
=
dialog
.
Confirm
,
...
...
@@ -234,8 +235,8 @@ function setShowDeliveryAddr(data) {
$supportWay2
.
val
(
data
.
delivery
?
1
:
0
).
change
();
},
0
);
_h
=
'寄送至:'
+
data
.
area
+
' '
+
data
.
address
+
'<br>收货人:'
+
data
.
consignee
+
' '
+
data
.
mobile
;
_h
=
'寄送至:'
+
data
.
area
+
' '
+
cleanHtml
.
htmlEncode
(
data
.
address
)
+
'<br>收货人:'
+
cleanHtml
.
htmlEncode
(
data
.
consignee
)
+
' '
+
data
.
mobile
;
}
$deliveryAddr
.
html
(
_h
);
}
...
...
public/js/cart/order/invoice.js
View file @
f70a608
...
...
@@ -8,6 +8,7 @@ var $ = require('yoho-jquery');
var
yas
=
require
(
'../../common/data-yas'
);
var
Dialog
=
require
(
'../../common/dialog'
).
Dialog
;
var
cleanHtml
=
require
(
'../../../../utils/cleanHtml'
);
var
$invoiceRadio
=
$
(
'#invoice-radio'
);
...
...
@@ -143,7 +144,7 @@ function setShowInvoiceInfo() {
_h
+=
'电子发票'
;
}
_h
+=
' '
+
invoiceInfo
.
titleName
;
_h
+=
' '
+
cleanHtml
.
htmlEncode
(
invoiceInfo
.
titleName
)
;
$dom
.
removeClass
(
'hide'
).
find
(
'span'
).
html
(
_h
);
}
...
...
public/js/header.js
View file @
f70a608
...
...
@@ -10,6 +10,8 @@ var $tool = $('.tool-wrapper'),
$yohoGroup
=
$tool
.
find
(
'.yoho-group'
),
$loginBox
=
$
(
'#loginBox'
);
var
cleanHtml
=
require
(
'../../utils/cleanHtml'
);
var
$head
=
$
(
'.head-wrapper'
),
$searchForm
=
$
(
'#search-form'
),
$searchKey
=
$searchForm
.
find
(
'.search-key'
),
...
...
@@ -283,6 +285,7 @@ function updateLoginInfo(data) {
data
.
vip3
=
true
;
}
data
.
profileName
=
cleanHtml
.
htmlEncode
(
data
.
profileName
);
$tool
.
find
(
'.simple-user-center'
).
html
(
centerFn
(
data
));
}
...
...
@@ -608,7 +611,7 @@ cartTimer = setInterval(syncCratInfo, 2000); // 定时同步购物车数量
var
info
=
{
usercenter
:
'//www.yohobuy.com/home?t='
+
new
Date
().
getTime
(),
nickname
:
profileName
,
nickname
:
cleanHtml
.
htmlEncode
(
profileName
)
,
signout
:
'//www.yohobuy.com/logout.html'
};
...
...
public/js/simple-header.js
View file @
f70a608
var
$
=
require
(
'yoho-jquery'
);
var
$apiDom
=
$
(
'#api-domain'
);
var
cleanHtml
=
require
(
'../../utils/cleanHtml'
);
require
(
'./common'
);
...
...
@@ -57,7 +58,7 @@ function formatUsernName(userName) {
name
+=
'...'
;
}
}
return
name
;
return
cleanHtml
.
htmlEncode
(
name
)
;
}
/**
...
...
utils/cleanHtml.js
View file @
f70a608
...
...
@@ -10,7 +10,7 @@ const htmlEntity = {
};
exports
.
htmlDecode
=
function
(
txt
)
{
txt
=
txt
||
''
;
txt
=
txt
+
''
||
''
;
return
txt
.
replace
(
/
((
&
(([
a-z
][
a-z0-9
]
*
)
|
(
#
[
0-9
]
+
)
|
(
#x
[
0-9a-f
]
+
))
;
)
|
[
"'<>&
])
/gi
,
function
(
s
)
{
s
=
s
||
''
;
const
s1
=
htmlEntity
[
s
.
toLowerCase
()];
...
...
@@ -24,7 +24,8 @@ exports.htmlDecode = function(txt) {
};
exports
.
htmlEncode
=
function
(
str
)
{
str
=
str
||
''
;
str
=
str
+
''
||
''
;
return
str
.
replace
(
re
,
function
(
s
)
{
switch
(
s
)
{
case
'"'
:
...
...
utils/helpers.js
View file @
f70a608
...
...
@@ -83,5 +83,24 @@ module.exports = {
}
else
{
return
opt
.
inverse
(
this
);
}
},
htmlEncode
:
function
(
str
)
{
const
re
=
/
(\r\n)
|
[
"
\'
<>
]
/g
;
str
=
str
+
''
||
''
;
return
str
.
replace
(
re
,
function
(
s
)
{
switch
(
s
)
{
case
'"'
:
return
'"'
;
case
'\''
:
return
'''
;
case
'<'
:
return
'<'
;
case
'>'
:
return
'>'
;
default
:
return
s
;
}
});
}
};
...
...
Please
register
or
login
to post a comment