Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
uedxwg
9 years ago
Commit
69b9083f2ba1c41c0acf829ed76553c8e74260a0
2 parents
00a386fb
129f97a9
update
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
93 additions
and
39 deletions
static/js/product/detail/desc.js
static/js/product/detail/detail.js
static/js/product/recommend-for-you.js
static/sass/me/_home.scss
static/sass/me/_online-service.scss
static/sass/product/_detail.scss
static/sass/product/_product-description.scss
template/m.yohobuy.com/actions/index/home/recommend-content.phtml
template/m.yohobuy.com/actions/product/detail/index.phtml
template/m.yohobuy.com/partials/good.phtml
template/m.yohobuy.com/partials/product/recommend-content.phtml
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
static/js/product/detail/desc.js
View file @
69b9083
...
...
@@ -19,6 +19,8 @@ var introUrl = $('#introUrl').val(),
var
sizeSwiper
,
refSwiper
;
require
(
'../recommend-for-you.js'
);
function
search
()
{
if
(
searching
||
end
)
{
return
;
...
...
@@ -46,6 +48,15 @@ function search() {
slidesPerView
:
'auto'
});
//优选
// recommendSwiper = new Swiper('#swiper-recommend', {
// slidesPerView: 'auto',
// grabCursor: true,
// slideElement: 'li',
// lazyLoading: true,
// watchSlidesVisibility: true
// });
searching
=
false
;
end
=
true
;
loading
.
hideLoadingMask
();
...
...
static/js/product/detail/detail.js
View file @
69b9083
...
...
@@ -11,6 +11,7 @@ var goodsSwiper;
require
(
'./desc'
);
require
(
'./comments-consults'
);
require
(
'../recommend-for-you.js'
);
lazyLoad
(
$
(
'img.lazy'
));
...
...
static/js/product/recommend-for-you.js
View file @
69b9083
...
...
@@ -5,14 +5,23 @@
*/
var
Swiper
=
require
(
'yoho.iswiper'
);
var
Swiper
=
require
(
'yoho.iswiper'
),
$
=
require
(
'jquery'
);
var
recommendSwiper
;
var
recommendSwiper
,
$recommendForYou
=
$
(
'.recommend-for-you'
);
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'li'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
$
.
get
(
'/home/preference'
).
then
(
function
(
html
)
{
$recommendForYou
.
html
(
html
);
if
(
$
(
'#swiper-recommend'
).
length
)
{
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'li'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
}
}).
fail
(
function
()
{
$recommendForYou
.
hide
();
});
\ No newline at end of file
...
...
static/sass/me/_home.scss
View file @
69b9083
.my-page
{
color
:
#444
;
background
:
#f0f0f0
;
a
{
color
:
#444
;
}
.user-info
{
display
:
block
;
position
:
relative
;
...
...
@@ -136,7 +141,7 @@
}
.iconfont
{
font-size
:
pxToRem
(
6
0px
);
font-size
:
pxToRem
(
4
0px
);
}
}
}
...
...
static/sass/me/_online-service.scss
View file @
69b9083
...
...
@@ -58,6 +58,7 @@
float
:
right
;
margin-right
:
rem
(
30
);
color
:
#ccc
;
font-size
:
rem
(
32
);
}
&
:last-child
{
...
...
@@ -87,6 +88,7 @@
.icon-yoho-enter
{
color
:
#ccc
;
float
:
right
;
font-size
:
rem
(
32
);
}
.connect-item
{
...
...
static/sass/product/_detail.scss
View file @
69b9083
...
...
@@ -342,6 +342,10 @@ $basicBtnC:#eb0313;
font-size
:
pxToRem
(
47px
);
color
:
#444
;
}
&
.unfavorite
{
font-size
:
pxToRem
(
34px
);
color
:
#ccc
;
}
&
.favorite
{
font-size
:
pxToRem
(
34px
);
color
:
$basicBtnC
;
...
...
@@ -374,6 +378,10 @@ $basicBtnC:#eb0313;
font-size
:
pxToRem
(
24px
);
}
}
.recommend-for-you
{
margin-bottom
:
pxToRem
(
120px
);
}
}
@import
"comments-consults"
;
@import
"product-description"
;
\ No newline at end of file
...
...
static/sass/product/_product-description.scss
View file @
69b9083
...
...
@@ -6,6 +6,7 @@
margin-top
:
pxToRem
(
22px
);
}
.detail
{
background-color
:
$tableCellC
;
&
.table
.inner-container
{
background-color
:
$tableCellC
;
}
...
...
@@ -89,7 +90,7 @@
}
}
margin-top
:
pxToRem
(
30px
);
margin-bottom
:
pxToRem
(
12
0px
);
margin-bottom
:
pxToRem
(
3
0px
);
}
.detail-swiper
{
.swiper-wrapper
{
...
...
template/m.yohobuy.com/actions/index/home/recommend-content.phtml
0 → 100644
View file @
69b9083
{
{>
product/recommend-content
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
69b9083
...
...
@@ -2,8 +2,6 @@
<div
class=
"good-detail-page yoho-page"
>
<div
class=
"banner-container"
>
<div
class=
"tag-container"
>
<p
class=
"good-tag new-tag"
>NEW</p>
<p
class=
"good-tag renew-tag"
>再到着</p>
{
{#
tags
}
}
{
{#
is_new
}
}
<p
class=
"good-tag new-tag"
>NEW</p>
...
...
@@ -103,8 +101,7 @@
{
{/
enterStore
}
}
<div
id=
"productDesc"
></div>
<!--
{
{>product/product-description
}
}
-->
{
{>
product/recommend-for-you
}
}
{
{#cartInfo
}
}
<div
class=
"cart-bar"
>
...
...
@@ -117,7 +114,11 @@
{
{else
}
}
<a
href=
""
class=
"sold-out"
>已售罄</a>
{
{/if
}
}
<a
href=
""
class=
"favorite iconfont"
>
605
;</a>
{
{#if
favorite
}
}
<a
href=
""
class=
"favorite iconfont "
>
605
;</a>
{
{else
}
}
<a
href=
""
class=
"unfavorite iconfont "
>
605
;</a>
{
{/if
}
}
</div>
{
{/cartInfo
}
}
...
...
template/m.yohobuy.com/partials/good.phtml
View file @
69b9083
...
...
@@ -12,7 +12,7 @@
<p
class=
"good-tag sale-tag"
>SALE</p>
{
{/
is_discount
}
}
{
{#
is_yohoood
}
}
<div
class=
"good-tag yohood-tag"
></div
>
<p
class=
"good-tag new-festival-tag"
>新品节</p
>
{
{/
is_yohoood
}
}
{
{#
is_limited
}
}
<p
class=
"good-tag limit-tag"
>限量商品</p>
...
...
template/m.yohobuy.com/partials/product/recommend-content.phtml
0 → 100644
View file @
69b9083
<div class="title">为您优选新品</div>
<div id="swiper-recommend" class="swiper-container">
<ul class="swiper-wrapper swiper-wrapper-recommend">
{{#recommendList}}
<li class="swiper-slide">
<img class="swiper-lazy img-box" data-src="{{thumb}}">
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}<span class="old-price">¥{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/recommendList}}
</ul>
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
View file @
69b9083
{
{#
recommendForYou
}
}
<div
class=
"recommend-for-you"
>
<div
class=
"title"
>为您优选新品</div>
<div
id=
"swiper-recommend"
class=
"swiper-container"
>
<ul
class=
"swiper-wrapper swiper-wrapper-recommend"
>
{
{#recommendList
}
}
<li
class=
"swiper-slide"
>
<img
class=
"swiper-lazy img-box"
data-src=
"{{thumb}}"
>
<div
class=
"price"
>
<span
class=
"sale-price {{^price}}no-price{{/price}}"
>¥
{
{salePrice
}
}</span>
{
{#price
}
}<span
class=
"old-price"
>¥
{
{.
}
}</span>
{
{/price
}
}
</div>
<div
class=
"swiper-lazy-preloader"
></div>
</li>
{
{/recommendList
}
}
</ul>
</div>
</div>
{
{/
recommendForYou
}
}
\ No newline at end of file
<div class="recommend-for-you">
</div>
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
69b9083
...
...
@@ -51,18 +51,35 @@ class HomeController extends AbstractAction
);
$uid
=
$this
->
getUid
();
if
(
$uid
)
{
// 优选新品数据
$channel
=
Helpers
::
getChannelByCookie
();
$data
[
'isLogin'
]
=
true
;
$data
+=
UserModel
::
getUserProfileData
(
$uid
);
$data
+=
UserModel
::
getInfoNumData
(
$uid
);
$data
[
'recommendForYou'
]
=
UserModel
::
getPreferenceData
(
$channel
);
}
$this
->
_view
->
display
(
'index'
,
$data
);
}
/**
* 为您优选
*/
public
function
preferenceAction
()
{
$result
=
array
();
if
(
$this
->
isAjax
())
{
// 优选新品数据
$channel
=
Helpers
::
getChannelByCookie
();
$result
=
UserModel
::
getPreferenceData
(
$channel
);
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
$this
->
_view
->
display
(
'recommend-content'
,
$result
);
}
}
/**
* 用户收藏的商品
*/
...
...
Please
register
or
login
to post a comment