Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
99825c63aa1ad64eacc0efec11ce96ee16822369
2 parents
09edee08
2f18a3ac
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
69 deletions
static/js/me/fav.js
static/js/product/detail/desc.js
static/sass/product/_detail.scss
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
static/js/me/fav.js
View file @
99825c6
...
...
@@ -80,9 +80,6 @@ function loadData($parent, url, page) {
page
:
page
},
success
:
function
(
data
)
{
//setTimeout(function() { //模拟延时
if
(
url
===
'favBrand'
)
{
$brandLoadMore
.
addClass
(
'hide'
);
}
else
{
...
...
@@ -95,7 +92,6 @@ function loadData($parent, url, page) {
}
else
if
(
data
===
'end'
)
{
$parent
.
closest
(
'.fav-type'
).
find
(
'.fav-load-background'
)
.
removeClass
(
'fav-load-background'
).
html
(
'没有更多了'
);
}
else
if
(
data
.
length
>
10
)
{
$parent
.
append
(
data
);
$parent
.
closest
(
'.fav-type'
).
find
(
'.fav-content-loading'
).
remove
();
...
...
@@ -106,14 +102,8 @@ function loadData($parent, url, page) {
}
else
{
lockId
=
false
;
//请求成功后解锁商品收藏page++
}
window
.
rePosFooter
();
}
else
{
return
;
}
//},1000);
window
.
rePosFooter
();
}
});
}
...
...
static/js/product/detail/desc.js
View file @
99825c6
...
...
@@ -37,19 +37,28 @@ function hiddenTips($ele) {
}
}
function
isFlexSupport
()
{
var
flex
=
document
.
createElement
(
'p'
).
style
.
flex
,
webkitFlex
=
document
.
createElement
(
'p'
).
style
.
webkitFlex
,
flexWrap
=
document
.
createElement
(
'p'
).
style
.
flexWrap
;
if
((
flex
===
''
||
webkitFlex
===
''
)
&&
flexWrap
===
''
)
{
return
true
;
}
else
{
return
false
;
}
//function isFlexSupport() {
// var flex = document.createElement('p').style.flex,
// webkitFlex = document.createElement('p').style.webkitFlex,
// flexWrap = document.createElement('p').style.flexWrap;
//
// if ((flex === '' || webkitFlex === '') && flexWrap === '') {
// return true;
// } else {
// return false;
// }
//}
function
wrapElements
(
selector
,
count
)
{
$
(
selector
).
each
(
function
(
idx
,
el
)
{
if
(
idx
%
count
===
0
)
{
$
(
$
(
selector
).
slice
(
idx
,
idx
+
count
)).
wrapAll
(
$
(
'<div class="js-wraper"></div>'
));
}
});
}
function
search
()
{
if
(
searching
||
end
)
{
return
;
...
...
@@ -84,9 +93,10 @@ function search() {
hiddenTips
(
$
(
'#size-swiper-container'
));
hiddenTips
(
$
(
'#reference-swiper-container'
));
if
(
!
isFlexSupport
())
{
$
(
'.detail .column'
).
removeClass
(
'column'
).
addClass
(
'oldbox'
);
}
//if (!isFlexSupport()) {
// $('.detail .column').removeClass('column').addClass('oldbox');
//}
wrapElements
(
'.detail .column'
,
2
);
searching
=
false
;
end
=
true
;
loading
.
hideLoadingMask
();
...
...
static/sass/product/_detail.scss
View file @
99825c6
...
...
@@ -47,50 +47,53 @@ $basicBtnC:#eb0313;
}
&
.table
{
@include
flexbox
((
.js-wraper
{
@include
flexbox
((
display
:
box
,
box-lines
:
multiple
,
box-pack
:
start
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
flex-wrap
:
wrap
,
justify-content
:
flex-start
));
width
:
100%
;
.column
{
box-sizing
:
border-box
;
//padding: pxToRem(20px) pxToRem(12px);
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
border
:
1px
solid
#fff
;
font-size
:
pxToRem
(
24px
);
background-color
:
$tableCellC
;
word-wrap
:
break-word
;
@include
flexbox
((
box-flex
:
1
.0
,
display
:
box
,
box-align
:
center
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
align-items
:
center
,
flex-basis
:
49
.9%
))
}
.oldbox
{
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
background-color
:
$tableCellC
;
box-sizing
:
border-box
;
border
:
1px
solid
#fff
;
width
:
49
.9%
;
height
:
100%
;
float
:
left
;
text-overflow
:ellipsis
;
white-space
:nowrap
;
overflow
:hidden
;
}
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
flex-wrap
:
wrap
,
justify-content
:
flex-start
));
}
width
:
100%
;
.column
{
box-sizing
:
border-box
;
//padding: pxToRem(20px) pxToRem(12px);
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
border
:
1px
solid
#fff
;
font-size
:
pxToRem
(
24px
);
background-color
:
$tableCellC
;
word-wrap
:
break-word
;
@include
flexbox
((
box-flex
:
1
.0
,
display
:
box
,
box-align
:
center
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
align-items
:
center
,
flex-basis
:
49
.9%
))
}
.oldbox
{
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
background-color
:
$tableCellC
;
box-sizing
:
border-box
;
border
:
1px
solid
#fff
;
width
:
49
.9%
;
height
:
100%
;
float
:
left
;
text-overflow
:ellipsis
;
white-space
:nowrap
;
overflow
:hidden
;
}
}
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
99825c6
...
...
@@ -187,10 +187,14 @@ class UserModel
$datas
=
array
();
$product
=
array
();
foreach
(
$favProduct
[
'data'
][
'product_list'
]
as
$val
)
{
if
(
empty
(
$val
[
'product_skn'
]))
{
continue
;
}
$product
=
array
();
$product
[
'fav_id'
]
=
$val
[
'product_id'
];
$product
[
'link'
]
=
isset
(
$val
[
'goodsId'
])
?
Helpers
::
url
(
'/product/pro_'
.
$val
[
'product_id'
]
.
'_'
.
$val
[
'goodsId'
]
.
'/'
.
$val
[
'cnAlphabet'
]
.
'.html'
)
:
''
;
$product
[
'imgUrl'
]
=
Helpers
::
getImageUrl
(
$val
[
'image'
],
447
,
596
);
$product
[
'link'
]
=
isset
(
$val
[
'goodsId'
],
$val
[
'cnAlphabet'
])
?
Helpers
::
url
(
'/product/pro_'
.
$val
[
'product_id'
]
.
'_'
.
$val
[
'goodsId'
]
.
'/'
.
$val
[
'cnAlphabet'
]
.
'.html'
)
:
''
;
$product
[
'imgUrl'
]
=
!
empty
(
$val
[
'image'
])
?
Helpers
::
getImageUrl
(
$val
[
'image'
],
447
,
596
)
:
''
;
;
$product
[
'title'
]
=
$val
[
'product_name'
];
$product
[
'price'
]
=
!
empty
(
$val
[
'market_price'
])
?
'¥'
.
$val
[
'market_price'
]
.
'.00'
:
0
;
...
...
@@ -247,8 +251,12 @@ class UserModel
// 处理品牌产品
$product
=
array
();
foreach
(
$val
[
'new_product'
]
as
$one
)
{
if
(
empty
(
$one
[
'product_skn'
]))
{
continue
;
}
$product
=
array
();
$product
[
'link'
]
=
isset
(
$one
[
'goods'
][
0
])
?
Helpers
::
url
(
'/product/pro_'
.
$one
[
'product_id'
]
.
'_'
.
$one
[
'goods'
][
0
][
'id'
]
.
'/'
.
$one
[
'cnAlphabet'
]
.
'.html'
)
:
''
;
$product
[
'link'
]
=
isset
(
$one
[
'goods'
][
0
]
,
$one
[
'cnAlphabet'
]
)
?
Helpers
::
url
(
'/product/pro_'
.
$one
[
'product_id'
]
.
'_'
.
$one
[
'goods'
][
0
][
'id'
]
.
'/'
.
$one
[
'cnAlphabet'
]
.
'.html'
)
:
''
;
$product
[
'imgUrl'
]
=
(
isset
(
$one
[
'default_images'
])
&&
!
empty
(
$one
[
'default_images'
]))
?
Images
::
getImageUrl
(
$one
[
'default_images'
],
235
,
314
)
:
''
;
$product
[
'price'
]
=
!
empty
(
$one
[
'market_price'
])
?
'¥'
.
$one
[
'market_price'
]
:
0
;
$product
[
'discount'
]
=
(
$one
[
'market_price'
]
>
$one
[
'sales_price'
])
?
'¥'
.
$one
[
'sales_price'
]
:
false
;
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
99825c6
...
...
@@ -177,7 +177,7 @@ class NewsaleController extends AbstractAction
$color
=
$this
->
get
(
'color'
,
null
);
$size
=
$this
->
get
(
'size'
,
null
);
$price
=
$this
->
get
(
'price'
,
null
);
$p_d
=
'0.1,0.3'
;
$p_d
=
$this
->
get
(
'discount'
,
null
)
;
$dayLimit
=
$this
->
get
(
'dayLimit'
,
null
);
$limit
=
$this
->
get
(
'limit'
,
60
);
$page
=
$this
->
get
(
'page'
,
1
);
...
...
Please
register
or
login
to post a comment