Authored by hf

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -182,17 +182,19 @@ class Images
$result = json_decode(file_get_contents('http://upload.static.yohobuy.com', false, $context), true);
if(!empty($result['data']['imagesList']))
{
$imgExtra = '?imageMogr2/thumbnail/130x130/extent/130x130/background/d2hpdGU=/position/center/quality/90';
$imgList = array('imgList'=>array());
if(count($file) == 1 || !is_array($file))
{
$imgList['imgList'][] = array('imgUrl' => self::getSourceUrl(current($result['data']['imagesList']), 'suggest'));
$imgList['imgList'][] = array('imgUrl' => self::getSourceUrl(current($result['data']['imagesList']), 'suggest') . $imgExtra);
}
else
{
$img = array();
foreach ($result['data']['imagesList'] as $val) {
$img = array();
$img['imgUrl'] = self::getSourceUrl($val, 'suggest');
$img['imgUrl'] = self::getSourceUrl($val, 'suggest') . $imgExtra;
$imgList['imgList'][] = $img;
}
}
... ...
///**
// * 商品详情
// * @author: liangzhifeng<zhifeng.liang@yoho.cn>
// * @date: 2015/11/18
// */
//var $ = require('jquery'),
// Hammer = require('yoho.hammer'),
// lazyLoad = require('yoho.lazyload');
//
//var loading = require('../../plugin/loading');
//
//var navHammer,
// winH = $(window).height(),
// searching = false,
// num,
// url;
//
//function scrollHandler() {
// if ($(window).scrollTop() + winH >= $(document).height() - 50) {
// //search();
// }
//}
//
//function search() {
// if (searching) {
// return;
// }
// searching = true;
//
// loading.showLoadingMask();
//
// //num = $goodList.find('.good-info').length;
// $.ajax({
// type: 'GET',
// url: url,
// data: {
// page: page + 1
// },
// success: function(data) {
//
// num = $goodList.find('.good-info').length;
//
// $goodList.append(data);
//
// // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题
// if (num === 0) {
// lazyLoad($goodList.find('.good-info').find('img.lazy'));
// } else {
// lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
// }
//
// searching = false;
// loading.hideLoadingMask();
// page++;
// },
// error: function() {
// tip.show('网络断开连接了~');
// searching = false;
// loading.hideLoadingMask();
// }
// });
//}
//
////srcoll to load more
//$(window).scroll(function () {
// window.requestAnimationFrame(scrollHandler);
//});
//
/**
* 商品详情
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/18
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
var loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var introUrl = $('#introUrl').val(),
winH = $(window).height(),
$productDesc,
searching = false,
end = false;
function search() {
if (searching || end) {
return;
}
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
url: introUrl,
success: function(data) {
$productDesc = $('#productDesc');
$productDesc.append(data);
lazyLoad($productDesc.find('img.lazy'));
searching = false;
end = true;
loading.hideLoadingMask();
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
... ...
... ... @@ -5,6 +5,11 @@
height: pxToRem(28px);
margin-top: pxToRem(22px);
}
.detail{
&.table .inner-container{
background-color: $tableCellC;
}
}
.desc-text {
font-size: pxToRem(24px);
margin-bottom: pxToRem(20px);
... ... @@ -51,10 +56,10 @@
padding-right: pxToRem(15px);
}
// padding-bottom:pxToRem(18px);
.tip{
// width: pxToRem(73px);
width: 16.666%;
.tip{
display: inline-block;
width: 16.6%;
float:left;
// margin-right: pxToRem(24px);
img{
width: pxToRem(48px);
... ... @@ -63,11 +68,13 @@
}
.caption{
display: block;
padding: 0 pxToRem(13px);
font-size: pxToRem(18px);
line-height: pxToRem(22px);
margin-bottom: pxToRem(18px);
}
}
}
.product-detail {
.detail {
... ...
... ... @@ -76,7 +76,7 @@
<div class="gap-block"></div>
{{# enterStore}}
<div class="enter-store page-block">
<div id="enter-store" class="enter-store page-block">
<a class="store-logo" href="{{url}}" style="">
<img class="lazy" data-original="{{img}}" alt="{{storeName}}">
</a>
... ... @@ -87,6 +87,10 @@
<div class="gap-block"></div>
<div id="productDesc"></div>
{{#cartInfo}}
<div class="cart-bar">
<span class="num-tag">{{numInCart}}</span>
... ... @@ -100,5 +104,9 @@
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -7,11 +7,9 @@
</h1>
{{#detail}}
<ul class="detail table clearfix">
<!-- <li class="row"> -->
{{#list}}
<div class="column">{{param}}</div>
{{/list}}
<!-- </li> -->
</ul>
{{/detail}}
<div class="desc-text">{{desc}}</div>
... ... @@ -114,34 +112,26 @@
{{/materials}}
<div class="wash-tips page-block">
<div class="detail table clearfix">
{{#washTips}}
<div class="tip">
<img src="{{img}}" alt="">
<span class="caption">{{caption}}</span>
</div>
{{/washTips}}
</div>
</div>
<!-- {{#washTips}}
<div class="icons-wrapper washTips page-block">
<ul class="icons-list clearfix">
{{#list}}
<li class="icons-item"><a href="{{url}}" class="imagebar"><img src="{{img}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li>
{{/list}}
</ul>
</div>
{{/washTips}} -->
<div class="gap-block"></div>
{{#productDetail}}
<div class="product-detail page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
{{{title}}}
<span class="en-title">{{{enTitle}}}</span>
</h1>
<div class="detail">
<p>{{desc}}</p>
<p>{{{desc}}}</p>
{{#list}}
<img class="lazy" data-original="{{img}}" alt="">
{{/list}}
... ...
... ... @@ -83,7 +83,9 @@ class HomeController extends AbstractAction
'pageFooter' => true,
'favorite' => true,
'hasFavProduct' => $favProducts,
'hasFavBrand' => $favBrands
'productUrl' => '/product/new',
'hasFavBrand' => $favBrands,
'brandUrl' => '/product/new'
);
// 判断是否为品牌收藏页
if ($tab === 'brand') {
... ...