Authored by xuqi

Merge branch 'feature/replacePkg' into develop

{
"disallowDanglingUnderscores": true,
"disallowEmptyBlocks": true,
"disallowKeywordsInComments": ["TODO", "FIXME"],
"disallowKeywordsOnNewLine": ["else", "else if"],
"disallowKeywords": ["with", "eval"],
"disallowMixedSpacesAndTabs": true,
... ... @@ -32,10 +30,18 @@
"requireBlocksOnNewline": {
"includeComments": true
},
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireDollarBeforejQueryAssignment": true,
"requireDotNotation": true,
"requireLineBreakAfterVariableAssignment": true,
... ... @@ -59,8 +65,7 @@
"while",
"with",
"return",
"typeof",
"function"
"typeof"
],
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": 1,
... ...
... ... @@ -3,7 +3,6 @@
"bitwise": false,
"boss": false,
"browser": true,
"camelcase": true,
"couch": false,
"curly": true,
"debug": false,
... ... @@ -21,7 +20,7 @@
"globalstrict": false,
"immed": true,
"iterator": false,
"jquery": true,
"jquery": false,
"lastsemic": false,
"latedef": true,
"laxbreak": true,
... ... @@ -65,7 +64,6 @@
"yui": false,
"maxerr": 20,
"predef": ["define", "seajs"],
"quotmark": "single",
"maxcomplexity": 10
"predef": ["define", "seajs", "wx"],
"quotmark": "single"
}
... ...
{
"name": "homePage",
"version": "1.0.0",
"description": "yohobuy-mobile homePage",
"main": "app.js",
"scripts": {
"test": "spm test",
"build": "spm build"
},
"author": "liuyue <yue.liu@yoho.cn>",
"license": "ISC",
"spm": {
"main": "index.js",
"dependencies": {
"jquery": "1.8.3",
"lazyload": "1.9.6",
"mustache": "2.0.0",
"yoho-idangerous.swiper": "0.0.3"
},
"devDependencies": {
"expect.js": "0.3.1"
},
"buildArgs": "--idleading {{}}"
"name": "homePage",
"version": "1.0.0",
"description": "yohobuy-mobile homePage",
"main": "app.js",
"scripts": {
"test": "spm test",
"build": "spm build"
},
"author": "liuyue <yue.liu@yoho.cn>",
"license": "ISC",
"spm": {
"main": "index.js",
"dependencies": {
"yoho.jquery": "1.8.3",
"yoho.lazyload": "1.0.0",
"yoho.mustache": "2.1.3",
"yoho.iswiper": "3.0.6"
},
"devDependencies": {
"spm": "3"
"expect.js": "0.3.1"
},
"dependencies": {
"body-parser": "^1.12.2",
"express": "^4.12.3",
"gulp": "^3.8.11",
"gulp-compass": "^2.0.4",
"gulp-concat": "^2.5.2",
"gulp-develop-server": "^0.4.2",
"gulp-ftp": "^1.0.3",
"gulp-util": "^3.0.4",
"hbs": "^3.0.1",
"father": "^1.0.0",
"gulp-spm": "^0.11.3",
"gulp-uglify": "^1.2.0",
"mkdirp": "^0.5.1",
"request": "^2.58.0",
"rmdir": "^1.1.0"
}
"buildArgs": "--idleading {{}}"
},
"devDependencies": {
"spm": "3"
},
"dependencies": {
"body-parser": "^1.12.2",
"express": "^4.12.3",
"gulp": "^3.8.11",
"gulp-compass": "^2.0.4",
"gulp-concat": "^2.5.2",
"gulp-develop-server": "^0.4.2",
"gulp-ftp": "^1.0.3",
"gulp-util": "^3.0.4",
"hbs": "^3.0.1",
"father": "^1.0.0",
"gulp-spm": "^0.11.3",
"gulp-uglify": "^1.2.0",
"mkdirp": "^0.5.1",
"request": "^2.58.0",
"rmdir": "^1.1.0"
}
}
\ No newline at end of file
... ...
/**
* lazyload
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/6/25
*/
var $ = require('jquery');
require('lazyload');
/**
* 为指定imgs添加lazyload效果,未指定imgs则为所有img.lazy添加lazyload效果
* @params imgs lazyload的图片
* @params options lazyload效果选项
*/
module.exports = function(imgs, options) {
var setting = {
effect : 'fadeIn',
effect_speed: 10,
placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==',
skip_invisible: false
}, $imgs, argsLength = arguments.length;
//分解参数
(function seperateOptions() {
switch (argsLength) {
case 0:
$imgs = $('img.lazy');
break;
case 1:
if (imgs instanceof $) {
//img
$imgs = imgs;
} else {
$imgs = $('img.lazy');
$.extend(setting, imgs);
}
break;
case 2:
$imgs = imgs;
setting = $.extend(setting, options);
break;
}
}());
$imgs.lazyload(setting);
};
\ No newline at end of file
... ... @@ -4,17 +4,12 @@
* @date: 2015/7/15
*/
var $ = require('jquery'),
Mustache = require('mustache'),
lazyLoad = require('./lazyload');
var $ = require('yoho.jquery'),
Mustache = require('yoho.mustache'),
lazyLoad = require('yoho.lazyload');
var $maybeLike = $('.maybe-like:last');
// 无可能喜欢模块时直接返回
if ($maybeLike.length === 0) {
return;
}
var winH = $(window).height(),
loading = false,
end = false,
... ... @@ -24,13 +19,19 @@ var winH = $(window).height(),
var $goodList = $maybeLike.children('.goods-list'),
mblTop = $maybeLike.offset().top; //页面内容固定,可以预先求出高度
var isLogin = 'Y'; //TODO:后台提供,区分走Ajax还是页面跳转
// 无可能喜欢模块时直接返回
if ($maybeLike.length === 0) {
return;
}
//read good-info template
$.get('/common/goodinfo', function(data) {
tpl = '{{# goods}}' + data + '{{/ goods}}';
Mustache.parse(tpl);
});
var isLogin = 'Y'; //TODO:是否登录,后台提供,区分走Ajax还是页面跳转
//商品收藏
$('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
var $cur, $good, id, url;
... ... @@ -57,8 +58,6 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
}).then(function(data) {
if (data.code === 200) {
$cur.toggleClass('good-like');
} else if (data.code === 400) {
//TODO:提示登录
}
});
}
... ... @@ -68,6 +67,7 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
//srcoll to load more
$(window).scroll(function() {
var num;
if (end || loading) {
return;
}
... ... @@ -86,8 +86,8 @@ $(window).scroll(function() {
page: page + 1
}
}).then(function(data) {
var res,
i;
var res;
if (data.code === 200) {
res = data.data;
... ...
... ... @@ -4,9 +4,9 @@
* @date: 2015/7/15
*/
var $ = require('jquery'),
swiper = require('yoho-idangerous.swiper'),
lazyLoad = require('./common/lazyload'),
var $ = require('yoho.jquery'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload'),
bannerSwiper,
hotBrandsSwiper,
recommendSwiper,
... ... @@ -23,6 +23,7 @@ $('.nav-btn').on('click', function(event) {
if (!$(this).hasClass('menu-open')) {
$('.mobile-wrap').addClass('menu-open');
$('.overlay').addClass('show');
//设置boy高度,页面不能上下滑动
$('body').css({
height: $(window).height(),
... ... @@ -41,7 +42,7 @@ $('.mobile-wrap').on('click', function() {
$('body').css({
height: 'auto',
overflow: 'auto'
})
});
}
});
... ... @@ -63,7 +64,7 @@ $('.sub-nav').each(function() {
//头部banner轮播
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new swiper('.banner-swiper', {
bannerSwiper = new Swiper('.banner-swiper', {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
... ... @@ -74,10 +75,10 @@ if ($('.banner-swiper').find('li').size() > 1) {
lazyLoad($('.banner-swiper .swiper-slide').eq(bannerSwiper.activeIndex).find('img'));
}
});
};
}
//热门品牌滑动
hotBrandsSwiper = new swiper('.brands-swiper', {
hotBrandsSwiper = new Swiper('.brands-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'brands-list',
... ... @@ -85,7 +86,7 @@ hotBrandsSwiper = new swiper('.brands-swiper', {
});
//推荐搭配滑动
recommendSwiper = new swiper('.recommend-swiper', {
recommendSwiper = new Swiper('.recommend-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'recommend-list',
... ... @@ -94,7 +95,7 @@ recommendSwiper = new swiper('.recommend-swiper', {
//潮品话题轮播
if ($('.trend-topic-swiper').find('li').size() > 1) {
trendTopicSwiper = new swiper('.trend-topic-swiper', {
trendTopicSwiper = new Swiper('.trend-topic-swiper', {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
... ... @@ -105,14 +106,15 @@ if ($('.trend-topic-swiper').find('li').size() > 1) {
lazyLoad($('.trend-topic-swiper .swiper-slide').eq(trendTopicSwiper.activeIndex).find('img'));
}
});
};
}
//潮流上装/经典裤装等轮播
$('.category-swiper').each(function(i, index) {
var swiperClass = 'category-swiper' + i;
$(this).addClass(swiperClass);
if ($('.' + swiperClass).find('.swiper-slide').size() > 1) {
goodsSwiper = new swiper('.' + swiperClass, {
goodsSwiper = new Swiper('.' + swiperClass, {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
... ...
This diff could not be displayed because it is too large.
... ... @@ -13,13 +13,13 @@
"spm": {
"main": "yoho-mobile.js",
"dependencies": {
"jquery": "1.8.3",
"yoho.lazyload": "1.0.0",
"yoho.iswiper": "3.0.6",
"yoho.mustache": "2.1.3",
"yoho.jquery": "1.8.3",
"mlellipsis": "0.0.6",
"lazyload": "1.9.6",
"iscroll": "5.1.2",
"mustache": "2.0.0",
"underscore": "1.6.0",
"yoho-idangerous.swiper": "0.0.3"
"underscore": "1.6.0"
},
"devDependencies": {
"expect.js": "0.3.1"
... ... @@ -49,4 +49,4 @@
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6"
}
}
}
\ No newline at end of file
... ...
... ... @@ -13,13 +13,13 @@
"spm": {
"main": "index.js",
"dependencies": {
"jquery": "1.8.3",
"yoho.jquery": "1.8.3",
"yoho.mustache": "2.1.3",
"yoho.iswiper": "3.0.6",
"yoho.lazyload": "1.0.0",
"mlellipsis": "0.0.6",
"lazyload": "1.9.6",
"iscroll": "5.1.2",
"mustache": "2.0.0",
"underscore": "1.6.0",
"yoho-idangerous.swiper": "0.0.3"
"underscore": "1.6.0"
},
"devDependencies": {
"expect.js": "0.3.1"
... ... @@ -42,12 +42,15 @@
"dependencies": {
"body-parser": "^1.12.2",
"express": "^4.12.3",
"father": "^1.0.0",
"gulp": "^3.8.11",
"gulp-compass": "^2.0.4",
"gulp-concat": "^2.5.2",
"gulp-develop-server": "^0.4.2",
"gulp-ftp": "^1.0.3",
"gulp-spm": "^0.11.3",
"gulp-uglify": "^1.3.0",
"gulp-util": "^3.0.4",
"hbs": "^3.0.1"
}
}
\ No newline at end of file
}
... ...
/**
* lazyload
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/6/25
*/
var $ = require('jquery');
require('lazyload');
/**
* 为指定imgs添加lazyload效果,未指定imgs则为所有img.lazy添加lazyload效果
* @params imgs lazyload的图片
* @params options lazyload效果选项
*/
module.exports = function(imgs, options) {
var setting = {
effect : 'fadeIn',
effect_speed: 10,
placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
}, $imgs, argsLength = arguments.length;
//分解参数
(function seperateOptions() {
switch (argsLength) {
case 0:
$imgs = $('img.lazy');
break;
case 1:
if (imgs instanceof $) {
//img
$imgs = imgs;
} else {
$imgs = $('img.lazy');
$.extend(setting, imgs);
}
break;
case 2:
$imgs = imgs;
setting = $.extend(setting, options);
break;
}
}());
$imgs.lazyload(setting);
};
\ No newline at end of file
... ... @@ -4,12 +4,12 @@
* @date;2015/4/16
*/
var $ = require('jquery'),
Mustache = require('mustache'),
var $ = require('yoho.jquery'),
Mustache = require('yoho.mustache'),
lazyload = require('yoho.lazyload'),
ellipsis = require('mlellipsis');
require('./wxshare')();
require('lazyload');
/**
* 初始化页面功能
... ... @@ -21,20 +21,20 @@ exports.init = function() {
$introTxt = $moreIntro.find('.more-intro-text'),
$iconUp = $moreIntro.find('.up'),
$iconDown = $moreIntro.find('.down'),
winH = $(window).height(),
isLogin = $('#is-login').val(),
$loginTip = $('#login-tip'),
winH = $(window).height();
var winW,
tipH,
tipW,
mIntro, //品牌介绍文字介绍
aIntro,
tpl;
var isLogin = $('#is-login').val();
isLogin = isLogin ? isLogin : 'N';
//登录提示变量
var $loginTip = $('#login-tip'),
winW,
tipH,
tipW;
//获取相关资讯模板
$.get('/common/articletpl', function(data) {
$.get('/common/articletpl', function(data) {
tpl = data;
Mustache.parse(tpl); //pre-compile and cache template
});
... ... @@ -42,7 +42,9 @@ exports.init = function() {
//文字截取
ellipsis.init();
$intro[0].mlellipsis(3); //品牌介绍
$('.info-block-content, .info-block-title').each(function() { //相关文章
//相关文章
$('.info-block-content, .info-block-title').each(function() {
this.mlellipsis(2);
});
setTimeout(function() {
... ... @@ -51,17 +53,14 @@ exports.init = function() {
}, 0);
//lazyload
$('img.lazy').lazyload({
effect : 'fadeIn',
effect_speed: 10,
placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
});
lazyload();
aIntro = $intro.attr('_title');
//显示品牌介绍所有文字/隐藏
function showMoreIntro() {
$moreIntro.toggleClass('show');
if ($moreIntro.hasClass('show')) {
$intro.text(aIntro);
$introTxt.text('收起');
... ... @@ -78,28 +77,29 @@ exports.init = function() {
$moreIntro.delegate('.more', 'click', function() {
showMoreIntro();
});
//提示信息位置
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
//绑定商品信息的收藏和取消收藏事件(相关推荐和搭配模块)
$('.new-arrival-content').delegate('.good-islike', 'touchstart', function(e) {
var $cur,
$good,
id;
if (isLogin === 'N') {
if (isLogin === 'N') {
$cur = $(e.currentTarget);
$good = $cur.closest('.good-info');
id = $good.data('id');
$.ajax({
type: 'GET',
url: '/favorite/product',
... ... @@ -111,10 +111,11 @@ exports.init = function() {
if (data.code === 200) {
$cur.toggleClass('good-like');
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
... ... @@ -125,16 +126,17 @@ exports.init = function() {
e.preventDefault();
}
});
//文章点赞
$('#info-content').delegate('.like-btn', 'touchstart', function(e) {
var $cur = $(e.currentTarget),
$info = $cur.closest('.info-block'),
id = $info.data('id'),
url;
//取消点赞的处理
$cur.toggleClass('like');
if ($cur.hasClass('like')) {
url = '/guang/info/praise';
} else {
... ... @@ -148,29 +150,33 @@ exports.init = function() {
}
}).then(function(data) {
if (data.code === 200) {
//更新点赞数
$cur.next('span.like-count').text(data.data);
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
});
});
$('#brand-like').bind('touchstart', function(e) {
var $cur,
id,
type = 'fav';
if (isLogin === 'Y') {
$cur = $(this);
id = $(this).closest('.brand-info').data('id');
if ($cur.hasClass('like')) {
type = 'cancel';
}
//
$.ajax({
type: 'GET',
... ... @@ -185,7 +191,7 @@ exports.init = function() {
} else if (data.code === 400) {
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
... ... @@ -193,6 +199,7 @@ exports.init = function() {
}
}).bind('click', function(e) {
if (isLogin === 'Y') {
//阻止链接跳转
e.preventDefault();
}
... ...
var $ = require('jquery'),
lazyLoad = require('./common/lazyload'),
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload'),
Mlellipsis = require('mlellipsis'),
Mustache = require('mustache'),
Swiper = require('yoho-idangerous.swiper');
Mustache = require('yoho.mustache'),
Swiper = require('yoho.iswiper');
//下拉加载
var $nav = $('#saunter-nav'),
$msgList = $('#msg-list'),
$loadMore = $('#load-more-info'),
... ... @@ -15,24 +14,27 @@ var $nav = $('#saunter-nav'),
reloadFirst = false, //重新加载首页数据标志
loading = false, //正在ajax标志
winH = $(window).height(),
tpl;
tpl,
swiper;
require('./wxshare')();
//初始化focus
$('.saunter-nav > li:first-child').addClass('focus');
//初始化cached
$('.saunter-nav li').each(function() {
var $el = $(this),
page = $el.index() === 0 ? 1 : 0;
cached[$el.data('type')] = {
page: page,
end: false,
msgs: []
}
};
});
new Swiper('.swiper-container', {
swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination'
});
... ... @@ -59,7 +61,9 @@ $.get('/common/tagtpl', function(data) {
* @return html String 返回的HTML
*/
function getMsgHtml(msgs) {
var html = '', i;
var html = '',
i;
for (i = 0; i < msgs.length; i++) {
html += Mustache.render(tpl, msgs[i]);
}
... ... @@ -93,19 +97,24 @@ $nav.delegate('li', 'click', function() {
}
}).then(function(data) {
var res;
if (data.code === 200) {
res = data.data.infos;
$msgList.html(getMsgHtml(res));
//
if ($el.index() === 0) {
//点击第一个项只需更新cachedMsg,不需要更新page
reloadFirst = true;
cached[type].msgs = res.concat(cached[type].msgs);
} else {
cached[type].page++;
//cache
cached[type].msgs = res;
}
//lazyload
lazyLoad($msgList.find('img.lazy'));
}
... ... @@ -139,9 +148,9 @@ function loadMore() {
page: cached[type].page + 1
}
}).then(function(data) {
var res, info,
$newContent,
i = 0;
var res, msgs, html,
$newContent;
if (data.code === 200) {
res = data.data;
if (res.end) {
... ... @@ -153,10 +162,11 @@ function loadMore() {
msgs = res.infos;
html = getMsgHtml(msgs);
$msgList.append(html);
//update cache
cached[type].msgs = cached[type].msgs.concat(msgs);
cached[type].page++;
//
//lazyload & mlellipsis
if (num === 0) {
$newContent = $msgList.children('.tag-content');
... ... @@ -182,8 +192,9 @@ $('.msg-list').delegate('.like-btn', 'touchstart', function(e) {
$info = $cur.closest('.tag-content'),
id = $info.data('id'),
url;
$cur.toggleClass('like');
if ($cur.hasClass('like')) {
url = '/guang/info/praise';
} else {
... ... @@ -197,13 +208,15 @@ $('.msg-list').delegate('.like-btn', 'touchstart', function(e) {
}
}).then(function(data) {
if (data.code === 200) {
//更新点赞数
$cur.next('span.like-count').text(data.data);
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
... ...
... ... @@ -3,36 +3,19 @@
* @author: yue.liu@yoho.cn
* @date;2015/3/31
*/
var $ = require('jquery'),
var $ = require('yoho.jquery'),
IScroll = require('iscroll/iscroll-probe'),
lazyLoad = require('yoho.lazyload'),
ellipsis = require('mlellipsis');
require('./wxshare')();
require('lazyload');
//lazyLoad-Fn
function lazyLoad(imgs, options) {
var setting = {
effect : 'fadeIn',
effect_speed: 10,
placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
}, $imgs;
if (typeof imgs === 'undefined') {
$imgs = $('img.lazy');
} else {
$imgs = imgs;
}
if (typeof options !== 'undefined') {
$.extend(setting, options);
}
$imgs.lazyload(setting);
}
/**
* 初始设置获取文章的点击数目(更新客户端缓存的数据)
*/
(function updateClickCount() {
function updateClickCount() {
var id = $('#article-id').val();
$.ajax({
type: 'GET',
url: '/guang/info/getpraise',
... ... @@ -44,40 +27,46 @@ function lazyLoad(imgs, options) {
$('.page-view').html(data.data.views_num);
}
});
}());
}
updateClickCount();
/**
* 初始化Android页面
*/
exports.initAndroid = function() {
$(function() {
var $loginTip = $('#login-tip'),
winH,
winW,
tipH,
tipW;
winH,
winW,
tipH,
tipW;
var isLogin = $('#is-login').val();
isLogin = isLogin ? isLogin : 'N';
//头部作者信息样式计算(在描述信息过长时换行显示, 去除intro的padding-top)
//类型3文章相关变量
var isInit = true,
hadLazy = {},
$atContainer,
$thumbContainer,
$prodList,
thumbWidth,
arrPos;
//头部作者信息样式计算(在描述信息过长时换行显示,去除intro的padding-top)
var $linkC = $('#link-container'),
$avatar = $linkC.find('.avatar'),
$name = $linkC.find('.name'),
$intro = $linkC.find('.intro');
isLogin = isLogin ? isLogin : 'N';
if ($avatar.outerWidth(true) + $name.outerWidth(true) + $intro.outerWidth(true) > $(window).width()) {
$intro.css('padding-top', 0);
}
//类型3文章相关变量
var isInit = true,
hadLazy = {},
atContainer,
thumbContainer,
prodList,
thumbWidth,
arrPos;
//样式初始化
$('#wrapper').removeClass('no-android');
//相关文章截取文字
ellipsis.init();
$('.post-list span, .one-good .reco-name').each(function() {
... ... @@ -86,32 +75,33 @@ exports.initAndroid = function() {
$('.brand-name').each(function() {
this.mlellipsis(1);
});
//图片懒加载
lazyLoad();
//提示信息位置
winH = $(window).height();
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
winH = $(window).height();
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
//绑定商品信息的收藏和取消收藏事件(相关推荐和搭配模块)
$('.good-list, .prod-list').delegate('.good-islike', 'touchstart', function(e) {
var $cur,
$good,
id;
if (isLogin === 'N') {
$cur = $(e.currentTarget);
$good = $cur.closest('.good-info');
id = $good.data('id');
$.ajax({
type: 'GET',
url: '/favorite/product',
... ... @@ -123,10 +113,11 @@ exports.initAndroid = function() {
if (data.code === 200) {
$cur.toggleClass('good-like');
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
... ... @@ -137,101 +128,107 @@ exports.initAndroid = function() {
e.preventDefault();
}
});
//类型三文章
atContainer = $('.article-type-three');
if (atContainer.length === 0) {
$atContainer = $('.article-type-three');
if ($atContainer.length === 0) {
return;
}
thumbContainer = atContainer.find('.thumb-container');
prodList = atContainer.find('.prod-list');
thumbWidth = thumbContainer.find('li').width();
$thumbContainer = $atContainer.find('.thumb-container');
$prodList = $atContainer.find('.prod-list');
thumbWidth = $thumbContainer.find('li').width();
arrPos = function($cur) {
var left = $cur.offset().left,
bgPos = -winW + left + (thumbWidth / 2) + 'px';
thumbContainer.css({
'backgroundPosition': bgPos + ' bottom'
$thumbContainer.css({
backgroundPosition: bgPos + ' bottom'
});
};
//点击分类,显示分类下推荐商品列表
thumbContainer.delegate('.thumb', 'click', function() {
var curItem,
$thumbContainer.delegate('.thumb', 'click', function() {
var $curItem,
index;
curItem = $(this);
index = curItem.index();
thumbContainer.find('.thumb').removeClass('focus');
curItem.addClass('focus');
arrPos(curItem);
$curItem = $(this);
index = $curItem.index();
$thumbContainer.find('.thumb').removeClass('focus');
$curItem.addClass('focus');
prodList.find('.prod')
arrPos($curItem);
$prodList.find('.prod')
.addClass('hide')
.eq(index)
.removeClass('hide');
//图片懒加载(防止多次点击反复触发造成页面闪烁现象)
if (!hadLazy[index]) {
hadLazy[index] = true;
lazyLoad(prodList.find('.prod:eq(' + index + ') img.lazy'));
lazyLoad($prodList.find('.prod:eq(' + index + ') img.lazy'));
}
//scroll to top
if (!isInit) {
$('body').animate({
scrollTop: atContainer.offset().top
scrollTop: $atContainer.offset().top
}, 400);
} else {
isInit = false;
}
});
//默认选中第一个
thumbContainer.find('.thumb:first-child').click();
$thumbContainer.find('.thumb:first-child').click();
});
};
/**
* 初始化非Android页面
*/
exports.initOther = function() {
var hasAt = true, //是否包含article-type-three
atContainer,
thumbContainer,
fixedThumbContainer = $(''), //初始化为jq对象
prodList,
$atContainer,
$thumbContainer,
$fixedThumbContainer = $(''), //初始化为jq对象
$prodList,
winH,
myScroll;
$(function() {
var $loginTip = $('#login-tip'),
winW,
tipH,
tipW;
winW,
tipH,
tipW;
var isLogin = $('#is-login').val();
isLogin = isLogin ? isLogin : 'N';
//article-type-three相关变量
var isInit = true,
scrollToEl = document.querySelector('#wrapper .article-type-three'),
thumbs,
$thumbs,
arrPos;
//头部作者信息样式计算(在描述信息过长时换行显示, 去除intro的padding-top)
//头部作者信息样式计算(在描述信息过长时换行显示,去除intro的padding-top)
var $linkC = $('#link-container'),
$avatar = $linkC.find('.avatar'),
$name = $linkC.find('.name'),
$intro = $linkC.find('.intro');
//thumb的宽度,防止fixed-thumb未加载的问题
var thumbWidth;
//
isLogin = isLogin ? isLogin : 'N';
if ($avatar.outerWidth(true) + $name.outerWidth(true) + $intro.outerWidth(true) > $(window).width()) {
$intro.css('padding-top', 0);
}
//图片懒加载
lazyLoad();
//相关文章截取文字
ellipsis.init();
$('.post-list .title, .one-good .reco-name').each(function() {
... ... @@ -240,29 +237,30 @@ exports.initOther = function() {
$('.brand-name').each(function() {
this.mlellipsis(1);
});
//提示信息位置
winH = $(window).height();
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
winH = $(window).height();
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
//绑定商品信息的收藏和取消收藏事件(相关推荐和搭配模块)
$('.good-list, .prod-list').delegate('.good-islike', 'touchstart', function(e) {
var $cur,
$good,
id;
if (isLogin === 'N') {
$cur = $(e.currentTarget);
$good = $cur.closest('.good-info');
id = $good.data('id');
$.ajax({
type: 'GET',
url: '/favorite/product',
... ... @@ -274,10 +272,11 @@ exports.initOther = function() {
if (data.code === 200) {
$cur.toggleClass('good-like');
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
... ... @@ -288,67 +287,71 @@ exports.initOther = function() {
e.preventDefault();
}
});
//article-three效果
atContainer = $('.article-type-three');
if (atContainer.length > 0) {
hasAt= true;
$atContainer = $('.article-type-three');
if ($atContainer.length > 0) {
hasAt = true;
} else {
hasAt = false;
}
//初始化
thumbContainer = atContainer.find('.thumb-container');
prodList = atContainer.find('.prod-list');
//
fixedThumbContainer = $('#wrapper')
.after(thumbContainer.clone().addClass('fixed-thumb-container fixed-bottom hide'))
$thumbContainer = $atContainer.find('.thumb-container');
$prodList = $atContainer.find('.prod-list');
$fixedThumbContainer = $('#wrapper')
.after($thumbContainer.clone().addClass('fixed-thumb-container fixed-bottom hide'))
.next('.thumb-container');
thumbs = $('.thumb');
$thumbs = $('.thumb');
//手动替换出fixedThumbContainer中的图片Lazyload
fixedThumbContainer.find('li').each(function() {
$fixedThumbContainer.find('li').each(function() {
var $img = $(this).children('img.lazy');
$img.attr('src', $img.attr('data-original'));
});
/**
* 计算小箭头位置函数
* @param $cur 当前点击thumb
*/
thumbWidth = thumbContainer.find('li').width();
thumbWidth = $thumbContainer.find('li').width();
arrPos = function($cur) {
var left = $cur.offset().left,
bgPos = -winW + left + (thumbWidth / 2) + 'px';
thumbContainer.css({
'backgroundPosition': bgPos + ' bottom'
$thumbContainer.css({
backgroundPosition: bgPos + ' bottom'
});
fixedThumbContainer.css({
'backgroundPosition': bgPos + ' bottom'
$fixedThumbContainer.css({
backgroundPosition: bgPos + ' bottom'
});
};
/**
* 分类的点击事件句柄
*/
function thumbClickEvt(e) {
var that = $(e.currentTarget),
index = that.index(),
other;
var $that = $(e.currentTarget),
index = $that.index(),
$other;
if (that.closest('.fixed-thumb-container').length > 0) {
other = thumbContainer.find('.thumb:eq(' + index + ')');
if ($that.closest('.fixed-thumb-container').length > 0) {
$other = $thumbContainer.find('.thumb:eq(' + index + ')');
} else {
other = fixedThumbContainer.find('.thumb:eq(' + index + ')');
$other = $fixedThumbContainer.find('.thumb:eq(' + index + ')');
}
//set status of that & other synchronous
thumbs.removeClass('focus');
$thumbs.removeClass('focus');
that.addClass('focus');
other.addClass('focus');
$that.addClass('focus');
$other.addClass('focus');
arrPos(that);
arrPos($that);
prodList.find('.prod')
$prodList.find('.prod')
.addClass('hide')
.eq(index)
.removeClass('hide');
... ... @@ -362,9 +365,10 @@ exports.initOther = function() {
isInit = false;
}
}
thumbs.click(thumbClickEvt);
$thumbs.click(thumbClickEvt);
//默认选中第一个
thumbContainer.find('.thumb:first-child').click();
$thumbContainer.find('.thumb:first-child').click();
});
/**
... ... @@ -380,27 +384,27 @@ exports.initOther = function() {
mouseWheel: true,
click: true
});
document.addEventListener('touchmove', function (e) {
e.preventDefault();
}, false);
if (!hasAt) {
myScroll.on('scroll', function() {
$('#scroller').trigger('scroll');
});
return;
}
tContainerH = thumbContainer.outerHeight();
containerH = atContainer.height();
containerTop = atContainer.offset().top;
tContainerH = $thumbContainer.outerHeight();
containerH = $atContainer.height();
containerTop = $atContainer.offset().top;
/**
* scroll前重置container状态
*/
function resetStatus() {
fixedThumbContainer.removeClass('fixed-top fixed-bottom absolute hide').css('top', '');
$fixedThumbContainer.removeClass('fixed-top fixed-bottom absolute hide').css('top', '');
}
myScroll.on('scroll', function() {
... ... @@ -409,27 +413,28 @@ exports.initOther = function() {
resetStatus();
if (sTop <= containerTop - winH + tContainerH) {
fixedThumbContainer
$fixedThumbContainer
.addClass('fixed-bottom');
} else if (sTop <= containerTop) {
fixedThumbContainer
$fixedThumbContainer
.addClass('hide');
} else if (sTop <= containerTop + containerH - tContainerH) {
fixedThumbContainer
$fixedThumbContainer
.addClass('fixed-top');
} else if (sTop <= containerTop + containerH) {
fixedThumbContainer
$fixedThumbContainer
.addClass('absolute')
.css({
top: containerTop + containerH - tContainerH - sTop
});
} else if (sTop > containerTop + containerH) {
fixedThumbContainer
$fixedThumbContainer
.addClass('hide');
}
$('#scroller').trigger('scroll');
});
//手动触发scroll, 初始化fixedThumb的位置和显示
myScroll.scrollTo(0, 0, 0.1);
};
... ...
... ... @@ -4,95 +4,80 @@
* @date;2015/3/31
*/
var $ = require('jquery'),
var $ = require('yoho.jquery'),
ellipsis = require('mlellipsis'),
Mustache = require('mustache');
require('lazyload');
lazyLoad = require('yoho.lazyload'),
Mustache = require('yoho.mustache');
/**
* 初始化页面加载时的文字截取和图片懒加载功能
*/
exports.init = function() {
var tpl;
$(function() {
var $tagList = $('#tag-list'),
$loadMore = $('#load-more-info'),
$loadStatus = $loadMore.children('.status'),
$noMore = $loadStatus.filter('.no-more'),
$loading = $loadStatus.filter('.loading'),
$loginTip = $('#login-tip'),
winH = $(window).height(),
loadMoreH = $loadMore.height(),
canScroll = true,
dataEnd = false,
hasAuthor = false,
authorId;
//是否包含作者信息
if ($('#author-infos').length > 0) {
hasAuthor = true;
authorId = $('#author-infos').data('id');
}
authorId,
winW,
tipH,
tipW;
//请求相关数据
var page = 1,
query = $('#query').val(), //无author时
gender = $('#gender').val(),
clientType = $('#client-type').val();
//定位登录提示相关变量
var $loginTip = $('#login-tip'),
winW,
tipH,
tipW;
//是否包含作者信息
if ($('#author-infos').length > 0) {
hasAuthor = true;
authorId = $('#author-infos').data('id');
}
//定位登录提示
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
//读取模板
$.get('/common/tagtpl', function(data) {
tpl = data;
Mustache.parse(tpl);
});
//img-lazyload
function lazyLoad(imgs) {
var $imgs;
if (typeof imgs === 'undefined') {
$imgs = $('img.lazy');
} else {
$imgs = imgs;
}
$imgs.lazyload({
effect : 'fadeIn',
effect_speed: 10,
placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
});
}
lazyLoad();
//相关文章截取文字
ellipsis.init();
$('.tag-text, .tag-title').each(function() {
this.mlellipsis(2);
});
//文章点赞和取消点赞
$('.tag-container').delegate('.like-btn', 'touchstart', function(e) {
var $cur = $(e.currentTarget),
$info = $cur.closest('.tag-content'),
id = $info.data('id'),
url;
$cur.toggleClass('like');
if ($cur.hasClass('like')) {
url = '/guang/info/praise';
} else {
... ... @@ -106,26 +91,28 @@ exports.init = function() {
}
}).then(function(data) {
if (data.code === 200) {
//更新点赞数
$cur.next('span.like-count').text(data.data);
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
});
});
/**
* 加载更多
*/
function loadMore() {
var setting,
hasNum = $tagList.find('.tag-content').length;
if (hasAuthor) {
setting = {
page: ++page,
... ... @@ -140,7 +127,7 @@ exports.init = function() {
client_type: clientType
};
}
canScroll = false;
$.ajax({
type: 'GET',
... ... @@ -151,7 +138,7 @@ exports.init = function() {
res,
infos,
i;
if (data.code === 200) {
res = data.data;
if (res.end) {
... ... @@ -159,15 +146,17 @@ exports.init = function() {
$loading.addClass('hide');
$noMore.removeClass('hide');
}
infos = res.infos;
for (i = 0; i < infos.length; i++) {
html += Mustache.render(tpl, infos[i]);
}
if (html !== '') {
$tagList.append(html);
//lazyload新加载的项
lazyLoad($tagList.find('.tag-content:gt(' + (hasNum - 1) + ') img.lazy'));
//文字截取
$tagList.find('.tag-text, .tag-title').each(function() {
this.mlellipsis(2);
... ... @@ -177,24 +166,27 @@ exports.init = function() {
}
});
}
$(document).on('scroll', function() {
//正在请求数据或者数据请求结束时返回
if (!canScroll || dataEnd) {
return;
return;
}
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
loadMore();
}
});
if ($(document).height() === winH) {
//应对初始加载时数据不满屏不能触发scroll的情况
$(document).one('touchmove', function() {
if (!canScroll || dataEnd) {
return;
}
//显示LoadMore
$loading.removeClass('hide');
loadMore();
... ...
... ... @@ -4,14 +4,13 @@
* @date;2015/4/14
*/
var $ = require('jquery'),
var $ = require('yoho.jquery'),
_ = require('underscore'),
ellipsis = require('mlellipsis'),
Mustache = require('mustache'),
timer = null;
lazyLoad = require('yoho.lazyload'),
Mustache = require('yoho.mustache');
require('./wxshare')();
require('lazyload');
/**
* 页面加载初始化
... ... @@ -24,19 +23,33 @@ exports.init = function() {
$npc = $goodList.filter('.new-patterns-container'),
$svc = $goodList.filter('.sales-volume-container'),
$pc = $goodList.filter('.price-container'),
tpl; //商品信息模板
//load-more
var $loadMore = $('#load-more-info'),
//load-more
$loadMore = $('#load-more-info'),
$loadStatus = $loadMore.children('.status'),
$noMore = $loadStatus.filter('.no-more'),
$loading = $loadStatus.filter('.loading'),
loadMoreH = $loadMore.height();
var isLogin = $('#is-login').val();
isLogin = isLogin ? isLogin : 'N';
//筛选相关变量
var curFilter = {
loadMoreH = $loadMore.height(),
isLogin = $('#is-login').val(),
tpl,//商品信息模板
classification,
winH = $(window).height(),
canLoadAjax = true,
promotionId = $('#promotion').val(),
clientType = $('#client-type').val(),
contentCode = $('#content-code').val(),
$loginTip = $('#login-tip'),
winW,
tipH,
tipW,
//筛选相关变量
curFilter = {
brand: '',
msort: '',
color: '',
... ... @@ -72,50 +85,25 @@ exports.init = function() {
'<span><i class="chosed-icon iconfont">&#xe60a;</i></span>' +
'</li>',
$screen = $('#screen-content, #screen-mask'),
$prevFocusNav = $navItem.filter('.focus'), //初始化为已选项
classification; //分类数据
$prevFocusNav = $navItem.filter('.focus');
isLogin = isLogin ? isLogin : 'N';
//加载更多
var winH = $(window).height(),
canLoadAjax = true; //防止下拉请求次数过多
//
var promotionId = $('#promotion').val(),
clientType = $('#client-type').val(),
contentCode = $('#content-code').val();
//
var $loginTip = $('#login-tip'),
winW,
tipH,
tipW;
//定位登录提示
winH = $(window).height();
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
winW = $(window).width();
tipH = $loginTip.height();
tipW = $loginTip.width();
$loginTip.css({
top: (winH - tipH) / 2,
left: (winW - tipW) / 2
});
//lazyload
function lazyLoad(imgs, options) {
var setting = {
effect : 'fadeIn',
effect_speed: 10,
placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
}, $imgs;
if (typeof imgs === 'undefined') {
$imgs = $('img.lazy');
} else {
$imgs = imgs;
}
if (typeof options !== 'undefined') {
$.extend(setting, options);
}
$imgs.lazyload(setting);
}
lazyLoad();
//ellipsis
ellipsis.init();
$('.reco .name').each(function() {
... ... @@ -141,6 +129,7 @@ exports.init = function() {
function renderArrData(data) {
var i = 0,
html = '';
for (i = 0; i < data.length; i++) {
html += Mustache.render(classifyItemTpl, data[i]);
}
... ... @@ -153,6 +142,7 @@ exports.init = function() {
*/
function getFocusNavType() {
var type;
if ($prevFocusNav.hasClass('sales-volume-nav')) {
type = 'sale';
} else if ($prevFocusNav.hasClass('price-nav')) {
... ... @@ -172,16 +162,16 @@ exports.init = function() {
setting = {},
hadNum = 0,
nav;
nav = navInfo[type];
//重新加载重置start和end
if (nav.reload) {
nav.start = 0;
nav.end = false;
nav.empty = false;
}
//请求数据setting
$.extend(setting, curFilter, {
type: type,
... ... @@ -191,7 +181,7 @@ exports.init = function() {
clientType: clientType,
contentCode: contentCode
});
if (nav.end) {
$loading.addClass('hide');
$noMore.removeClass('hide');
... ... @@ -199,16 +189,17 @@ exports.init = function() {
$loading.removeClass('hide');
$noMore.addClass('hide');
}
if (nav.end && nav.empty) {
$noMore.addClass('hide');
}
if (!nav.reload && nav.end) {
//不需要重新加载并且数据请求结束
return;
}
canLoadAjax = false;
$.ajax({
type: 'GET',
... ... @@ -221,6 +212,7 @@ exports.init = function() {
goods,
len,
i;
if (data.success) {
res = data.data;
goods = res.goods;
... ... @@ -238,8 +230,12 @@ exports.init = function() {
$container = $svc;
break;
}
if (!fromScroll && len === 0) { //由非scroll触发并且返回结果为空的代表未查到数据
if (!fromScroll && len === 0) {
//由非scroll触发并且返回结果为空的代表未查到数据
nav.empty = true;
//无返回数据
html = '<p class="search-tip">未找到相关搜索结果</p>';
} else {
... ... @@ -262,11 +258,14 @@ exports.init = function() {
} else {
lazyLoad($container.find('.good-info:gt(' + (hadNum - 1) + ') img.lazy'));
}
//重置navInfo
if (res.end) {
nav.end = true;
//设置加载更多显示
$loading.addClass('hide');
//若无数据项返回则不显示noMore
if (!fromScroll && len === 0) {
$noMore.addClass('hide');
... ... @@ -276,32 +275,34 @@ exports.init = function() {
}
nav.reload = false;
nav.start++;
//重置可请求标识
canLoadAjax = true;
}
});
}
//读取筛选时的分类信息
$.get('/activity/classification', {
promotionId: promotionId,
clientType: clientType
}, function(data) {
var c;
if (data.success) {
classification = data.data;
for (c in classification) {
if(classification.hasOwnProperty(c)) {
if (classification.hasOwnProperty(c)) {
$('#sub-' + c).html(renderArrData(classification[c]));
}
}
}
});
/**
* 切换排序
* @params $cur 当前选中nav-item
*/
/**
* 切换排序
* @params $cur 当前选中nav-item
*/
function toggleSort($cur) {
var type = getFocusNavType(),
nav = navInfo[type],
... ... @@ -328,6 +329,7 @@ exports.init = function() {
type;
if ($cur.hasClass('screen-nav')) {
//筛选
$screen.toggleClass('hide');
$prevFocusNav.toggleClass('focus');
... ... @@ -371,7 +373,6 @@ exports.init = function() {
navTouchEvt(e);
});
/**
* 筛选分类点击事件句柄
*/
... ... @@ -410,6 +411,7 @@ exports.init = function() {
function doFilter(id, type, name, navName) {
var $shower = $('#show-' + type),
att;
//更新当前过滤项
curFilter[type] = id;
... ... @@ -449,12 +451,14 @@ exports.init = function() {
$('.sub-classify').delegate('li', 'click', function(e) {
subScTouchEvt(e);
//子筛选类点击后关闭筛选框
$navItem.filter('.screen-nav').click(); //触发点击筛选导航的点击事件
});
//加载更多
$(document).scroll(function(e) {
//当scroll到1/3$goodsContainer高度后继续请求
if (canLoadAjax && $(window).scrollTop() + winH >=
$(document).height() - 0.33 * $goodsContainer.height() - loadMoreH) {
... ... @@ -466,17 +470,18 @@ exports.init = function() {
$('#screen-mask').click(function() {
$navItem.filter('.screen-nav').click(); //触发点击筛选导航的点击事件
});
//Like
//Like
$('#goods-content').delegate('.good-islike', 'touchstart', function(e) {
var $cur,
$good,
id;
if (isLogin === 'Y') {
$cur = $(e.currentTarget);
$good = $cur.closest('.good-info');
id = $good.data('id');
$.ajax({
type: 'GET',
url: '/favorite/product',
... ... @@ -487,10 +492,11 @@ exports.init = function() {
if (data.code === 200) {
$cur.toggleClass('good-like');
} else if (data.code === 400) {
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
$('#login-tip').fadeOut(500);
}, 1000);
});
}
... ...
var $ = require('jquery');
var $ = require('yoho.jquery');
/**
* 微信分享
*/
module.exports = function() {
var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage';
$.getJSON(_weChatInterface + "?pageurl=" + encodeURIComponent(location.href.split('#')[0]) + "&callback=?", function (json) {
$.getJSON(_weChatInterface + '?pageurl=' +
encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function (json) {
var _appId, _timestamp, _nonceStr, _signature;
if (json !== undefined && json !== '') {
var _appId = json.appId.toString();
var _timestamp = json.timestamp;
var _nonceStr = json.nonceStr.toString();
var _signature = json.signature.toString();
_appId = json.appId.toString();
_timestamp = json.timestamp;
_nonceStr = json.nonceStr.toString();
_signature = json.signature.toString();
wx.config({
debug: false,
appId: _appId,
... ... @@ -55,7 +60,7 @@ module.exports = function() {
});
}
});
wx.ready(function () {
var shareTitle = $('#shareTitle').val();
var shareImg = $('#shareImg').val();
... ... @@ -65,9 +70,9 @@ module.exports = function() {
title: shareTitle,
desc: shareDesc,
imgUrl: shareImg,
link: shareLink,
link: shareLink
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
wx.onMenuShareQQ(shareData);
... ...
... ... @@ -13,10 +13,11 @@
"spm": {
"main": "index.js",
"dependencies": {
"jquery": "1.8.3",
"lazyload": "1.9.6",
"mustache": "2.0.0",
"yoho-idangerous.swiper": "0.0.3"
"yoho.jquery": "1.8.3",
"yoho.lazyload": "1.0.0",
"yoho.mustache": "2.1.3",
"yoho.iswiper": "3.0.6",
"import-style": "1.0.0"
},
"devDependencies": {
"expect.js": "0.3.1"
... ... @@ -39,7 +40,7 @@
"gulp-ftp": "^1.0.3",
"gulp-util": "^3.0.4",
"hbs": "^3.0.1"
}
},
"scripts": {
"test": "spm test",
"build": "spm build"
... ...
var $ = require('jquery'),
var $ = require('yoho.jquery'),
lazyLoad = require('./common/lazyload'),
Swiper = require('yoho-idangerous.swiper');
Swiper = require('yoho.iswiper');
function initSwiper() {
... ...
... ... @@ -3,9 +3,9 @@
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/6/25
*/
var $ = require('jquery');
var $ = require('yoho.jquery');
require('lazyload');
require('yoho.lazyload');
/**
* 为指定imgs添加lazyload效果,未指定imgs则为所有img.lazy添加lazyload效果
* @params imgs lazyload的图片
... ...
... ... @@ -3,426 +3,679 @@
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/3/30
*/
module.exports = function(flag) {
switch (flag) {
//新品节
case 'newfestival':
return {
back: '',
home: '',
title: '新品节',
slider: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/0240f288725106b408d8c524b4d0fba4b9.jpg'
}, {
url: 'http://sale.yohobuy.com/?specialsale_id=11&gender=1,3',
title: '',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
}],
banner: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
}],
imageList: [{
column_num: 3,
title: "最热推荐",
list: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}]
}, {
column_num: 2,
title: "亮点抢先看",
list: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}]
}],
banner2: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
}],
goods: [{
id: 1,
src: 'http://img11.static.yhbimg.com/goodsimg/2015/03/02/07/01ebfb219e22770ffb0c2c3a2cbb2b4bef.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'GAWS DIGI 丛林数码印花拼接卫衣',
isLike: false,
price: 1268,
salePrice: 589,
tags: [
/*需要显示的放入即可,不需要显示不写*/
{
isNew: true
},
{
isSale: true
},
{
isLimit: true
},
{
isYohood: true
},
return [
{
share :{
id: "1",
title: "新品节欢迎你",
share_title_main: "新品节",
share_title_sub: "哈哈哈和哈哈哈",
share_image: "http://img12.static.yhbimg.com/taobaocms/2015/08/28/10/02076e3caed758a1c18c91a0e9cae3368f.jpg?imageView/{mode}/w/{width}/h/{height}",
share_url: "http://cuxiao.m.yohobuy.com/newfestival/index?act_title=新品节&islogin=Y&share_id=1&client_type=android",
status: "1",
create_time: "1440730186",
update_time: "1440757410"
}
},
{
slider: {
imgs: [
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/' +
'0240f288725106b408d8c524b4d0fba4b9.jpg'
},
{
url: 'http://sale.yohobuy.com/?specialsale_id=11&gender=1,3',
title: '',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/' +
'02934d7696b187d260341d31c084eb93cc.jpg'
}
]
}
},
{
imageList: [
{
isReNew: true
col: 4,
title: '最热推荐4',
list: [
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/' +
'0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail' +
'/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/' +
'023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnai' +
'l/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b' +
'2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314' +
'/extent/235x314/background/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a1' +
'27c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/ex' +
'tent/235x314/background/d2hpdGU=/position/center/quality/90'
}
]
}
],
isFew: true, //单独的即将售罄标志,不显示不写
url: '',
likeUrl: ''
}, {
id: 2,
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/023d70c59e81ccbfb39404487aaf642da2.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'CLOTtee 撞色连帽外套',
isLike: false,
price: 488,
salePrice: 139,
tags: [
{
isNew: true
},
]
},
{
banner: {
imgs: [
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187' +
'd260341d31c084eb93cc.jpg'
}
]
}
},
{
imageList: [
{
isSale: true
col: 3,
title: '最热推荐',
list: [
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f' +
'77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/ba' +
'ckground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688' +
'bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/backgro' +
'und/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d484' +
'17d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x' +
'314/background/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1' +
'f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/' +
'background/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae7868' +
'8bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/back' +
'ground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b' +
'94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/backgroun' +
'd/d2hpdGU=/position/center/quality/90'
}
]
},
{
isYohood: true
col: 2,
title: '亮点抢先看',
list: [
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77' +
'ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/bac' +
'kground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae7868' +
'8bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/bac' +
'kground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e9' +
'2b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/bac' +
'kground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77' +
'ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/bac' +
'kground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae7868' +
'8bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/bac' +
'kground/d2hpdGU=/position/center/quality/90'
},
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e9' +
'2b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/bac' +
'kground/d2hpdGU=/position/center/quality/90'
}
]
}
],
url: '',
likeUrl: ''
}, {
id: 3,
src: 'http://img12.static.yhbimg.com/goodsimg/2015/03/02/08/02e2d44125e95495e3152aa459fa6b9b0c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'HALFGIRL 插肩棒球服短裙套装',
isLike: true,
price: 478,
salePrice: 208,
url: '',
likeUrl: ''
}, {
id: 4,
src: 'http://img12.static.yhbimg.com/goodsimg/2015/03/03/08/022f25fbe177ee12803c522f04fcce06d0.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: '黄伟文Wyman X yohood联名商品YYYOHOOD连帽卫衣',
isLike: false,
salePrice: 148,
url: '',
likeUrl: ''
}]
};
]
},
{
newArrival: {
goods: [
{
id: 1,
src: 'http://img11.static.yhbimg.com/goodsimg/2015/03/02/07/01ebfb219e22770ffb0c2' +
'c3a2cbb2b4bef.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpd' +
'GU=/position/center/quality/90',
name: 'GAWS DIGI 丛林数码印花拼接卫衣',
isLike: false,
price: 1268,
salePrice: 589,
tags: [
/*需要显示的放入即可,不需要显示不写*/
{
isNew: true
},
{
isSale: true
},
{
isLimit: true
},
{
isYohood: true
},
{
isReNew: true
}
],
isFew: true, //单独的即将售罄标志,不显示不写
url: '',
likeUrl: ''
},
{
id: 2,
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/023d70c59e81cc' +
'bfb39404487aaf642da2.jpg?imageMogr2/thumbnail/235x314/extent/235x314/ba' +
'ckground/d2hpdGU=/position/center/quality/90',
name: 'CLOTtee 撞色连帽外套',
isLike: false,
price: 488,
salePrice: 139,
tags: [
{
isNew: true
},
{
isSale: true
},
{
isYohood: true
}
],
url: '',
likeUrl: ''
},
{
id: 3,
src: 'http://img12.static.yhbimg.com/goodsimg/2015/03/02/08/02e2d44125e954' +
'95e3152aa459fa6b9b0c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/ba' +
'ckground/d2hpdGU=/position/center/quality/90',
name: 'HALFGIRL 插肩棒球服短裙套装',
isLike: true,
price: 478,
salePrice: 208,
url: '',
likeUrl: ''
},
{
id: 4,
src: 'http://img12.static.yhbimg.com/goodsimg/2015/03/03/08/022f25fbe177ee' +
'12803c522f04fcce06d0.jpg?imageMogr2/thumbnail/235x314/extent/235x314/ba' +
'ckground/d2hpdGU=/position/center/quality/90',
name: '黄伟文Wyman X yohood联名商品YYYOHOOD连帽卫衣',
isLike: false,
salePrice: 148,
url: '',
likeUrl: ''
}
]
}
},
{
banner: {
imgs: [
{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d2' +
'60341d31c084eb93cc.jpg'
}
]
}
}
];
case 'newfestivalbrands':
return {
brandsHeader: [{
id: 'b1',
title: '欧美潮牌',
defaultClass: 'hasunderline',
}, {
id: 'b2',
title: '国潮原创',
defaultClass: ''
}, {
id: 'b3',
title: '日韩潮牌',
defaultClass: ''
}],
todayBrands: [{
parentId: 'b1',
displayClass: 'show',
todayPic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}],
tomorrowPic: {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌1'
brandsHeader: [
{
id: 'b1',
title: '欧美潮牌',
defaultClass: 'hasunderline'
},
{
id: 'b2',
title: '国潮原创',
defaultClass: ''
},
{
id: 'b3',
title: '日韩潮牌',
defaultClass: ''
}
}, {
parentId: 'b2',
displayClass: 'hide',
todayPic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}],
tomorrowPic: {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌2'
],
todayBrands: [
{
parentId: 'b1',
displayClass: 'show',
todayPic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc' +
'3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc' +
'3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}
],
tomorrowPic: {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cb' +
'c3007d8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌1'
}
},
{
parentId: 'b2',
displayClass: 'hide',
todayPic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3' +
'cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3c' +
'bc3007d8093af.jpg?imageView/2/w/640/h/640'
}
],
tomorrowPic: {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3' +
'cbc3007d8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌2'
}
},
{
parentId: 'b3',
displayClass: 'hide',
todayPic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc' +
'3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc' +
'3007d8093af.jpg?imageView/2/w/640/h/640'
}
],
tomorrowPic: {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007' +
'd8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌3'
}
}
}, {
parentId: 'b3',
displayClass: 'hide',
todayPic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
],
singleBrands: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}],
tomorrowPic: {
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d' +
'8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌3'
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d' +
'8093af.jpg?imageView/2/w/640/h/640'
}
}],
singleBrands: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}],
],
singleTomorrowPic: {
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d' +
'8093af.jpg?imageView/2/w/640/h/640',
text: '明日推荐品牌3'
},
todayBtn: {
link: ''
},
brandsContent: [{
parentId: 'b1',
displayClass: 'show',
brandsList: [{
brandsId: '1',
pic: [{
hasWords: {
words: '太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真'
brandsContent: [
{
parentId: 'b1',
displayClass: 'show',
brandsList: [
{
brandsId: '1',
pic: [
{
hasWords: {
words: '太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真' +
'太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真太傻太天真'
},
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f' +
'3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
hasWords: {
words: '很好很强大很好很强大很好很强大很好很强大很好很强大很好很强大很好很强大'
},
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db84' +
'88edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
},
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
hasWords: {
words: '很好很强大很好很强大很好很强大很好很强大很好很强大很好很强大很好很强大'
{
brandsId: '2',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe' +
'3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8' +
'488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
},
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsId: '2',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsId: '3',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}]
}, {
parentId: 'b2',
displayClass: 'hide',
brandsList: [{
brandsId: '1',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsId: '2',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsId: '3',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}]
}, {
parentId: 'b3',
displayClass: 'hide',
brandsList: [{
brandsId: '1',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsId: '2',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsId: '3',
pic: [{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}]
}]
}],
brandsLogoList: [{
brandsLogoRow: [{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}]
}, {
brandsLogoRow: [{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}, {
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}]
}]
{
brandsId: '3',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe' +
'3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33d' +
'b8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
}
]
},
{
parentId: 'b2',
displayClass: 'hide',
brandsList: [
{
brandsId: '1',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3' +
'e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db848' +
'8edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
},
{
brandsId: '2',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe' +
'3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33d' +
'b8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
},
{
brandsId: '3',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3' +
'e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8' +
'488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
}
]
},
{
parentId: 'b3',
displayClass: 'hide',
brandsList: [
{
brandsId: '1',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3' +
'f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db848' +
'8edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
},
{
brandsId: '2',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f' +
'3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db848' +
'8edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
},
{
brandsId: '3',
pic: [
{
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe' +
'3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
url: '',
img: 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db84' +
'88edc741241950a596a8.jpg?imageView/2/w/640/h/640'
}
]
}
]
}
],
brandsLogoList: [
{
brandsLogoRow: [
{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}
]
},
{
brandsLogoRow: [
{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logogrey',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
},
{
showClass: 'logoblack',
url: '',
img: 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2f' +
'e3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
}
]
}
]
};
}
};
\ No newline at end of file
... ...
var $ = require('jquery'),
var $ = require('yoho.jquery'),
lazyLoad = require('./common/lazyload'),
Swiper = require('yoho-idangerous.swiper'),
Mustache = require('mustache');
Swiper = require('yoho.iswiper'),
Mustache = require('yoho.mustache');
new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
... ... @@ -9,6 +9,8 @@ new Swiper('.swiper-container', {
autoplay: 3000
});
require('./wxshare')();
/**
* 初始化页面功能
*/
... ... @@ -52,53 +54,12 @@ exports.init = function (url) {
//var $goodList = $newArrival.children('.goods-list'),
var mblTop = $newArrival.offset().top; //页面内容固定,可以预先求出高度
tpl = ["<div class=\"good-info\" data-id=\"{{id}}\">",
" <div class=\"tag-container clearfix\">",
" {{# tags}}",
" {{# isNew}}",
" <p class=\"good-tag new-tag\">NEW</p>",
" {{/ isNew}}",
" {{# isReNew}}",
" <p class=\"good-tag renew-tag\">再到着</p>",
" {{/ isReNew}}",
" {{# isSale}}",
" <p class=\"good-tag sale-tag\">SALE</p>",
" {{/ isSale}}",
" {{# isYohood}}",
" <div class=\"good-tag yohood-tag\"></div>",
" {{/ isYohood}}",
" {{# isLimit}}",
" <p class=\"good-tag limit-tag\">限量商品</p>",
" {{/ isLimit}}",
" {{/ tags}}",
" </div>",
" <div class=\"good-detail-img\">",
" <a class=\"good-thumb\" href=\"{{url}}\">",
" <img class=\"lazy\" data-original=\"{{src}}\">",
" </a>",
" {{# isFew}}",
" <p class=\"few-tag\">即将售罄</p>",
" {{/ isFew}}",
" </div>",
" <div class=\"good-detail-text\">",
" <div class=\"name\">",
" <a href=\"{{url}}\">{{name}}</a>",
" </div>",
" <div class=\"price\">",
" <span class=\"sale-price {{^price}}no-price{{/price}}\">¥{{salePrice}}</span>",
" {{#price}}",
" <span class=\"market-price\">¥{{.}}</span>",
" {{/price}}",
" </div>",
" </div>",
"</div>"].join("");
tpl = '{{# goods}}' + tpl + '{{/ goods}}';
//read good-info template
/*$.get('/common/goodinfo', function (data) {
tpl = '{{# goods}}' + data + '{{/ goods}}';
Mustache.parse(tpl);
});*/
Mustache.parse(tpl);
$.get('/cuxiao/newfestival/goodinfo', function (data) {
tpl = '{{# goods}}' + data + '{{/ goods}}';
Mustache.parse(tpl);
});
//Mustache.parse(tpl);
//srcoll to load more
$(window).scroll(function () {
... ... @@ -142,5 +103,6 @@ exports.init = function (url) {
}
});
});
};
... ...
var $ = require('yoho.jquery');
/**
* 微信分享
*/
module.exports = function() {
var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage';
$.getJSON(_weChatInterface + '?pageurl=' +
encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function (json) {
var _appId, _timestamp, _nonceStr, _signature;
if (json !== undefined && json !== '') {
_appId = json.appId.toString();
_timestamp = json.timestamp;
_nonceStr = json.nonceStr.toString();
_signature = json.signature.toString();
wx.config({
debug: false,
appId: _appId,
timestamp: _timestamp,
nonceStr: _nonceStr,
signature: _signature,
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'hideMenuItems',
'showMenuItems',
'hideAllNonBaseMenuItem',
'showAllNonBaseMenuItem',
'translateVoice',
'startRecord',
'stopRecord',
'onRecordEnd',
'playVoice',
'pauseVoice',
'stopVoice',
'uploadVoice',
'downloadVoice',
'chooseImage',
'previewImage',
'uploadImage',
'downloadImage',
'getNetworkType',
'openLocation',
'getLocation',
'hideOptionMenu',
'showOptionMenu',
'closeWindow',
'scanQRCode',
'chooseWXPay',
'openProductSpecificView',
'addCard',
'chooseCard',
'openCard'
]
});
}
});
wx.ready(function () {
var shareTitle = $('#shareTitle').val();
var shareImg = $('#shareImg').val();
var shareDesc = $('#shareDesc').val();
var shareLink = $('#shareLink').val();
var shareData = {
title: shareTitle,
desc: shareDesc,
imgUrl: shareImg,
link: shareLink
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
wx.onMenuShareQQ(shareData);
wx.onMenuShareWeibo(shareData);
});
};
\ No newline at end of file
... ...
... ... @@ -84,11 +84,17 @@ a {
}
.swiper-container {
width: 100%;
height: 360rem / $pxConvertRem;
img {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}
.swiper-slide {
width: 100%;
display: block;
overflow: hidden;
}
.swiper-pagination {
... ... @@ -111,4 +117,9 @@ a {
opacity: 1;
background: #fff;
}
.swiper-pagination-bullet-active{
opacity: 1;
background: #fff;
}
}
... ...
/**
* Swiper 3.0.8
* Most modern mobile touch slider and framework with hardware accelerated transitions
*
* http://www.idangero.us/swiper/
*
* Copyright 2015, Vladimir Kharlampidi
* The iDangero.us
* http://www.idangero.us/
*
* Licensed under MIT
*
* Released on: July 6, 2015
*/
.swiper-container{margin:0 auto;position:relative;overflow:hidden;z-index:1}.swiper-container-no-flexbox .swiper-slide{float:left}.swiper-container-vertical>.swiper-wrapper{-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate(0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.swiper-container-multirow>.swiper-wrapper{-webkit-box-lines:multiple;-moz-box-lines:multiple;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;-moz-transition-timing-function:ease-out;-ms-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-slide{-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;width:100%;height:100%;position:relative}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-wp8-horizontal{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-wp8-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:27px;height:44px;margin-top:-22px;z-index:10;cursor:pointer;-moz-background-size:27px 44px;-webkit-background-size:27px 44px;background-size:27px 44px;background-position:center;background-repeat:no-repeat}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");left:10px;right:auto}.swiper-button-prev.swiper-button-black,.swiper-container-rtl .swiper-button-next.swiper-button-black{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E")}.swiper-button-prev.swiper-button-white,.swiper-container-rtl .swiper-button-next.swiper-button-white{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E")}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");right:10px;left:auto}.swiper-button-next.swiper-button-black,.swiper-container-rtl .swiper-button-prev.swiper-button-black{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E")}.swiper-button-next.swiper-button-white,.swiper-container-rtl .swiper-button-prev.swiper-button-white{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E")}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:300ms;-moz-transition:300ms;-o-transition:300ms;transition:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:.2}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-white .swiper-pagination-bullet{background:#fff}.swiper-pagination-bullet-active{opacity:1;background:#007aff}.swiper-pagination-white .swiper-pagination-bullet-active{background:#fff}.swiper-pagination-black .swiper-pagination-bullet-active{background:#000}.swiper-container-vertical>.swiper-pagination{right:10px;top:50%;-webkit-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-o-transform:translate(0,-50%);-ms-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.swiper-container-vertical>.swiper-pagination .swiper-pagination-bullet{margin:5px 0;display:block}.swiper-container-horizontal>.swiper-pagination{bottom:10px;left:0;width:100%}.swiper-container-horizontal>.swiper-pagination .swiper-pagination-bullet{margin:0 5px}.swiper-container-3d{-webkit-perspective:1200px;-moz-perspective:1200px;-o-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-cube-shadow,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-wrapper{-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear,right top,left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear,left bottom,left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-moz-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-coverflow .swiper-wrapper{-ms-perspective:1200px}.swiper-container-fade.swiper-container-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;-moz-transition-timing-function:ease-out;-ms-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube{overflow:visible}.swiper-container-cube .swiper-slide{pointer-events:none;visibility:hidden;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;width:100%;height:100%}.swiper-container-cube.swiper-container-rtl .swiper-slide{-webkit-transform-origin:100% 0;-moz-transform-origin:100% 0;-ms-transform-origin:100% 0;transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-next+.swiper-slide,.swiper-container-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0;width:100%;height:100%;background:#000;opacity:.6;-webkit-filter:blur(50px);filter:blur(50px)}.swiper-container-cube.swiper-container-vertical .swiper-cube-shadow{z-index:0}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0,0,0,.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0,0,0,.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;-moz-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12,end) infinite;-moz-animation:swiper-preloader-spin 1s steps(12,end) infinite;animation:swiper-preloader-spin 1s steps(12,end) infinite}.swiper-lazy-preloader:after{display:block;content:"";width:100%;height:100%;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");background-position:50%;-webkit-background-size:100%;background-size:100%;background-repeat:no-repeat}.swiper-lazy-preloader-white:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{transform:rotate(360deg)}}
\ No newline at end of file
@import "common/common","common/grid","common/swiper", "newfestival/newfestivalbrand", "error/error", "newfestival/newfestival";
@import "common/common","common/grid", "newfestival/newfestivalbrand", "error/error", "newfestival/newfestival";
//恢复样式覆盖
b {
... ...
@import "../common/good-info", "../common/yoho-header";
.newfestival-container {
.newfestival-block {
margin-bottom: 30rem / $pxConvertRem;
background-color: #fff;
.newfestival-block {
margin-bottom: 30rem / $pxConvertRem;
background-color: #fff;
}
&:last-child {
margin-bottom: 0;
}
}
.img-container {
width: 100%;
display: block;
.img {
width: 100%;
height: 100%;
.img-container {
width: 100%;
display: block;
.img {
width: 100%;
height: 100%;
}
}
}
.new-arrival {
padding-left: 0 30rem / $pxConvertRem;
.new-arrival {
padding-left: 0 30rem / $pxConvertRem;
.new-arrival-header {
text-align: center;
height: 70rem / $pxConvertRem;
.header-text {
font-size: 28rem / $pxConvertRem;
color: #9e9e9e;
line-height: 250%;
}
}
.new-arrival-header {
text-align: center;
height: 70rem / $pxConvertRem;
.header-text {
font-size: 28rem / $pxConvertRem;
color: #9e9e9e;
line-height: 250%;
}
}
.new-arrival-content {
border-top: 1px solid #e0e0e0;
padding: 20rem / $pxConvertRem 14rem / $pxConvertRem;
.new-arrival-content {
border-top: 1px solid #e0e0e0;
padding: 20rem / $pxConvertRem 14rem / $pxConvertRem;
}
}
}
.img-list {
padding-left: 0 30rem / $pxConvertRem;
.img-list {
padding-left: 0 30rem / $pxConvertRem;
.new-arrival-header {
text-align: center;
height: 70rem / $pxConvertRem;
.header-text {
font-size: 28rem / $pxConvertRem;
color: #9e9e9e;
line-height: 250%;
}
.new-arrival-header {
text-align: center;
height: 70rem / $pxConvertRem;
.header-text {
font-size: 28rem / $pxConvertRem;
color: #9e9e9e;
line-height: 250%;
}
}
}
}
.newfestival-recom-3 {
.newfestival-recom-item {
position: relative;
box-sizing: border-box;
float: left;
width: 213.3rem / $pxConvertRem;
height: 213.3rem / $pxConvertRem;
overflow: hidden;
.img-wrapper {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: block;
width: 213.3rem / $pxConvertRem;
height: 213.3rem / $pxConvertRem;
img {
width: 213.3rem / $pxConvertRem;
height: 213.3rem / $pxConvertRem;
max-width: 100%;
max-height: 100%;
position: relative;
box-sizing: border-box;
float: left;
overflow: hidden;
.img-wrapper {
top: 0;
left: 0;
z-index: 0;
width: 100%;
display: block;
img {
width: 100%;
max-height: 100%;
}
}
}
}
}
.newfestival-recom-2 {
.newfestival-recom-4 .newfestival-recom-item {
width: 160rem / $pxConvertRem;
}
.newfestival-recom-3 .newfestival-recom-item {
width: 213.333333333rem / $pxConvertRem;
}
.newfestival-recom-item {
position: relative;
box-sizing: border-box;
float: left;
width: 320rem / $pxConvertRem;
height: 320rem / $pxConvertRem;
overflow: hidden;
.img-wrapper {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: block;
.newfestival-recom-2 .newfestival-recom-item {
width: 320rem / $pxConvertRem;
height: 320rem / $pxConvertRem;
img {
width: 320rem / $pxConvertRem;
height: 320rem / $pxConvertRem;
max-width: 100%;
max-height: 100%;
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -15,6 +15,7 @@ module.exports = function(app) {
app.get('/newfestival/brand', newfestival.brand);
app.get('/newfestival/todaybrand', newfestival.todaybrand);
app.get('/newfestival/singlebrand', newfestival.singlebrand);
app.get('/common/goodinfo', goods.goodTpl); //商品信息模板
//app.get('/common/goodinfo', goods.goodTpl); //商品信息模板
app.get('/cuxiao/newfestival/goodinfo', goods.goodTpl); //商品信息模板
app.get('/goods/more', goods.more); //下拉加载更多
};
\ No newline at end of file
... ...
<div class="newfestival-container">
{{# data}}
{{> newfestival/newfestival_home_slider}}
<div class="newfestival-block">
{{# slider}}
{{> newfestival/newfestival_home_slider}}
{{/ slider}}
{{# banner}}
{{> newfestival/newfestival_home_banner}}
<div class="newfestival-block">
{{# imgs}}
{{> newfestival/newfestival_home_banner}}
{{/ imgs}}
</div>
{{/ banner}}
</div>
{{# imageList}}
{{> newfestival/newfestival_home_imglist}}
{{/ imageList}}
{{# imageList}}
{{> newfestival/newfestival_home_imglist}}
{{/ imageList}}
{{# newArrival}}
{{> newfestival/newfestival_home_newarrival}}
{{/ newArrival}}
<div class="newfestival-block">
{{# banner2}}
{{> newfestival/newfestival_home_banner}}
{{/ banner2}}
</div>
{{# share}}
<input id="shareLink" type="hidden" value="{{share_url}}">
<input id="shareDesc" type="hidden" value="{{share_title_sub}}">
<input id="shareImg" type="hidden" value="{{share_image}}">
<input id="shareTitle" type="hidden" value="{{share_title_main}}">
{{/ share}}
{{> newfestival/newfestival_home_newarrival}}
{{/ data}}
</div>
\ No newline at end of file
... ...
<div class="img-list newfestival-block newfestival-recom-{{column_num}} clearfix">
<div class="img-list newfestival-block newfestival-recom-{{col}} clearfix">
{{# title}}
<div class="new-arrival-header">
<span class="header-text"> {{.}}</span>
... ... @@ -6,9 +6,9 @@
{{/ title}}
{{# list}}
<div class="newfestival-recom-item clearfix">
<div class="newfestival-recom-item">
<a href="{{url}}" class="img-wrapper">
<img class="lazy" data-original="{{src}}" alt="">
<img class="lazy" data-original="{{src}}" alt="" style="display:block">
</a>
</div>
{{/ list}}
... ...
<div class="swiper-container newfestival-block">
<div class="swiper-wrapper">
{{# slider}}
{{# imgs}}
<div class="swiper-slide">
<a href="{{url}}">
<img src="{{src}}" alt="">
</a>
</div>
{{/ slider}}
{{/ imgs}}
</div>
<div class="swiper-pagination"></div>
</div>
\ No newline at end of file
... ...
... ... @@ -12,9 +12,9 @@
"spm": {
"main": "index.js",
"dependencies": {
"jquery": "1.8.3",
"lazyload": "1.9.6",
"mustache": "2.0.0",
"yoho.jquery": "1.8.3",
"yoho.lazyload": "1.0.0",
"yoho.mustache": "2.1.3",
"yoho.iswiper": "3.0.6",
"import-style": "1.0.0"
},
... ...
... ... @@ -3,9 +3,9 @@
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/6/25
*/
var $ = require('jquery');
var $ = require('yoho.jquery');
require('lazyload');
require('yoho.lazyload');
/**
* 为指定imgs添加lazyload效果,未指定imgs则为所有img.lazy添加lazyload效果
* @params imgs lazyload的图片
... ...
var $ = require('jquery'),
var $ = require('yoho.jquery'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('./common/lazyload');
var bannerSwiper = new Swiper('.header-banner', {
loop: true,
autoplay: 3000
autoplay: 3000,
onSlideChangeStart: function() {
lazyLoad($('.header-banner').find('img.lazy'));
}
});
$('.goods-nav').find('.nav-item').eq(0).addClass('focus');
... ...