Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
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
lore-w
9 years ago
Commit
ba3a4a9ea70853f792675676ca2be7dc50a6bc92
2 parents
3e263207
da79a157
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Conflicts: framework
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
109 additions
and
51 deletions
static/js/product/detail/detail.js
static/js/product/recommend-for-you.js
static/sass/product/_recommend-for-you.scss
template/m.yohobuy.com/actions/index/home/index.phtml
template/m.yohobuy.com/actions/product/detail/index.phtml
template/m.yohobuy.com/partials/product/banner_swiper_arrow.phtml
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
static/js/product/detail/detail.js
View file @
ba3a4a9
...
...
@@ -13,9 +13,9 @@ var goodsSwiper,
// winH = $(window).height(),
sizeSwiper
,
refSwiper
,
commentsNum
,
handleHelper
;
lazyLoad
(
$
(
'img.lazy'
));
goodsSwiper
=
new
Swiper
(
'.banner-swiper'
,
{
...
...
@@ -28,22 +28,56 @@ goodsSwiper = new Swiper('.banner-swiper', {
prevButton
:
'.my-swiper-button-prev'
});
//初始化tab
(
function
()
{
var
consultsNum
=
$
(
'#nav-tab .consults-num'
).
html
()
-
0
;
$
(
'#nav-tab li'
).
on
(
'click'
,
function
()
{
var
index
=
$
(
this
).
index
();
commentsNum
=
$
(
'#nav-tab .comments-num'
).
html
()
-
0
;
if
(
!
$
(
this
).
hasClass
(
'focus'
))
{
$
(
'#nav-tab li'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'focus'
);
});
$
(
'#feedback-content .content'
).
each
(
function
()
{
$
(
this
).
addClass
(
'hide'
);
});
if
(
0
!==
commentsNum
)
{
$
(
'#nav-tab .comment-nav'
).
addClass
(
'focus'
);
$
(
'#feedback-content .comment-content'
).
removeClass
(
'hide'
);
}
else
if
(
0
!==
consultsNum
)
{
$
(
'#nav-tab .consult-nav'
).
addClass
(
'focus'
);
$
(
'#feedback-content .consult-content'
).
removeClass
(
'hide'
);
}
})();
$
(
'#nav-tab li'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'focus'
);
});
$
(
'#feedback-content .content'
).
each
(
function
()
{
$
(
this
).
addClass
(
'hide'
);
});
$
(
'#nav-tab li'
).
on
(
'click'
,
function
()
{
var
index
=
$
(
this
).
index
();
if
(
$
(
this
).
hasClass
(
'comment-nav'
)
&&
0
===
commentsNum
)
{
alert
(
'暂无商品评价'
);
}
else
{
if
(
!
$
(
this
).
hasClass
(
'focus'
))
{
$
(
'#nav-tab li'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'focus'
);
});
$
(
'#feedback-content .content'
).
each
(
function
()
{
$
(
this
).
addClass
(
'hide'
);
});
$
(
this
).
addClass
(
'focus'
);
$
(
'#feedback-content .content:eq('
+
index
+
')'
).
removeClass
(
'hide'
);
}
}
});
$
(
this
).
addClass
(
'focus'
);
$
(
'#feedback-content .content:eq('
+
index
+
')'
).
removeClass
(
'hide'
);
$
(
'.goodsDiscount .dropdown'
).
on
(
'click'
,
function
()
{
if
(
$
(
'.goodsDiscount .discount-folder'
).
is
(
':hidden'
))
{
$
(
'.goodsDiscount .discount-folder'
).
slideDown
();
}
else
{
$
(
'.goodsDiscount .discount-folder'
).
slideUp
();
}
});
...
...
static/js/product/recommend-for-you.js
View file @
ba3a4a9
...
...
@@ -9,9 +9,10 @@ var Swiper = require('yoho.iswiper');
var
recommendSwiper
;
recommendSwiper
=
new
Swiper
(
'.swiper-recommend'
,
{
// lazyLoading: true,
// lazyLoadingInPrevNext: true,
slidesPerView
:
'auto'
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'li'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
\ No newline at end of file
...
...
static/sass/product/_recommend-for-you.scss
View file @
ba3a4a9
...
...
@@ -12,25 +12,28 @@
font-weight
:
bold
;
}
.swiper-
recommend
{
.swiper-
container
{
padding
:
pxToRem
(
20px
)
0
;
width
:
100%
;
height
:
pxToRem
(
252px
);
overflow
:
hidden
;
.swiper-slider
{
margin
:
0
pxToRem
(
10px
);
.swiper-slide
{
padding
:
0
pxToRem
(
10px
);
float
:
left
;
width
:
pxToRem
(
156px
);
&
:first-child
{
margin
-left
:
pxToRem
(
30px
);
padding
-left
:
pxToRem
(
30px
);
}
&
:last-child
{
margin
-right
:
pxToRem
(
30px
);
padding
-right
:
pxToRem
(
30px
);
}
img
{
width
:
pxToRem
(
156px
);
max-width
:
none
;
width
:
100%
;
height
:
pxToRem
(
208px
);
}
}
}
...
...
@@ -42,19 +45,21 @@
line-height
:
1
;
span
{
display
:
block
;
// chrome 最小支持12px, 设计图是 10px ,用CSS3变换
@include
transform
(
scale
(
0
.875
));
}
.sale-price
{
color
:
#d9134f
;
margin-left
:
pxToRem
(
-10px
);
}
.old-price
{
position
:
absolute
;
top
:
0
;
right
:
0
;
color
:
#ededed
;
right
:
pxToRem
(
-6px
);
color
:
#b0b0b0
;
}
.no-price
{
...
...
template/m.yohobuy.com/actions/index/home/index.phtml
View file @
ba3a4a9
...
...
@@ -95,7 +95,9 @@
<span
class=
"iconfont num"
>
604
;</span>
</a>
</div>
{
{#isLogin
}
}
{
{>
product/recommend-for-you
}
}
{
{/isLogin
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
ba3a4a9
...
...
@@ -43,7 +43,15 @@
{
{#goodsDiscount
}
}
<div
class=
"goodsDiscount"
>
<h
1
>
{
{.
}
}<span
class=
"iconfont"
>
609
;</span></h
1
>
{
{#each
list
}
}
{
{#if
@first
}
}
<h
1
>
{
{this
}
}<span
class=
"iconfont dropdown"
>
609
;</span></h
1
>
<div
class=
"discount-folder"
>
{
{else
}
}
<h
1
class=
"folder-item"
>
{
{this
}
}</h
1
>
{
{/if
}
}
{
{/list
}
}
</div>
</div>
{
{/goodsDiscount
}
}
...
...
@@ -57,8 +65,8 @@
{
{else
}
}
<ul
id=
"nav-tab"
class=
"nav-tab clearfix"
>
<li
class=
"comment-nav focus"
>
{
{commentName
}
}(
{
{commentsNum
}
})</li>
<li
class=
"consult-nav"
>
{
{consultName
}
}(
{
{consultsNum
}
})</li>
<li
class=
"comment-nav"
>商品评价(<span
class=
"comments-num"
>
{
{commentsNum
}
}</span>)</li>
<li
class=
"consult-nav"
>购买咨询(<span
class=
"consults-num"
>
{
{consultsNum
}
}</span>)</li>
</ul>
<div
id=
"feedback-content"
>
...
...
@@ -189,7 +197,7 @@
<div
class=
"swiper-container detail-swiper"
id=
"size-swiper-container"
>
<div
class=
"swiper-wrapper"
>
{
{#list
}
}
<div
class=
"swiper-slide
blue-slide
"
>
<div
class=
"swiper-slide "
>
<div
class=
"size-name cell"
>
{
{name
}
}</div>
<div
class=
"size-m cell"
>
{
{sizem
}
}</div>
<div
class=
"size-xl cell"
>
{
{sizexl
}
}</div>
...
...
@@ -303,7 +311,11 @@
<div
class=
"cart-bar"
>
<span
class=
"num-tag"
>
{
{numInCart
}
}</span>
<a
href=
""
class=
"num-incart iconfont"
>
62
c;</a>
{
{#if
goodsInstore
}
}
<a
href=
""
class=
"addto-cart "
>加入购物车</a>
{
{else
}
}
<a
href=
""
class=
"sold-out"
>已售罄</a>
{
{/if
}
}
<a
href=
""
class=
"favorite iconfont"
>
605
;</a>
</div>
{
{/cartInfo
}
}
...
...
template/m.yohobuy.com/partials/product/banner_swiper_arrow.phtml
View file @
ba3a4a9
...
...
@@ -16,6 +16,6 @@
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev swiper-button-grey"></div>
<div class="swiper-button-next swiper-button-grey"></div>
<div class="swiper-button-prev prev-grey"></div>
<div class="swiper-button-next next-grey"></div>
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
View file @
ba3a4a9
{
{#
recommendForYou
}
}
<div
class=
"recommend-for-you"
>
<div
class=
"title"
>为您优选新品</div>
<div
class=
"swiper-recommend"
>
<ul
class=
"swiper-wrapper"
>
<div
id=
"swiper-recommend"
class=
"swiper-container"
>
<ul
class=
"swiper-wrapper swiper-wrapper-recommend"
>
{
{#recommendList
}
}
<li
class=
"swiper-slider"
>
<img
class=
"img-box"
src=
"{{thumb}}"
>
<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>
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
ba3a4a9
...
...
@@ -423,13 +423,13 @@ class UserModel
// 调用接口获取地址数据
$suggest
=
UserData
::
suggestData
(
$udid
,
$page
,
$limit
);
//print_r($suggest);
// 处理意见反馈数据
if
(
isset
(
$suggest
[
'data'
])
&&
!
empty
(
$suggest
[
'data'
]))
{
$one
=
array
();
foreach
(
$suggest
[
'data'
][
'list'
]
as
$val
)
{
$one
=
array
();
$one
[
'suggest_id'
]
=
$val
[
'id'
];
$one
[
'imgUrl'
]
=
Helpers
::
getImageUrl
(
$val
[
'cover_image'
],
640
,
240
);
$one
[
'title'
]
=
$val
[
'filter_content'
];
$one
[
'content'
]
=
$val
[
'reply_content'
];
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
View file @
ba3a4a9
...
...
@@ -13,10 +13,6 @@ class DetailController extends AbstractAction
*/
public
function
indexAction
()
{
$commentsNum
=
0
;
$consultsNum
=
0
;
$nodate
=
0
;
$data
=
array
(
'goodsDetailPage'
=>
true
,
'pageHeader'
=>
array
(
...
...
@@ -68,16 +64,21 @@ SHOE BQT KEN BLOCK',
)
)
),
'goodsDiscount'
=>
'【summer final sale】满¥499立享6.8折'
,
'goodsDiscount'
=>
array
(
'list'
=>
array
(
'【summer final sale】满¥499立享6.8折'
,
'【BACK TO SCHOOL】满¥499赠送Paul
Franke帽子一个,多买多送!'
,
'【BACK TO SCHOOL】满¥499赠送Paul
Franke帽子一个,多买多送!'
)
),
'feedbacks'
=>
array
(
'commentsNum'
=>
0
,
'consultsNum'
=>
0
,
'nodata'
=>
0
,
'commentName'
=>
'商品评价'
,
'consultName'
=>
'购买咨询'
,
'moreComments'
=>
'http://www.baidu.com'
,
'moreConsults'
=>
'http://www.baidu.com'
,
'gotoConsults'
=>
'http://www.baidu.com'
,
'consultsNum'
=>
1
,
// 'commentName'=>'商品评价',
// 'consultName' =>'购买咨询',
'link'
=>
''
,
'comments'
=>
array
(
array
(
'userName'
=>
'Lynnic'
,
...
...
@@ -233,7 +234,8 @@ SHOE BQT KEN BLOCK',
),
'cartInfo'
=>
array
(
'numInCart'
=>
3
'numInCart'
=>
3
,
'goodsInstore'
=>
0
)
);
...
...
@@ -247,6 +249,7 @@ SHOE BQT KEN BLOCK',
public
function
commentsAction
(){
$data
=
array
(
'goodsCommentsPage'
=>
true
,
'pageHeader'
=>
array
(
'navBack'
=>
'sss '
,
...
...
Please
register
or
login
to post a comment