Authored by 沈志敏

Merge branch 'release/5.2' of git.yoho.cn:fe/yohobuywap-node into release/5.2

... ... @@ -115,6 +115,9 @@
{{# isLimited}}
<p class="good-tag limit-tag">限量</p>
{{/ isLimited}}
{{# isPresell}}
<p class="good-tag is-presell">预售</p>
{{/ isPresell}}
{{/ tags}}
</div>
<div class="good-detail-img">
... ...
... ... @@ -44,6 +44,9 @@
{{# isLimited}}
<p class="good-tag limit-tag">限量</p>
{{/ isLimited}}
{{# isPresell}}
<p class="good-tag is-presell">预售</p>
{{/ isPresell}}
{{/ tags}}
</div>
<div class="good-detail-img">
... ...
... ... @@ -66,7 +66,7 @@
<i class="iconfont hide up">&#xe615;</i>
</h3>
<ul>
<li class="dispatch-time-info">快递公司会尽力按您选择的送货时间配送,如遇特殊情况(天气、环境等)无法按您要求时间配送,还请您谅解。</li>
<li class="dispatch-time-info">快递公司会尽力按您选择的送货时间配送,如遇特殊情况(天气、环境等)无法按您要求时间配送,还请您谅解。</li>
{{#each dispatchTime}}
<li {{#if isSelected}}class="chosed"{{/if}} data-id="{{id}}">
<span>{{name}}</span>
... ...
... ... @@ -18,6 +18,9 @@
{{# is_limited}}
<p class="good-tag limit-tag">限量</p>
{{/ is_limited}}
{{# is_presell}}
<p class="good-tag is-presell">预售</p>
{{/ is_presell}}
{{/ tags}}
</div>
<div class="good-detail-img">
... ...
... ... @@ -640,6 +640,11 @@ const cardDetail = (req, res) => {
width750: true,
cardDetail: result
});
}).catch(() => {
_serverCrash(res, {
url: req.originalUrl,
title: '银行卡详情'
});
});
};
... ...
... ... @@ -495,7 +495,6 @@ const getCardDetail = (uid, cardIdNo) => {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
logger.info(result.data);
return _processCardDetail(result.data);
} else {
logger.error('get getBankCards data return code is not 200');
... ...
... ... @@ -135,46 +135,6 @@ const _getShopCategory = (shopId, channel, gender) => {
};
/**
* 獲取店鋪優惠券
* @private
*/
const _shopCouponsList = (shopId, uid) => {
let params = {
method: 'shop.coupons.list',
shop_id: shopId
};
if (uid) {
_.assign(params, {uid: uid});
}
return api.get('', params, {code: 200}).then(result => {
if (result.data) {
let shopCoupons = [];
_.forEach(result.data, value => {
let couPonstatus = parseInt(value.status, 10);
if (couPonstatus === 1 || couPonstatus === 3) {
shopCoupons.push({
validity: value.couponValidity,
id: crypto.encryption('', value.coupon_id + ''),
name: value.coupon_name,
pic: value.coupon_pic,
money: parseInt(value.money, 10),
status: couPonstatus === 1
});
}
});
return shopCoupons;
} else {
return [];
}
});
};
/**
* TODO TAR 店铺和品牌收藏状态调用新的接口
* 调用接口获取品牌或者店铺的收藏状态
* @private
... ... @@ -558,8 +518,7 @@ const getShopData = (req, shopId, uid, isApp) => {
brand: brandData.join(','),
order: '0',
channel: channel
}),
_shopCouponsList(shopId, uid)
})
]).then((result) => {
shopData = {
decorator: shopDeco, // 店铺装修资源数据
... ... @@ -577,9 +536,6 @@ const getShopData = (req, shopId, uid, isApp) => {
shopFilterSearchData.goods = productProcess.processProductList(result[0].product_list || [], {isApp: isApp});
}
/* 店铺优惠券 */
let shopCoupons = result[1] || [];
// 店铺分类
return _getShopCategory(shopId, channel).then(shopCategory => {
... ... @@ -594,9 +550,7 @@ const getShopData = (req, shopId, uid, isApp) => {
{
shopId: shopId,
uid: uid ? crypto.encryption('', uid + '') : '',
coverChannel: channel,
shopCoupons: shopCoupons,
shopCouponsOne: shopCoupons.length === 1
coverChannel: channel
}
);
});
... ...
... ... @@ -276,7 +276,7 @@ const searchKeyActivity = (params) => {
cache: true,
code: 200
}).then(result => {
if (result.data) {
if (result && result.data) {
return result.data;
} else {
return {};
... ...
... ... @@ -21,6 +21,9 @@
{{# is_soon_sold_out}}
<p class="good-tag soon-sold-out-tag">即将售罄</p>
{{/ is_soon_sold_out}}
{{# is_presell}}
<p class="good-tag is-presell">预售</p>
{{/ is_presell}}
{{/ tags}}
</div>
{{# bannerTop}}
... ...
... ... @@ -19,6 +19,9 @@
{{#if isLimited}}
<p class="good-tag limit-tag">限量商品</p>
{{/if}}
{{# isPresell}}
<p class="good-tag is-presell">预售</p>
{{/ isPresell}}
{{/each}}
</div>
<div class="good-detail-img">
... ...
... ... @@ -121,10 +121,11 @@
<div class="discount-area first" id="navlist2">
<ul id="list-nav" class="home-sub-nav list-nav pos-list clearfix">
<li data-bp-id="shop_listnav_new_1" class="new active buriedpoint">
<li data-bp-id="shop_listnav_new_1" class="new active buriedpoint first-li-more">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
<span class="iconfont up cur hide">&#xe615;</span>
<span class="iconfont down cur">&#xe616;</span>
</a>
</li>
<li class="price buriedpoint" data-bp-id="shop_listnav_price_1">
... ... @@ -152,6 +153,12 @@
</a>
</li>
</ul>
<div class='new-list hide'>
<ul>
<li class='active default' data-bp-id='shop_listnav_default_1'>默认</li>
<li class='new' data-bp-id='shop_listnav_new_1'>最新</li>
</ul>
</div>
</div>
<div class="discount-area first">
... ... @@ -161,10 +168,10 @@
{{> common/goods}}
{{/ goods}}
</div>
<div class="default-goods container hide clearfix"></div>
<div class="sale-goods container hide clearfix"></div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
</div>
</div>
</div>
... ... @@ -182,42 +189,51 @@
<a href="{{allGoods}}" target="_blank">全部商品</a>
</li>
</ul>
<div id="pos-list" class='hide'>
<ul class="home-sub-nav pos-list">
<li class="new active buriedpoint first-li-more" data-bp-id="shop_poslist_new_1">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
<b></b>
</a>
</li>
<li class="price buriedpoint" data-bp-id="shop_poslist_price_1">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
<b></b>
</a>
</li>
<li class="discount buriedpoint" data-bp-id="shop_poslist_discount_1">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
<b></b>
</a>
</li>
<li class="filter buriedpoint" data-bp-id="shop_poslist_filter_1">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<ul id="pos-list" class="home-sub-nav pos-list hide">
<li class="new active buriedpoint" data-bp-id="shop_poslist_new_1">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
<b></b>
</a>
</li>
<li class="price buriedpoint" data-bp-id="shop_poslist_price_1">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
<b></b>
</a>
</li>
<li class="discount buriedpoint" data-bp-id="shop_poslist_discount_1">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
<b></b>
</a>
</li>
<li class="filter buriedpoint" data-bp-id="shop_poslist_filter_1">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div class='new-list hide'>
<ul>
<li class='active default' data-bp-id='shop_listnav_default_1'>默认</li>
<li class='new' data-bp-id='shop_listnav_new_1'>最新</li>
<li class='sale' data-bp-id='shop_listnav_sale_1'>销量</li>
</ul>
</div>
</div>
</div>
{{> common/filter}}
{{/ shopIndex}}
... ...
... ... @@ -90,49 +90,52 @@
<!-- 优惠卷 -->
<div class="coupon-group"></div>
<ul id="list-nav" class="list-nav clearfix">
{{#if isSearch}}
<li class="new active buriedpoint" data-bp-id="">
<a href="javascript:void(0);">
<span class="nav-txt">默认</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
{{else}}
<li class="new active buriedpoint" data-bp-id="shop_listnav_new_1">
<a href="javascript:void(0);">
<span class="nav-txt">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
{{/if}}
<li class="price buriedpoint" data-bp-id="shop_listnav_price_1">
<a href="javascript:void(0);">
<span class="nav-txt">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="discount buriedpoint" data-bp-id="shop_listnav_discount_1">
<a href="javascript:void(0);">
<span class="nav-txt">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="filter buriedpoint" data-bp-id="shop_listnav_filter_1">
<a href="javascript:void(0);">
<span class="nav-txt">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div>
<ul id="list-nav" class="list-nav clearfix">
<li class="new active buriedpoint first-li-more" data-bp-id="shop_listnav_new_1">
<a href="javascript:void(0);">
<span class="nav-txt">最新</span>
<span class="iconfont up cur hide">&#xe615;</span>
<span class="iconfont down cur">&#xe616;</span>
</a>
</li>
<li class="price buriedpoint" data-bp-id="shop_listnav_price_1">
<a href="javascript:void(0);">
<span class="nav-txt">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="discount buriedpoint" data-bp-id="shop_listnav_discount_1">
<a href="javascript:void(0);">
<span class="nav-txt">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="filter buriedpoint" data-bp-id="shop_listnav_filter_1">
<a href="javascript:void(0);">
<span class="nav-txt">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div class='new-list hide'>
<ul>
<li class='active default' data-bp-id='shop_listnav_default_1'>默认</li>
<li class='new' data-bp-id='shop_listnav_new_1'>最新</li>
</ul>
</div>
</div>
<div id="goods-container" class="goods-container">
<div class="default-goods container clearfix"></div>
<div class="new-goods container clearfix"></div>
<div class="sale-goods container clearfix"></div>
<div class="price-goods container clearfix hide"></div>
<div class="discount-goods container clearfix hide"></div>
... ...
... ... @@ -20,6 +20,9 @@
{{# is_limited}}
<p class="good-tag limit-tag">限量</p>
{{/ is_limited}}
{{# is_presell}}
<p class="good-tag is-presell">预售</p>
{{/ is_presell}}
{{/ tags}}
</div>
<div class="good-detail-img">
... ...
var $ = require('yoho-jquery'),
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip'),
... ... @@ -21,13 +20,15 @@ inviteObj = {
// 变量
inter: 0, // 定时器变量
ischeckCode: false, // 是否成功发送验证码
actId: $('.invite-group input[name="actId"]').val(), // 活动id
shareUid: $('.invite-group input[name="shareUid"]').val(), // 分享者id
openId: $('.invite-group input[name="openId"]').val(), // 微信openId
actId: $('.invite-group input[name="actId"]').val(), // 活动id
shareUid: $('.invite-group input[name="shareUid"]').val(), // 分享者id
openId: $('.invite-group input[name="openId"]').val(), // 微信openId
nums: $('.invite-group input[name="nums"]').val() // 发送优惠券的次数
},
init: function() {
var $el = this.el, that = this, isreceiveBtn = false;
var $el = this.el,
that = this,
isreceiveBtn = false;
// 设置大背景,因为body只能后来设置,前期设置page里面
if ($('.invite-page').length > 0) {
... ... @@ -91,7 +92,7 @@ inviteObj = {
// 下载app
$el.$downloadBtn.click(function() {
that.downLoadApp();
window.downLoadApp();
});
// 领取福利
... ... @@ -109,7 +110,8 @@ inviteObj = {
// 发送已注册用户参与活动的优惠券
ischeckOldUserCoupon: function(mobile) {
var that = this, $el = this.el;
var that = this,
$el = this.el;
$.ajax({
url: '/activity/invite/checkOldUserCoupon',
... ... @@ -317,15 +319,6 @@ inviteObj = {
$('.invite-dialog-bg').remove();
$el.$inviteDialog.hide();
that.clearGrayInfo();
},
// 下载app
downLoadApp: function() {
var appUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445';
setTimeout(function() {
window.location = appUrl;
}, 200);
}
};
... ...
... ... @@ -204,7 +204,7 @@ $.extend({
// 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息
if (queryString().union_type) {
setCookie('unionTypeYas', queryString().union_type);
setCookie('unionTypeYas', queryString().union_type, {path: '/'});
}
}());
... ... @@ -307,6 +307,31 @@ if ($footer.find('.user-name').text().length === 11) {
$footer.find('.user-name').html(phoneHidden($footer.find('.user-name').text()));
}
// 浮层下载APP
function downLoadApp() {
var appUrl = 'http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = queryString().union_type || cookie('unionTypeYas') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_DOWNLOAD_C',
param: JSON.stringify({C_ID: _ChannelVary[cookie('_Channel')] || 1, TO_URL: appUrl})
}, true);
}
window.location = appUrl;
}
}, 500);
}
// 为您优选埋点 http://redmine.yoho.cn/issues/10117
function givePoint(parameter) {
var CID = 1;
... ... @@ -398,3 +423,5 @@ window.queryString = queryString();
window.givePoint = givePoint;
window._ChannelVary = _ChannelVary;
window.downLoadApp = downLoadApp;
... ...
... ... @@ -7,37 +7,10 @@
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer');
var floatLayerBtnHammer,
C_ID;
var floatLayerBtnHammer;
require('../common');
C_ID = window._ChannelVary[window.cookie('_Channel')] || 1;
function downLoadApp() {
var appUrl = 'http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = window.queryString.mkt_code || window.cookie('mkt_code') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_DOWNLOAD_C',
param: JSON.stringify({C_ID: C_ID, TO_URL: appUrl})
}, true);
}
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').on('touchend', function() {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
... ... @@ -55,7 +28,7 @@ $('#float-layer-close').on('touchend', function() {
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
downLoadApp('bottom');
window.downLoadApp('bottom');
e.srcEvent.stopPropagation();
});
... ...
... ... @@ -24,30 +24,6 @@ function getQueryString(name) {
return null;
}
function downLoadApp() {
var appUrl = 'http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = window.queryString.union_type || window.cookie('unionTypeYas') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
appUrl += '?union_type=' + mkt;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_DOWNLOAD_C',
param: JSON.stringify({C_ID: window._ChannelVary[window.cookie('_Channel')] || 1, TO_URL: appUrl})
}, true);
}
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').on('touchend', function(e) {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
... ... @@ -65,7 +41,7 @@ $('#float-layer-close').on('touchend', function(e) {
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
downLoadApp('bottom');
window.downLoadApp('bottom');
e.srcEvent.stopPropagation();
});
... ...
... ... @@ -136,6 +136,9 @@ var installment = {
}
});
// 解决部分安卓手机不识别calc(100vh)的问题
$('.installment-main').css({height: $(window).height()});
starIScroll.iScroll.on('scroll', function() {
$(window).trigger('scroll');
});
... ...
... ... @@ -22,9 +22,12 @@ var tip = require('../../plugin/tip');
var loading = require('../../plugin/loading');
var $goodsContainer = $('#goods-container'),
$defaultgc = $goodsContainer.children('.default-goods'),
$ngc = $goodsContainer.children('.new-goods'),
$sgc = $goodsContainer.children('.sale-goods'),
$pgc = $goodsContainer.children('.price-goods'),
$dgc = $goodsContainer.children('.discount-goods');
$dgc = $goodsContainer.children('.discount-goods'),
$newList = $('.new-list');
var winH = $(window).height();
... ... @@ -42,22 +45,34 @@ var $listNav = $('#list-nav'),
// 导航数据信息
navInfo = {
newest: {
price: {
order: 1,
reload: true,
page: 0,
end: false
},
price: {
discount: {
order: 1,
reload: true,
page: 0,
end: false
},
discount: {
order: 1,
default: {
order: 0,
reload: true,
page: 0,
page: 1,
end: false
},
new: {
order: 0,
reload: true,
page: 1,
end: false
},
sale: {
order: 0,
reload: true,
page: 1,
end: false
}
},
... ... @@ -290,11 +305,15 @@ function search(opt) {
// 导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
navType = 'new';
} else if ($pre.hasClass('price')) {
navType = 'price';
} else if ($pre.hasClass('discount')) {
navType = 'discount';
} else if ($pre.hasClass('default')) {
navType = 'default';
} else if ($pre.hasClass('sale')) {
navType = 'sale';
}
nav = navInfo[navType];
... ... @@ -368,7 +387,7 @@ function search(opt) {
$container;
switch (navType) {
case 'newest':
case 'new':
$container = $ngc;
break;
case 'price':
... ... @@ -377,6 +396,12 @@ function search(opt) {
case 'discount':
$container = $dgc;
break;
case 'default':
$container = $defaultgc;
break;
case 'sale':
$container = $sgc;
break;
default:
break;
}
... ... @@ -419,7 +444,7 @@ function search(opt) {
// 用于统计点击了商品列表的第几个商品,序号从1开始计算。
if (window._yas) {
switch (navType) {
case 'newest':
case 'new':
window._yas(1 * new Date(), '1.0.16', 'yohobuy_m', window._ozuid,
'', $('.new-goods .good-info .good-detail-img .good-thumb'));
break;
... ... @@ -431,6 +456,14 @@ function search(opt) {
window._yas(1 * new Date(), '1.0.16', 'yohobuy_m', window._ozuid,
'', $('.discount-goods .good-info .good-detail-img .good-thumb'));
break;
case 'default':
window._yas(1 * new Date(), '1.0.16', 'yohobuy_m', window._ozuid,
'', $('.default-goods .good-info .good-detail-img .good-thumb'));
break;
case 'sale':
window._yas(1 * new Date(), '1.0.16', 'yohobuy_m', window._ozuid,
'', $('.sale-goods .good-info .good-detail-img .good-thumb'));
break;
default:
break;
}
... ... @@ -482,6 +515,77 @@ $listNav.bind('contextmenu', function() {
return false;
});
function newListHide() {
var $firstLi = $listNav.find('li.first-li-more');
if ($newList.hasClass('hide')) {
$firstLi.find('span.up').addClass('hide');
$firstLi.find('span.down').removeClass('hide');
} else {
$firstLi.find('span.down').addClass('hide');
$firstLi.find('span.up').removeClass('hide');
}
}
$newList.on('touchstart', 'li', function(e) {
var navType, bpIdData = $(this).attr('data-bp-id') || '',
$firstLiDom = $listNav.find('li.first-li-more');
e.preventDefault();
if ($(this).hasClass('new')) {
navType = 'new';
} else if ($(this).hasClass('default')) {
navType = 'default';
} else if ($(this).hasClass('sale')) {
navType = 'sale';
}
$newList.addClass('hide');
$firstLiDom.find('.nav-txt').text($(this).text());
$firstLiDom.attr('data-bp-id', bpIdData).addClass('active').siblings().removeClass('active');
$listNav.find('.first-li-more').removeClass('new default sale').addClass(navType);
$(document).trigger('shouldSendBpData', [bpIdData]);
newListHide();
// 切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'new':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
case 'default':
$defaultgc.removeClass('hide');
break;
case 'sale':
$sgc.removeClass('hide');
break;
default:
break;
}
search();
});
$(document).on('touchstart', function(e) {
if (!$newList.hasClass('hide') &&
$(e.target).closest('.new-list, li.first-li-more').length <= 0) {
$newList.addClass('hide');
newListHide();
}
});
$listNav.on('touchend touchcancel', function(e) {
var $this = $(e.target).closest('li'),
nav,
... ... @@ -489,6 +593,23 @@ $listNav.on('touchend touchcancel', function(e) {
$active;
var bpIdData = $(this).find('.buriedpoint').attr('data-bp-id') || '';
if ($this.hasClass('first-li-more')) {
filter.hideFilter();
$newList.removeClass('hide');
if ($this.hasClass('default')) {
$newList.find('li.default').addClass('active').siblings().removeClass('active');
} else if ($this.hasClass('new')) {
$newList.find('li.new').addClass('active').siblings().removeClass('active');
} else if ($this.hasClass('sale')) {
$newList.find('li.sale').addClass('active').siblings().removeClass('active');
}
newListHide();
return true;
}
// 最新li 列表
$newList.addClass('hide');
if ($this.hasClass('filter')) {
// 筛选面板切换状态
... ... @@ -509,11 +630,15 @@ $listNav.on('touchend touchcancel', function(e) {
} else {
if ($this.hasClass('new')) {
navType = 'newest';
navType = 'new';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
} else if ($this.hasClass('default')) {
navType = 'default';
} else if ($this.hasClass('sale')) {
navType = 'sale';
}
nav = navInfo[navType];
... ... @@ -548,7 +673,7 @@ $listNav.on('touchend touchcancel', function(e) {
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
case 'new':
$ngc.removeClass('hide');
break;
... ... @@ -559,6 +684,14 @@ $listNav.on('touchend touchcancel', function(e) {
case 'discount':
$dgc.removeClass('hide');
break;
case 'default':
$defaultgc.removeClass('hide');
break;
case 'sale':
$sgc.removeClass('hide');
break;
default:
break;
}
... ...
... ... @@ -27,16 +27,18 @@ var tip = require('../../plugin/tip'),
var $subNav = $('.home-sub-nav'),
$collect = $('#collect'),
$goodsContainer = $('#goods-container'),
$goodsChildren = $goodsContainer.children(),
$ngc = $($goodsChildren.get(0)),
$pgc = $($goodsChildren.get(1)),
$dgc = $($goodsChildren.get(2)),
$ngc = $goodsContainer.children('.new-goods'),
$defaultgc = $goodsContainer.children('.default-goods'),
$sgc = $goodsContainer.children('.sale-goods'),
$pgc = $goodsContainer.children('.price-goods'),
$dgc = $goodsContainer.children('.discount-goods'),
shopId = $('input[name="shop_id"]').val(),
appVersion = $('input[name="app_version"]').val(),
brand = $('input[name="brand"]').val(),
coverChannel = $('input[name="coverChannel"]').val(),
favId = $('input[name="favId"]').val(),
uid = $('input[name="uid"]').val();
uid = $('input[name="uid"]').val(),
$newList = $('.new-list');
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -89,7 +91,7 @@ var $listNav = $('#list-nav'),
// 导航数据信息
navInfo = {
new: {
order: 1,
order: 0,
reload: true,
page: 1,
end: false
... ... @@ -97,12 +99,6 @@ var $listNav = $('#list-nav'),
hot: {
order: 1,
reload: true,
page: 1,
end: false
},
newest: {
order: 0,
reload: true,
page: 0,
end: false
},
... ... @@ -117,6 +113,18 @@ var $listNav = $('#list-nav'),
reload: true,
page: 0,
end: false
},
default: {
order: 0,
reload: true,
page: 0,
end: false
},
sale: {
order: 0,
reload: true,
page: 0,
end: false
}
},
$pre = $listNav.find('.active'), // 纪录进入筛选前的active项,初始为选中项
... ... @@ -199,7 +207,7 @@ function getPageGoods(info) {
url: info.url,
data: info.data,
success: function(data) {
if (data === ' ') {
if (data === '') {
nav.end = true;
}
... ... @@ -324,7 +332,8 @@ var theY;
* 筛选后内容变化,导致nav1位置错掉,重新计算确保位置正确显示
*/
function reNav1Pos() {
var sTop = theY ? theY : 0;
var sTop = theY ? theY : 0, tra;
if (sTop < imgH + main1oH + nav1H) {
if ($nav1.hasClass('hide')) {
$nav1.removeClass('hide');
... ... @@ -385,6 +394,7 @@ function scrollHandler() {
if (sTop + winH * 2 > scH) {
scrollCall = function() {
var translate = 'translate3d(0, ' + (-scH) + 'px, 0)';
$nav1.css({
transform: translate,
'-moz-transform': translate,
... ... @@ -620,11 +630,15 @@ function search(opt) {
// 导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
navType = 'new';
} else if ($pre.hasClass('price')) {
navType = 'price';
} else if ($pre.hasClass('discount')) {
navType = 'discount';
} else if ($pre.hasClass('default')) {
navType = 'default';
} else if ($pre.hasClass('sale')) {
navType = 'sale';
}
nav = navInfo[navType];
... ... @@ -668,7 +682,7 @@ function search(opt) {
num;
switch (navType) {
case 'newest':
case 'new':
$container = $ngc;
break;
case 'price':
... ... @@ -677,11 +691,17 @@ function search(opt) {
case 'discount':
$container = $dgc;
break;
case 'default':
$container = $defaultgc;
break;
case 'sale':
$container = $sgc;
break;
default:
break;
}
if (data === ' ') {
if (data === '') {
nav.end = true;
if (nav.reload) {
... ... @@ -722,10 +742,88 @@ function search(opt) {
}
$listNav.bind('contextmenu', function(e) {
$listNav.bind('contextmenu', function() {
return false;
});
function newListHide() {
var $firstLi = $('ul.pos-list').find('li.first-li-more');
if ($newList.hasClass('hide')) {
$firstLi.find('span.up').addClass('hide');
$firstLi.find('span.down').removeClass('hide');
} else {
$firstLi.find('span.down').addClass('hide');
$firstLi.find('span.up').removeClass('hide');
}
}
$newList.on('touchstart', 'li', function(e) {
var navType, bpIdData = $(this).attr('data-bp-id') || '',
$firstLiDom = $('ul.pos-list').find('li.first-li-more');
e.preventDefault();
if ($(this).hasClass('new')) {
navType = 'new';
} else if ($(this).hasClass('default')) {
navType = 'default';
} else if ($(this).hasClass('sale')) {
navType = 'sale';
}
$newList.addClass('hide');
$firstLiDom.find('.spanTest').text($(this).text());
$firstLiDom.attr('data-bp-id', bpIdData).addClass('active').siblings().removeClass('active');
$subNav.find('.first-li-more').removeClass('new default sale').addClass(navType);
$(document).trigger('shouldSendBpData', [bpIdData]);
newListHide();
// 切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'new':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
case 'default':
$defaultgc.removeClass('hide');
break;
case 'sale':
$sgc.removeClass('hide');
break;
default:
break;
}
search({
type: 'shop_id',
id: shopId,
brand: brand,
appVersion: appVersion,
url: location.protocol + '//m.yohobuy.com/product/search/search',
nextPage: false
});
});
$(document).on('touchstart', function(e) {
if (!$newList.hasClass('hide') &&
$(e.target).closest('.new-list, li.first-li-more').length <= 0) {
$newList.addClass('hide');
newListHide();
}
});
$subNav.on('touchend touchcancel', function(e) {
var $this = $(e.target).closest('li'),
cname,
... ... @@ -735,6 +833,24 @@ $subNav.on('touchend touchcancel', function(e) {
var bpIdData = $this.attr('data-bp-id') || '';
e.preventDefault();
if ($this.hasClass('first-li-more')) {
filter.hideFilter();
$newList.removeClass('hide');
if ($this.hasClass('default')) {
$newList.find('li.default').addClass('active').siblings().removeClass('active');
} else if ($this.hasClass('new')) {
$newList.find('li.new').addClass('active').siblings().removeClass('active');
} else if ($this.hasClass('sale')) {
$newList.find('li.sale').addClass('active').siblings().removeClass('active');
}
newListHide();
return true;
}
// 最新li 列表
$newList.addClass('hide');
$(document).trigger('shouldSendBpData', [bpIdData]);
if (typeof $this === 'undefined' || $this.length === 0) {
... ... @@ -772,13 +888,19 @@ $subNav.on('touchend touchcancel', function(e) {
if ($this.hasClass('new')) {
cname = '.new';
navType = 'newest';
navType = 'new';
} else if ($this.hasClass('price')) {
cname = '.price';
navType = 'price';
} else if ($this.hasClass('discount')) {
cname = '.discount';
navType = 'discount';
} else if ($this.hasClass('hot')) {
cname = '.default';
navType = 'default';
} else if ($this.hasClass('sale')) {
cname = '.sale';
navType = 'sale';
}
myScroll && myScroll.enable();
... ... @@ -803,7 +925,7 @@ $subNav.on('touchend touchcancel', function(e) {
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
case 'new':
$ngc.removeClass('hide');
break;
... ... @@ -814,6 +936,14 @@ $subNav.on('touchend touchcancel', function(e) {
case 'discount':
$dgc.removeClass('hide');
break;
case 'default':
$defaultgc.removeClass('hide');
break;
case 'sale':
$sgc.removeClass('hide');
break;
default:
break;
}
... ... @@ -832,7 +962,7 @@ $subNav.on('touchend touchcancel', function(e) {
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
case 'new':
$ngc.removeClass('hide');
break;
... ... @@ -843,6 +973,14 @@ $subNav.on('touchend touchcancel', function(e) {
case 'discount':
$dgc.removeClass('hide');
break;
case 'default':
$defaultgc.removeClass('hide');
break;
case 'sale':
$sgc.removeClass('hide');
break;
default:
break;
}
... ... @@ -885,7 +1023,7 @@ filter.initFilter({
missStatus: true
});
$listNav.on('touchstart', 'li', function(e) {
$listNav.on('touchstart', 'li', function() {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$listNav.find('li').removeClass('bytouch');
... ... @@ -893,7 +1031,7 @@ $listNav.on('touchstart', 'li', function(e) {
// myScroll && myScroll.refresh();
});
$nav2.on('touchstart', 'li', function(e) {
$nav2.on('touchstart', 'li', function() {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$nav2.find('li').removeClass('bytouch');
... ... @@ -929,6 +1067,7 @@ $nav2.on('touchstart', 'li', function(e) {
$('.shop-foot-wrapper .buriedpoint').click(function() {
var subGroup = $(this).find('.sub-group');
if (subGroup.hasClass('hide')) {
subGroup.removeClass('hide');
} else {
... ... @@ -953,7 +1092,7 @@ $collect.on('touchstart', function() {
$.ajax({
method: 'get',
url: location.protocol + '//m.yohobuy.com' + '/product/opt/favoriteBrand',
url: location.protocol + '//m.yohobuy.com/product/opt/favoriteBrand',
data: {
id: favId ? favId : shopId,
appVersion: appVersion,
... ...
... ... @@ -207,6 +207,9 @@ $(
newDay = newDate.getDate();
newHour = newDate.getHours();
newMinus = newDate.getMinutes();
if (newMinus === 0) {
newMinus = '00';
}
$('.notStart').find('.seckill-time-c').text(newMonth + '月' + newDay + '日' + newHour + ':' + newMinus);
seckillObj.startTick(timeObj, offsetTime);
}
... ...
... ... @@ -171,7 +171,6 @@
font-size: 28px;
background: #e0e0e0;
display: none;
padding-bottom: 8px;
li{
border-bottom:1px solid #fff;
... ...
... ... @@ -62,6 +62,12 @@
border: 1px solid #000;
color: #000;
}
.is-presell {
width: 60px;
background-color: #000;
color: #fff;
}
}
}
... ...
... ... @@ -36,7 +36,6 @@
background: transparent;
margin: 23px 0 0 60px;
width: 410px;
font-family: helvetica, Arial, "黑体";
}
.username {
... ...
... ... @@ -153,3 +153,9 @@
}
}
}
.installment-body {
.dialog-box {
background: #fff !important;
}
}
... ...
... ... @@ -185,6 +185,12 @@ $basicBtnC: #eb0313;
background-color: #ffac5b;
color: #fff;
}
.is-presell {
background-color: #000;
color: #fff;
width: 60px;
}
}
.banner-container {
... ...
... ... @@ -114,7 +114,6 @@
text-align: center;
border: 1px solid #fff;
color: #fff;
top: 50%;
margin-top: -24px;
}
... ... @@ -286,4 +285,30 @@
padding-left: 0.375rem;
padding-top: 0.2rem;
}
.new-list {
width: 100%;
background-color: #fff;
font-size: 28px;
color: #444;
position: absolute;
z-index: 5;
li {
margin-left: 35px;
height: 88px;
line-height: 88px;
border-bottom: 1px solid #e0e0e0;
padding-right: 38px;
&:last-child {
border-bottom: none;
}
&.active {
background: resolve('product/shop/check.png') no-repeat 94% center;
background-size: 36px 26px;
}
}
}
}
... ...
... ... @@ -17,7 +17,7 @@
}
.coupon-left .coupon-left-price {
margin: 0 15px;
margin: 0 25px;
float: left;
}
... ...
... ... @@ -373,10 +373,8 @@
}
}
.active {
.cur {
color: #444;
}
.active .cur{
color: #444;
}
.list-nav .icon .up {
... ... @@ -523,14 +521,7 @@
width: 100%;
height: 100%;
color: #b0b0b0;
/*b {
height: 28px;
border-left: 1px solid #e0e0e0;
float: right;
margin-top: 25px;
}*/
}
}
}
.active .cur {
... ... @@ -581,6 +572,32 @@
.category-list-only-one-row {
border-top: none!important;
}
.new-list {
width: 100%;
background-color: #fff;
font-size: 28px;
color: #444;
position: absolute;
z-index: 5;
li {
margin-left: 35px;
height: 88px;
line-height: 88px;
border-bottom: 1px solid #e0e0e0;
padding-right: 38px;
&:last-child {
border-bottom: none;
}
&.active {
background: resolve('product/shop/check.png') no-repeat 94% center;
background-size: 36px 26px;
}
}
}
}
.shop-index + .filter-mask {
... ...
... ... @@ -59,6 +59,8 @@ const getTypeCont = (type, order) => {
return order === '0' ? 's_t_desc' : 's_t_asc';
case 'hot':
return order === '0' ? 's_n_desc' : 's_n_asc';
case 'default':
return order === '0' ? 's_n_desc' : 's_n_asc';
default:
return order === '0' ? 's_t_desc' : 's_t_asc';
}
... ...