Authored by hf

do fixes bug to home order bugs

... ... @@ -157,7 +157,7 @@ function reMarginFooter(fixedElement) {
//已登录
$op.prepend(
'Hi,' +
'<span>Hi,</span>' +
'<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>'
);
... ... @@ -370,8 +370,9 @@ var $ = require("jquery"),
var swiper,
$fixTitleBar,
$brandList = $('.brand-list');
var $icon = $('.search-icon');
$brandList = $('.brand-list'),
$icon = $('.search-icon'),
hotBrandsSwiper;
var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
... ... @@ -382,6 +383,14 @@ var brandsData,
$keyword,
clearTextHammer;
//热门品牌滑动
hotBrandsSwiper = new Swiper('.brands-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'brands-list',
slideElement: 'li'
});
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
... ... @@ -396,12 +405,16 @@ $('.yoho-header').css({
top: 0
});
if ($('.banner-top').length > 0) {
$('.hot-brands').css('padding-top', '0');
}
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
$fixTitleBar.css({
position: 'fixed',
top: brandSwipe
}).hide();
minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight();
minBrandListTop = brandSwipe + $('.hot-brands').outerHeight() + $('.banner-top').outerHeight();
$brandList.last().append($fixTitleBar);
function scrollHandler() {
... ... @@ -1912,7 +1925,7 @@ $('.maybe-like p').on('touchstart', function(e) {
});
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 50) {
if ($(window).scrollTop() + winH >= $(document).height() - 200) {
search();
}
}
... ... @@ -2679,12 +2692,20 @@ $btnSure.on('touchstart', function() {
token: $('#token').val()
},
success: function(data) {
var res;
if (data.code === 200) {
res = data.data;
showErrTip('注册成功');
$.ajax({
url: res.session,
dataType: 'jsonp'
});
//1000ms后跳转页面
setTimeout(function() {
location.href = data.data;
location.href = res.href;
}, 1000);
} else {
showErrTip(data.message);
... ... @@ -2783,12 +2804,21 @@ $loginBtn.on('touchstart', function() {
password: pwd
},
success: function(data) {
var res;
if (data.code === 200) {
res = data.data;
showErrTip('登录成功');
$.ajax({
url: res.session,
dataType: 'jsonp'
});
//1s后跳转页面
setTimeout(function() {
location.href = data.data;
location.href = res.href;
}, 1000);
} else {
showErrTip(data.message);
... ... @@ -2907,12 +2937,20 @@ $loginBtn.on('touchstart', function() {
password: pwd
},
success: function(data) {
var res;
if (data.code === 200) {
res = data.data;
showErrTip('登录成功');
$.ajax({
url: res.session,
dataType: 'jsonp'
});
//1000ms后跳转页面
setTimeout(function() {
location.href = data.data;
location.href = res.href;
}, 1000);
} else {
showErrTip(data.message);
... ... @@ -4640,6 +4678,13 @@ if ($brandHeader.length > 0) {
success: function(data) {
if (data.code === 200) {
$this.toggleClass('coled');
//提示
if (opt === 'ok') {
tip.show('添加收藏成功');
} else {
tip.show('取消收藏成功');
}
} else if (data.code === 400) {
location.href = data.data;//未登录跳转登录页
} else {
... ... @@ -4668,7 +4713,7 @@ if (window._yas) {
window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, '#goods-container >div >div .good-thumb >img');
}
});
define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){
define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){
/**
* 商品详情
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
... ... @@ -4676,12 +4721,14 @@ define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index
*/
var $ = require("jquery"),
Swiper = require("swiper"),
Hammer = require("hammer"),
lazyLoad = require("lazyload");
var goodsSwiper,
$discountFolder = $('.goodsDiscount .discount-folder'),
$discountArrow = $('.goodsDiscount .first-item span');
var goodsDiscountHammer = new Hammer(document.getElementById('goodsDiscount'));
require("js/product/detail/desc");
require("js/product/detail/comments-consults");
... ... @@ -4709,7 +4756,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
$('.goodsDiscount .dropdown').on('touchend', function(e) {
goodsDiscountHammer.on('tap', function(e) {
if ($discountFolder.is(':hidden')) {
$discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;');
$discountFolder.slideDown();
... ... @@ -4717,9 +4764,9 @@ $('.goodsDiscount .dropdown').on('touchend', function(e) {
$discountArrow.removeClass('icon-up').addClass('icon-down').html('&#xe609;');
$discountFolder.slideUp();
}
return false;
});
require("js/product/detail/like");
});
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.