Authored by xuqi

Merge branch 'release/saunter-home' into develop

Conflicts:
	libs/package.json
... ... @@ -21,7 +21,8 @@
"iscroll": "5.1.2",
"underscore": "1.6.0",
"import-style": "1.0.0",
"yoho.jgestures": "0.9.2"
"yoho.jgestures": "0.9.2",
"yoho.pjax": "1.0.0"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
... ... @@ -15,6 +15,7 @@ fonts_dir = "public/fonts"
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
# sourcemap = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
... ...
{
"name": "guang",
"version": "1.2.3",
"version": "1.3.0",
"description": "yohobuy-mobile saunter src",
"keywords": [],
"homepage": "",
... ... @@ -19,7 +19,9 @@
"yoho.lazyload": "1.0.0",
"mlellipsis": "0.0.6",
"iscroll": "5.1.2",
"underscore": "1.6.0"
"underscore": "1.6.0",
"import-style": "1.0.0",
"yoho.pjax": "1.0.0"
},
"devDependencies": {
"expect.js": "0.3.1"
... ... @@ -53,4 +55,4 @@
"gulp-util": "^3.0.4",
"hbs": "^3.0.1"
}
}
}
\ No newline at end of file
... ...
... ... @@ -293,6 +293,9 @@ module.exports = function(flag) {
};
case 'saunterHome':
return {
query: '卫衣',
gender: '1',
client_type: '',
back: '',
home: '',
title: '逛',
... ... @@ -309,11 +312,13 @@ module.exports = function(flag) {
navs: [
{
typeId: 1,
type: '最新'
type: '最新',
url: '/guang/pjax'
},
{
typeId: 2,
type: '话题'
type: '话题',
focus: true
},
{
typeId: 3,
... ...
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload'),
Mlellipsis = require('mlellipsis'),
Mustache = require('yoho.mustache'),
Mlellipsis = require('mlellipsis'),
Swiper = require('yoho.iswiper');
var $nav = $('#saunter-nav'),
... ... @@ -10,133 +10,81 @@ var $nav = $('#saunter-nav'),
$noMore = $loadMore.children('.no-more'),
$loading = $loadMore.children('.loading'),
loadH = $loadMore.height(),
cached = {},
reloadFirst = false, //重新加载首页数据标志
end = false,
page = 1,
loading = false, //正在ajax标志
winH = $(window).height(),
query = $('#query').val(), //无author时
gender = $('#gender').val(),
clientType = $('#client-type').val(),
udid = $('#client-ip').val(),
tpl,
swiper;
require('./wxshare')();
//判断是否微信内置浏览器
function isWeixin() {
var ua = navigator.userAgent.toLowerCase();
var mm = ua.match(/MicroMessenger/i);
//初始化focus
$('.saunter-nav > li:first-child').addClass('focus');
if (mm && mm.toString() === 'micromessenger') {
return true;
} else {
return false;
}
}
//初始化cached
$('.saunter-nav li').each(function() {
var $el = $(this),
page = $el.index() === 0 ? 1 : 0;
//微信浏览器隐藏头部显示
if (isWeixin()) {
$('.yoho-header').addClass('hide');
}
cached[$el.data('type')] = {
page: page,
end: false,
msgs: []
};
});
require('./wxshare')();
require('yoho.pjax');
Mlellipsis.init();
//init banner swiper
swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination'
pagination: '.swiper-pagination',
lazyLoading: true,
lazyLoadingInPrevNext: true,
autoplayDisableOnInteraction: false
});
lazyLoad();
//相关文章截取文字
Mlellipsis.init();
$('.tag-title').each(function() {
this.mlellipsis(2);
});
$('.tag-text').each(function() {
this.mlellipsis(3);
});
//读取模板
$.get('/common/tagtpl', function(data) {
tpl = data;
Mustache.parse(tpl);
});
/**
* 生成资讯HTML
* @param data Array 渲染数据
* @return html String 返回的HTML
*/
function getMsgHtml(msgs) {
var html = '',
i;
for (i = 0; i < msgs.length; i++) {
html += Mustache.render(tpl, msgs[i]);
}
return html;
function mleTxt() {
$('.tag-title, .tag-text').each(function() {
this.mlellipsis(2);
});
}
$nav.delegate('li', 'click', function() {
var $el = $(this),
type = $el.data('type');
if ($el.hasClass('foucs')) {
return;
}
$nav.find('li.focus').removeClass('focus');
$el.addClass('focus');
if (cached[type].msgs.length > 0 && ($el.index() !== 0 || reloadFirst)) {
$msgList.html(getMsgHtml(cached[type].msgs));
lazyLoad($msgList.find('img.lazy'));
return;
}
$.ajax({
type: 'GET',
url: '/tags/get',
data: {
trype: type,
page: 1
}
}).then(function(data) {
var res;
if (data.code === 200) {
res = data.data.infos;
$msgList.html(getMsgHtml(res));
//
if ($el.index() === 0) {
setTimeout(function() {
mleTxt();
}, 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'));
}
});
//读取模板
$.get('/common/tagtpl', function (data) {
tpl = '{{#msgs}}' + data + '{{/msgs}}';
Mustache.parse(tpl);
});
//下拉加载数据
function loadMore() {
var $focusNav = $nav.find('li.focus'),
type = $focusNav.data('type'),
num;
num = $msgList.find('.tag-content').length;
if (loading || cached[type].end || $(window).scrollTop() + winH < $(document).height() - loadH) {
//-30,for chrome计算差
if (loading || end || $(window).scrollTop() + winH < $(document).height() - loadH - 30) {
return;
}
if ($focusNav.index() !== 0 || reloadFirst) {
num = cached[type].msgs.length;
} else {
num = $msgList.children('.tag-content').length;
}
loading = true;
$loading.removeClass('hide');
$noMore.addClass('hide');
... ... @@ -144,40 +92,37 @@ function loadMore() {
type: 'GET',
url: '/tags/get',
data: {
type: type,
page: cached[type].page + 1
max_sort_id: type,
page: page + 1,
query: query,
gender: gender,
client_type: clientType
}
}).then(function(data) {
}).then(function (data) {
var res, msgs, html,
$newContent;
if (data.code === 200) {
res = data.data;
if (res.end) {
cached[type].end = true;
end = true;
$loading.addClass('hide');
$noMore.removeClass('hide');
}
msgs = res.infos;
html = getMsgHtml(msgs);
html = Mustache.render(tpl, {
msgs: msgs
});
$msgList.append(html);
//update cache
cached[type].msgs = cached[type].msgs.concat(msgs);
cached[type].page++;
page++;
//lazyload & mlellipsis
if (num === 0) {
$newContent = $msgList.children('.tag-content');
} else {
$newContent = $msgList.children('.tag-content:gt(' + (num - 1) + ')');
}
//lazyload & mlellipsis the items appended
$newContent = $msgList.children('.tag-content:gt(' + (num - 1) + ')');
lazyLoad($newContent.find('img.lazy'));
$newContent.find('.tag-title').each(function() {
$newContent.find('.tag-title, .tag-text').each(function() {
this.mlellipsis(2);
}).end().find('.tag-text').each(function() {
this.mlellipsis(3);
});
}
loading = false;
... ... @@ -187,38 +132,52 @@ function loadMore() {
$(window).scroll(loadMore);
//资讯点赞和取消点赞
$('.msg-list').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 {
url = '/guang/info/cancelpraise';
}
$.ajax({
type: 'GET',
url: url,
data: {
id: id
function bindPriseTap() {
$('.msg-list').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 {
url = '/guang/info/cancelpraise';
}
}).then(function(data) {
if (data.code === 200) {
$.ajax({
type: 'GET',
url: url,
data: {
id: id,
udid: udid
}
}).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);
}, 1000);
});
}
});
});
}
//更新点赞数
$cur.next('span.like-count').text(data.data);
} else if (data.code === 400) {
bindPriseTap();
//提示登录信息
$('#login-tip').fadeIn(500, function() {
setTimeout(function() {
$('#login-tip').fadeOut(500);
}, 1000);
});
}
});
});
\ No newline at end of file
//pjax
// $(document).pjax('.pjax-link', '#pjax-container');
// $(document).on('pjax:end', function() {
// lazyLoad();
// mleTxt();
// //重新绑定prise
// bindPriseTap();
// });
\ No newline at end of file
... ...
/**
* 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
... ... @@ -89,6 +89,7 @@
color: #000;
font-size: 40rem / $pxConvertRem;
font-weight:bold;
}
.tag-text {
... ...
@import "../common/yoho-header", "../common/swiper", "../common/tag-content", "../common/load-more";
@import "../common/yoho-header", "../common/tag-content", "../common/load-more";
.swiper-container {
width: 100%;
... ... @@ -15,18 +15,7 @@
width: 100%;
}
.swiper-pagination-switch {
margin: 0 5px;
width: 8px;
height: 8px;
display: inline-block;
border-radius: 100%;
background: #000;
opacity: .6;
}
.swiper-active-switch {
opacity: 1;
.swiper-pagination-bullet-active {
background: #fff;
}
}
... ... @@ -44,9 +33,13 @@
padding: 0 22rem / $pxConvertRem;
line-height: 80rem / $pxConvertRem;
&.focus {
&.focus a {
color: #000;
}
a {
color: #ccc;
}
}
.msg-list .tag-content:first-child {
... ...
... ... @@ -41,4 +41,8 @@ module.exports = function(app) {
//3.0.3
//逛首页
app.get('/guang/home', saunter.home);
//逛首页PJAX模拟
app.get('/guang/pjax', function(req, res) {
res.send('Hello,I am the pjax page');
});
};
\ No newline at end of file
... ...
... ... @@ -5,23 +5,32 @@
{{# swiper}}
<div class="swiper-slide">
<a href="{{url}}">
<img src="{{img}}">
<img class="swiper-lazy" data-src="{{img}}">
</a>
<div class="swiper-lazy-preloader"></div>
</div>
{{/ swiper}}
</div>
<div class="swiper-pagination"></div>
</div>
<ul id="saunter-nav" class="saunter-nav clearfix">
{{# navs}}
<li class="saunter-nav-item" data-type={{typeId}}>{{type}}</li>
{{/ navs}}
</ul>
<div id="msg-list" class="msg-list">
{{# msgs}}
{{> common/tag_content}}
{{/ msgs}}
<div id="pjax-container">
<ul id="saunter-nav" class="saunter-nav clearfix">
{{# navs}}
<li class="saunter-nav-item {{#focus}}focus{{/focus}}" data-type={{typeId}}>
<a class="pjax-link" href="{{url}}">{{type}}</a>
</li>
{{/ navs}}
</ul>
<div id="msg-list" class="msg-list">
{{# msgs}}
{{> common/tag_content}}
{{/ msgs}}
</div>
</div>
{{> common/load_more}}
<input id="query" type="hidden" value="{{query}}">
<input id="gender" type="hidden" value="{{gender}}">
<input id="client-type" type="hidden" value="{{client_type}}">
<input id="client-ip" type="hidden" value="{{udid}}">
{{/ data}}
\ No newline at end of file
... ...
... ... @@ -5,7 +5,6 @@
base: 'http://localhost:8000/'
})
</script>
<script src="http://localhost:8000/public/dist/libs-dev.js"></script>
{{! 根据标识字段添加模块对应JS入口文件}}
{{# isSaunter}}
{{> footer_js/saunter}}
... ...