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
fba71c161d9e435942df2b43bc5bf9907c8d1209
1 parent
9e0b414e
fix bugs
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
67 additions
and
34 deletions
apps/me/models/address.js
apps/me/views/partial/setting/act/step1.hbs
apps/me/views/partial/setting/act/step2.hbs
apps/product/controllers/list.js
apps/product/controllers/query.js
apps/product/controllers/shop.js
apps/product/models/helpers.js
apps/product/models/search.js
apps/product/models/shop-service.js
apps/product/views/partial/brand-banner-list.hbs
apps/product/views/partial/list/filter.hbs
apps/shopping/controllers/order.js
apps/shopping/helpers/payment.js
public/js/me/setting/operate.js
public/js/me/setting/validate.js
public/js/plugins/check.js
public/js/product/list/list-search.js
public/scss/product/_shop.css
apps/me/models/address.js
View file @
fba71c1
...
...
@@ -21,7 +21,6 @@ const getAddressDataAsync = (uid, limit) => {
uid
:
uid
,
limit
:
limit
}).
then
(
result
=>
{
console
.
log
(
result
);
return
result
;
});
};
...
...
apps/me/views/partial/setting/act/step1.hbs
View file @
fba71c1
...
...
@@ -19,7 +19,7 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
手机验证码:
</lable>
<input
id=
"msg-code"
type=
"text"
class=
"input small-input"
>
<span
id=
"send-code"
class=
"btn white"
>
发送验证码
</span>
<span
id=
"send-code"
class=
"btn white
disable
"
>
发送验证码
</span>
</div>
<div
class=
"form-group"
>
<span
id=
"mobile-step1"
class=
"btn submit"
>
提交
</span>
...
...
apps/me/views/partial/setting/act/step2.hbs
View file @
fba71c1
...
...
@@ -24,7 +24,7 @@
<div
class=
"form-group"
>
<lable
class=
"label-name"
>
手机验证码:
</lable>
<input
id=
"msg-code"
type=
"text"
class=
"input small-input"
>
<span
id=
"send-code2"
class=
"btn white"
>
发送验证码
</span>
<span
id=
"send-code2"
class=
"btn white
disable
"
>
发送验证码
</span>
</div>
<div
class=
"form-group"
>
<span
id=
"mobile-step2"
class=
"btn submit"
>
提交
</span>
...
...
apps/product/controllers/list.js
View file @
fba71c1
...
...
@@ -21,7 +21,7 @@ const list = {
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
q
.
channel
=
channel
;
q
.
yh_
channel
=
channel
;
let
retData
=
{
module
:
'product'
,
...
...
@@ -76,7 +76,7 @@ const list = {
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
q
.
channel
=
channel
;
q
.
yh_
channel
=
channel
;
let
retData
=
{
module
:
'product'
,
...
...
apps/product/controllers/query.js
View file @
fba71c1
...
...
@@ -29,9 +29,8 @@ const Query = {
query
:
query
};
Promise
.
all
([
Search
.
queryAllSort
(
q
),
Search
.
queryProduct
(
q
)]).
then
(
allResult
=>
{
let
allSort
=
camelCase
(
allResult
[
0
]);
let
result
=
allResult
[
1
];
Promise
.
all
([
Search
.
queryProduct
(
q
)]).
then
(
allResult
=>
{
let
result
=
allResult
[
0
];
if
(
result
&&
result
.
code
===
200
&&
result
.
data
)
{
let
data
=
camelCase
(
result
.
data
);
...
...
@@ -43,12 +42,12 @@ const Query = {
if
(
data
.
filter
)
{
data
.
filter
.
standard
=
data
.
standard
;
data
.
filter
.
groupSort
=
DataHelper
.
sortConvert
(
allSort
.
data
.
sort
);
retData
.
filter
=
DataHelper
.
filterHandle
(
data
.
filter
,
q
);
retData
.
filter
.
showPrice
=
data
.
total
>
10
;
retData
.
filter
.
showInfo
=
(
retData
.
filter
.
style
&&
retData
.
filter
.
style
.
length
>
0
)
||
(
data
.
standard
&&
data
.
standard
.
length
>
0
);
//eslint-disable-line
retData
.
filter
.
useSmallSort
=
1
;
}
retData
.
navPath
=
{
...
...
apps/product/controllers/shop.js
View file @
fba71c1
...
...
@@ -101,7 +101,7 @@ const shop = {
q
.
order
=
q
.
order
||
's_n_desc'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
channel
=
channel
;
q
.
yh_
channel
=
channel
;
ShopData
.
getShopHeadData
(
domain
,
uid
).
then
(
result
=>
{
data
.
banner
=
result
;
...
...
apps/product/models/helpers.js
View file @
fba71c1
...
...
@@ -246,7 +246,7 @@ const helpers = {
let
filters
=
[];
let
customPriceLow
=
''
;
let
customPriceHigh
=
''
;
let
showSize
=
(
!!
q
.
msort
||
!!
q
.
misort
);
let
showSize
=
(
!!
q
.
msort
||
!!
q
.
misort
)
&&
sizeInfo
;
genders
.
forEach
(
g
=>
{
if
(
g
.
value
===
q
.
gender
)
{
...
...
@@ -275,6 +275,9 @@ const helpers = {
s
.
sub
.
unshift
({
categoryName
:
'全部'
+
s
.
categoryName
,
categoryId
:
''
,
relationParameter
:
{
sort
:
s
.
relationParameter
?
s
.
relationParameter
.
sort
:
''
},
checked
:
q
.
msort
&&
q
.
msort
===
s
.
categoryId
&&
!
q
.
misort
});
...
...
apps/product/models/search.js
View file @
fba71c1
...
...
@@ -36,19 +36,24 @@ function _paramHanlde(obj) {
obj
.
standard_value_id
=
standards
[
1
];
}
if
(
obj
.
channel
)
{
switch
(
obj
.
channel
)
{
let
_gender
;
if
(
obj
.
yh_channel
)
{
switch
(
obj
.
yh_channel
)
{
case
'men'
:
obj
.
gender
=
'1,3'
;
_
gender
=
'1,3'
;
break
;
case
'women'
:
obj
.
gender
=
'2,3'
;
_
gender
=
'2,3'
;
break
;
default
:
break
;
}
}
if
(
obj
.
gender
||
_gender
)
{
obj
.
gender
=
obj
.
gender
||
_gender
;
}
return
obj
;
}
...
...
@@ -62,8 +67,9 @@ const Search = {
queryProduct
(
params
)
{
let
finalParams
=
{
method
:
'app.search.li'
,
limit
:
45
method
:
'web.search.search'
,
limit
:
45
,
need_filter
:
'1'
};
Object
.
assign
(
finalParams
,
_paramHanlde
(
params
));
...
...
@@ -72,7 +78,7 @@ const Search = {
},
queryProductOfBrand
(
params
)
{
let
finalParams
=
{
method
:
'
app.search.li
'
,
method
:
'
web.search.search
'
,
limit
:
45
};
...
...
@@ -82,7 +88,7 @@ const Search = {
},
queryNewProduct
(
params
)
{
let
finalParams
=
{
method
:
'
app.search.newProduct
'
,
method
:
'
web.search.search
'
,
limit
:
45
};
...
...
apps/product/models/shop-service.js
View file @
fba71c1
...
...
@@ -139,6 +139,7 @@ const ShopService = {
info
.
info
=
shopIntro
.
shopIntro
;
info
.
btnName
=
'品牌介绍'
;
info
.
isFavorite
=
brandInfo
.
isFavorite
===
'Y'
;
info
.
showShopName
=
shopIntro
.
isShowShopName
===
'Y'
;
let
shopData
=
yield
Promise
.
all
([
ShopService
.
getShopDecorator
(
shopId
),
ShopService
.
getShopSecondSorts
(
domainInfo
.
id
,
shopId
)]);
...
...
apps/product/views/partial/brand-banner-list.hbs
View file @
fba71c1
{{#
banner
}}
<div
class=
"brand-banner"
data-brand=
"
{{
brandId
}}
"
data-shop=
"
{{
shopId
}}
"
>
<div
class=
"brand-img"
style=
"height:150px; background: url('
{{
image
banner
1150
150
}}
')"
></div>
{{#if
showShopName
}}
<div
class=
"shop-name"
>
{{
name
}}
</div>
{{/if}}
<p
class=
"opts"
>
<a
id=
"brand-info"
>
<i
class=
"iconfont"
>

</i>
...
...
apps/product/views/partial/list/filter.hbs
View file @
fba71c1
...
...
@@ -20,7 +20,7 @@
<div
class=
"list-body nano"
>
<div
class=
"nano-content"
>
{{#
each
sortData
}}
<div
class=
"input-radio"
data-value=
"
{{
relationParameter
.
sort
}}
"
<div
class=
"input-radio"
data-value=
"
{{
relationParameter
.
sort
}}
"
data-usesmall=
"
{{
..
/
useSmallSort
}}
"
data-category=
"
{{
categoryId
}}
"
>
{{>
icon
/
radio
}}
<label>
{{
categoryName
}}
</label>
...
...
@@ -39,7 +39,7 @@
<div
class=
"list-body nano"
>
<div
class=
"nano-content"
>
{{#
each
sub
}}
<div
class=
"input-radio"
data-value=
"
{{
relationParameter
.
sort
}}
"
<div
class=
"input-radio"
data-value=
"
{{
relationParameter
.
sort
}}
"
data-usesmall=
"
{{
..
/
..
/
useSmallSort
}}
"
data-category=
"
{{
categoryId
}}
"
>
{{>
icon
/
radio
}}
<label>
{{
categoryName
}}
</label>
...
...
@@ -161,7 +161,7 @@
<div
class=
"title"
>
商品属性
</div>
<div
class=
"yoho-ui-accordion"
>
<div
class=
"yoho-ui-accordion
no-active
"
>
{{#if
style
}}
<h3>
风格
</h3>
<div
class=
"body"
>
...
...
apps/shopping/controllers/order.js
View file @
fba71c1
...
...
@@ -62,7 +62,7 @@ const index = (req, res, next) => {
}
];
res
.
header
(
'Cache-Control'
,
'no-
cach
e'
);
res
.
header
(
'Cache-Control'
,
'no-
stor
e'
);
res
.
display
(
'order'
,
{
content
:
data
,
...
...
apps/shopping/helpers/payment.js
View file @
fba71c1
...
...
@@ -53,7 +53,6 @@ const Payment = {
let
bankCode
=
''
;
// 暂时写成'', 参考php代码 Payment.php:564
console
.
log
(
paymentRecord
);
if
(
!
paymentRecord
||
paymentRecord
.
code
!==
200
||
!
prePayResult
||
prePayResult
.
code
!==
200
)
{
let
message
=
paymentRecord
&&
paymentRecord
.
message
?
paymentRecord
.
message
:
'系统繁忙,请稍后再试'
;
...
...
public/js/me/setting/operate.js
View file @
fba71c1
...
...
@@ -11,7 +11,7 @@ var type = types[types.length - 1];// 界面操作类型
var
$imgCaptchaInput
=
$
(
'#captcha'
);
var
second
=
60
;
var
$sms
=
$
(
'#send-code2'
);
// 发送短信验证码按钮
var
area
=
$
(
'#country-code'
).
text
().
substring
(
0
)
||
'86'
;
// 地区码
var
area
=
$
(
'#country-code'
).
text
().
substring
(
1
)
||
'86'
;
// 地区码
// 发送短信后倒计时显示
var
disableSMSBtn
=
function
()
{
second
-=
1
;
...
...
@@ -53,6 +53,7 @@ $('[placeholder]').placeholder();
*/
$
(
'#region'
).
on
(
'change'
,
function
()
{
$
(
'#country-code'
).
text
(
$
(
this
).
val
());
area
=
$
(
this
).
val
().
substring
(
1
);
});
// 校验手机号码
...
...
@@ -71,6 +72,7 @@ $('#real-mobile').blur(function() {
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
$sms
.
removeClass
(
'disable'
);
self
.
find
(
'.tips-success'
).
addClass
(
'ok'
).
show
();
self
.
find
(
'.tips-error'
).
removeClass
(
'notok'
).
hide
();
}
else
{
...
...
public/js/me/setting/validate.js
View file @
fba71c1
...
...
@@ -8,7 +8,7 @@ var dialog = require('../../plugins/dialog');
var
_alert
=
dialog
.
Alert
;
var
types
=
location
.
pathname
.
split
(
'/'
);
var
type
=
types
[
types
.
length
-
1
];
// 界面操作类型
var
area
=
$
(
'#country-code'
).
text
()
||
'86'
;
var
area
=
$
(
'#country-code'
).
text
()
.
substring
(
1
)
||
'86'
;
/**
* 手机号码验证
...
...
public/js/plugins/check.js
View file @
fba71c1
...
...
@@ -24,10 +24,12 @@ var jQuery = require('yoho-jquery');
init
:
function
(
options
)
{
var
type
=
options
.
type
||
defaults
.
type
;
var
ele
=
this
;
var
_checked
=
options
.
checked
||
$
(
'.iconfont'
,
this
).
hasClass
(
'checked'
)
;
var
_checked
;
options
=
$
.
extend
({},
defaults
,
$
(
this
).
data
(
'options'
),
defaultsHtml
[
type
],
options
);
_checked
=
options
.
checked
||
$
(
'.iconfont'
,
this
).
hasClass
(
'checked'
);
$
(
'.iconfont'
,
this
).
removeClass
(
'radio'
).
removeClass
(
'checkbox'
).
addClass
(
options
.
type
);
$
(
'.iconfont'
,
this
).
html
(
_checked
?
options
.
checkedHtml
:
options
.
uncheckedHtml
);
...
...
public/js/product/list/list-search.js
View file @
fba71c1
...
...
@@ -59,15 +59,23 @@ var YohoListPage = {
type
:
'radio'
,
group
:
'sort'
,
onChange
:
function
(
ele
)
{
var
useSmall
=
$
(
ele
).
data
(
'usesmall'
)
===
1
;
var
subCategoryId
=
$
(
ele
).
data
(
'category'
);
var
sort
=
$
(
ele
).
data
(
'value'
);
var
categoryId
=
$
(
ele
).
parents
(
'.body'
).
data
(
'value'
);
var
data
=
{
page
:
1
,
size
:
''
};
YohoListPage
.
go
({
msort
:
categoryId
,
misort
:
subCategoryId
,
size
:
''
,
page
:
1
});
if
(
useSmall
)
{
data
.
sort
=
sort
;
}
else
{
data
.
msort
=
categoryId
;
data
.
misort
=
subCategoryId
;
}
YohoListPage
.
go
(
data
);
}
});
...
...
public/scss/product/_shop.css
View file @
fba71c1
...
...
@@ -11,6 +11,15 @@
background-size
:
100%
100%
;
position
:
relative
;
.shop-name
{
display
:
block
;
position
:
absolute
;
left
:
20px
;
bottom
:
15px
;
font-size
:
35px
;
color
:
#fff
;
}
p
.opts
{
display
:
block
;
position
:
absolute
;
...
...
Please
register
or
login
to post a comment