Authored by Rock Zhang

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

Conflicts:
	yohobuy/m.yohobuy.com/application/controllers/Home.php
... ... @@ -576,7 +576,7 @@ class Helpers
$oneGoods['id'] = $value['product_sku'];
$oneGoods['skn'] = $value['product_skn'];
$oneGoods['name'] = $value['product_name'];
$oneGoods['thumb'] = !empty($value['goods_images']) ? Images::getImageUrl($value['goods_images'], 90, 100) : '';
$oneGoods['thumb'] = !empty($value['goods_images']) ? Images::getImageUrl($value['goods_images'], 120, 160) : '';
$oneGoods['color'] = $value['color_name'];
$oneGoods['size'] = $value['size_name'];
$oneGoods['checked'] = $value['selected'] === 'Y';
... ...
... ... @@ -22,9 +22,14 @@ var navHammer,
freebieHammer,
switchChose = false;
require('../product/recommend-for-you');
require('./good');
if ($('.cart-zero').length > 0) {
require('../product/recommend-for-you');
} else {
require('./good');
}
ellipsis.init();
function cartContentShow() {
... ...
... ... @@ -67,11 +67,12 @@ function show(html, cb) {
document.documentElement.scrollLeft || document.body.scrollLeft,
document.documentElement.scrollTop || document.body.scrollTop
],
$html = $('html'); // it would make more sense to apply this to body, but IE7 won't have that
$html = $('html, body'); // it would make more sense to apply this to body, but IE7 won't have that
$html.data('scroll-position', scrollPosition);
$html.data('previous-overflow', $html.css('overflow'));
$html.css('overflow', 'hidden');
$html.css('height', '100%');
window.scrollTo(scrollPosition[0], scrollPosition[1]);
if (html) {
... ... @@ -89,11 +90,12 @@ function show(html, cb) {
//隐藏当前Panel
function hide() {
var $html = $('html'),
var $html = $('html, body'),
scrollPosition = $html.data('scroll-position');
// un-lock scroll position
$html.css('overflow', $html.data('previous-overflow'));
$html.css('height', 'auto');
window.scrollTo(scrollPosition[0], scrollPosition[1]);
$('.chose-panel').hide();
}
... ... @@ -104,7 +106,7 @@ function updateConformButtonClassAndText() {
if (2 === $chosed.closest('.zero-stock').length) {
$('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄');
} else {
$('#chose-btn-sure').css('background-color', '#eb0313').html('确定');
$('#chose-btn-sure').css('background-color', '#eb0313').html('加入购物车');
}
}
... ...
... ... @@ -19,7 +19,7 @@ var $selectAllBtn = $('.balance .checkbox'),
ellipsis.init();
lazyLoad({
try_again_css: 'good-failure'
try_again_css: 'order-failure'
});
setTimeout(function() {
... ... @@ -75,7 +75,9 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
}, function() {
tip.show('网络异常');
});
}).on('touchstart', '.icon-del', function(e) {
});
$('.icon-del').on('touchstart', function(e) {
var $this = $(this);
e.stopPropagation();
... ... @@ -112,6 +114,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
}
}, function() {
tip.show('网络异常');
window.location.reload();
});
});
});
... ...
... ... @@ -24,8 +24,8 @@ $('.address-item').on('touchend', function() {
}).on('touchend', '.edit', function() {
window.location.href = $(this).data('href');
return false;
}).on('touchend', '.del', function() {
deleteId = $(this).data('address-id');
}).on('touchstart', '.del', function() {
deleteId = $(this).data('id');
});
$confim.on('touchend', '.confim', function() {
... ...
... ... @@ -179,7 +179,7 @@ function reMarginFooter(fixedElement) {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.13.6.3/yas-debug.js', '_yas');
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.13.6.3/yas.js', '_yas');
(function() {
var uid = getUid();
... ...
... ... @@ -17,19 +17,13 @@ var $ = require('jquery'),
trendTopicSwiper,
goodsSwiper;
var requestFrame,
thisFunc,
start = 0,
i,
var start = 0,
swiperClass,
supportCss3,
$logotrans = $('.home-header .logo'),
isen = true;
var navHammer;
require('./maybe-like');
lazyLoad($('img.lazy'));
navHammer = new Hammer($('.nav-btn')[0]);
... ... @@ -39,13 +33,6 @@ navHammer.on('tap', function(event) {
$overlay.show().css('opacity', 0.3);
$sideNav.addClass('on');
//设置boy高宽,页面不能上下滑动
$('body').css({
height: $(window).height(),
width: $(window).width(),
overflow: 'hidden'
});
event.srcEvent.stopPropagation();
return false;
});
... ... @@ -56,10 +43,6 @@ function hideSideBar() {
$('.overlay').hide();
$('.sub-nav').removeClass('show');
$sideNav.removeClass('on');
$('body').css({
height: 'auto',
overflow: 'auto'
});
}
}
... ... @@ -68,6 +51,11 @@ $('.overlay').on('touchstart', function(e) {
return false;
});
//禁止在侧边栏可以上下滚动
$('.side-nav').on('touchmove', function() {
return false;
});
//点击一级导航,弹出二级导航
$sideNav.on('touchstart', 'li', function(e) {
if ($(this).find('.sub-nav').size() > 0) {
... ... @@ -161,28 +149,6 @@ $('.category-swiper').each(function(i, index) {
});
//logo动画
requestFrame = (function() {
var tempFunc = null,
prefixList = ['webkit', 'moz', 'ms'];
for (i = 0; i < prefixList.length; i++) {
thisFunc = prefixList[i] + 'RequestAnimationFrame';
if (window[thisFunc]) {
supportCss3 = true;
tempFunc = thisFunc;
}
}
if (supportCss3) {
return function(callback) {
window[tempFunc](callback);
};
}
return function(callback) {
window.setTimeout(callback, 67);
};
})();
function tsAnimate() {
start = start + 10;
$logotrans.css({
... ... @@ -205,9 +171,7 @@ function tsAnimate() {
if (start % 360 === 0) {
window.setTimeout(tsAnimate, 60 * 1000);
} else {
requestFrame(function() {
tsAnimate();
});
window.requestAnimationFrame(tsAnimate);
}
}
}
... ... @@ -230,3 +194,5 @@ exports.set = function(c) {
domain: '.m.yohobuy.com'
});
};
require('./maybe-like');
\ No newline at end of file
... ...
... ... @@ -243,11 +243,11 @@ function search(opt) {
break;
case 'price':
window._yas(1 * new Date(), '1.0.13.6.3', 'yohobuy_m', window._ozuid,
'', '.new-goods .good-info .good-detail-img .good-thumb');
'', '.price-goods .good-info .good-detail-img .good-thumb');
break;
case 'discount':
window._yas(1 * new Date(), '1.0.13.6.3', 'yohobuy_m', window._ozuid,
'', '.new-goods .good-info .good-detail-img .good-thumb');
'', '.discount-goods .good-info .good-detail-img .good-thumb');
break;
}
}
... ...
... ... @@ -41,6 +41,7 @@
.thumb {
float: left;
width: 100rem / $pxConvertRem;
margin-right: 20rem / $pxConvertRem;
}
.text-info {
... ... @@ -48,7 +49,7 @@
.name {
font-size: 28rem / $pxConvertRem;
height: 74rem / $pxConvertRem;
overflow: hidden;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
... ...
... ... @@ -28,12 +28,16 @@
}
.few-tag {
width: 148rem / $pxConvertRem;
width: 150rem / $pxConvertRem;
position: absolute;
left: 92rem / $pxConvertRem;
text-align: center;
top: 75%;
top: 72%;
color: #fff;
span {
display: inline-block;
@include transform(scale(0.833));
}
}
.gift-tag {
... ... @@ -71,8 +75,7 @@
.thumb {
float: left;
width: 180rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
width: 150rem / $pxConvertRem;
background-size: 100%;
background-repeat: no-repeat;
}
... ... @@ -80,7 +83,7 @@
.deps {
position: relative;
width: 380rem / $pxConvertRem;
margin-left: 4.7rem;
margin-left: 180rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
padding: 0.5rem 0;
}
... ...
... ... @@ -7,7 +7,7 @@
left: 0;
right: 100rem / $pxConvertRem;
width: 540rem / $pxConvertRem;
z-index: 1;
z-index: 4;
overflow: hidden;
@include transition(all .3s);
... ... @@ -188,4 +188,4 @@
display: block;
@include transform(translateX(0));
@include transition(transform 0.3s);
}
\ No newline at end of file
}
... ...
... ... @@ -56,13 +56,7 @@
{{/if}}
<div class="price-compute">
<p>
<span>总价(¥{{price}})<i>-</i></span>
<span>活动价(¥{{activityPrice}})</span>
</p>
<p>
<span><i>=</i>商品总计金额 (¥{{sumPrice}})</span>
</p>
<p>{{formulaPrice}}</p>
</div>
<div class="balance">
... ...
... ... @@ -63,7 +63,7 @@
</div>
</div>
<div class="btn-wrap">
<button id="chose-btn-sure" class="btn btn-sure">确定</button>
<button id="chose-btn-sure" class="btn btn-sure">加入购物车</button>
</div>
</div>
</div>
... ...
... ... @@ -13,10 +13,10 @@
<img class="thumb lazy" data-original="{{thumb}}">
</a>
{{#if isAdvanceBuy}}
<p class="few-tag plus-tag">加价购</p>
<p class="few-tag plus-tag"><span>加价购</span></p>
{{/if}}
{{#if isGift}}
<p class="few-tag gift-tag">赠品</p>
<p class="few-tag gift-tag"><span>赠品</span></p>
{{/if}}
<div class="deps show">
... ...
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');
</script>
<!-- End Google Tag Manager -->
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="http://static.yohobuy.com/js/analytics/analysis.js" async="async"></script>
<script src="http://static.yohobuy.com/m/v1/js/om_code.js" async="async"></script>
var _hmt = _hmt || [];
(function() {
function async_load(){
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "http://static.yohobuy.com/js/analytics/analysis.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "http://static.yohobuy.com/m/v1/js/om_code.js";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
}
window.addEventListener('load', async_load, false);
})();
</script>
\ No newline at end of file
... ...
... ... @@ -794,8 +794,9 @@ class CartModel
}
// 结算数据
$result['price'] = Helpers::transPrice($data['shopping_cart_data']['order_amount']);
$result['activityPrice'] = Helpers::transPrice($data['shopping_cart_data']['discount_amount']);
$result['formulaPrice'] = $data['shopping_cart_data']['promotion_formula'];
/*$result['price'] = Helpers::transPrice($data['shopping_cart_data']['order_amount']);
$result['activityPrice'] = Helpers::transPrice($data['shopping_cart_data']['discount_amount']);*/
$result['count'] = $data['shopping_cart_data']['selected_goods_count'];
$result['isAllSelected'] = ($data['shopping_cart_data']['goods_count'] === $data['shopping_cart_data']['selected_goods_count']) && ($data['shopping_cart_data']['selected_goods_count'] >0);
$result['sumPrice'] = Helpers::transPrice($data['shopping_cart_data']['last_order_amount']);
... ...