Authored by ccbikai(👎🏻🍜)

Merge branch 'grey'

... ... @@ -104,9 +104,10 @@ const getResources = (params, options) => {
}
list = {
id: res.template_id,
title: res.data.title,
more_url: res.data.more_url,
more_name: res.data.more_name,
moreUrl: res.data.more_url,
moreName: res.data.more_name,
image: res.data.image
};
... ... @@ -115,8 +116,8 @@ const getResources = (params, options) => {
case 'titleFloor':
list = {
name: res.data.title.name,
more_url: res.data.title.more_url,
more_name: res.data.title.more_name
moreUrl: res.data.title.more_url,
moreName: res.data.title.more_name
};
if (res.data.title.name === '热门商品') {
... ...
... ... @@ -45,7 +45,7 @@
<div class="focus-left-right">
{{#each result.focus2.data}}
<a href="{{url}}" title="{{title}}">
<img class="lazy" data-original="{{image src 250 250}}">
<img src="{{image src 250 250}}">
</a>
{{/each}}
</div>
... ...
{
"name": "m-yohobuy-node",
"version": "5.0.11",
"version": "5.0.12",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
Swiper = require('yoho-swiper'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho-jquery-lazyload');
loading = require('../plugin/loading');
var plusstar = {},
$footer = $('#yoho-footer');
require('yoho-jquery-lazyload');
require('../common');
plusstar = {
... ... @@ -82,16 +82,8 @@ plusstar = {
that.resInit();
loading.hideLoadingMask();
lazyLoad($('img.lazy'));
// 处理左右滑动,未加载的图片
setTimeout(function() {
$('img.lazy').each(function() {
if ($(this).attr('src') !== $(this).data('original')) {
$(this).attr('src', $(this).data('original'));
}
});
}, 40);
$('.plusstar-resources').find('img.lazy').lazyload();
// 设置滚动条的位置
if (window.localStorage) {
... ...
... ... @@ -169,36 +169,42 @@ $search.on('touchend', function() {
history,
historys, i, num = 1;
if (localStorage) {
historys = localStorage.getItem(historyval);
try {
if (localStorage) {
historys = localStorage.getItem(historyval);
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = historys.length; i > 0; i--) {
history = historys[i - 1];
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = historys.length; i > 0; i--) {
history = historys[i - 1];
if (history === '') {
continue;
}
if (history === '') {
continue;
}
if (num++ > 10) {
break;
if (num++ > 10) {
break;
}
html += '<li><a href="javascript:void(0);">' + history + '</li>';
}
html += '<li><a href="javascript:void(0);">' + history + '</li>';
}
$history.html(html);
$history.html(html);
if (html !== '') {
$clearHistory.removeClass('hide');
$historySearch.removeClass('hide');
}
if (html !== '') {
$clearHistory.removeClass('hide');
$historySearch.removeClass('hide');
window.rePosFooter();
} else {
$historySearch.hide();
$clearHistory.hide();
}
window.rePosFooter();
} else {
$historySearch.hide();
$clearHistory.hide();
}
} catch (e) {
console.log(e);
$historySearch.hide();
$clearHistory.hide();
}
}());
... ...
... ... @@ -20,17 +20,21 @@ function getHistoryval() {
function setHistoryValFun(query) {
var historys;
if (localStorage) {
historys = localStorage.getItem(historyval);
try {
if (localStorage) {
historys = localStorage.getItem(historyval);
historys = historys ? historys.replace(new RegExp((query + ranToken), 'g'), '') : '';
historys = historys ? historys.replace(new RegExp((query + ranToken), 'g'), '') : '';
if (historys === '') {
query = ranToken + query;
}
if (historys === '') {
query = ranToken + query;
}
historys += query + ranToken;
localStorage.setItem(historyval, historys);
historys += query + ranToken;
localStorage.setItem(historyval, historys);
}
} catch (e) {
console.log(e);
}
}
... ...
... ... @@ -163,13 +163,11 @@
a {
display: inline-block;
margin: 0 15px;
width: 213px;
height: 213px;
}
img {
width: 100%;
height: 100%;
width: 213px;
height: 213px;
}
}
... ... @@ -180,7 +178,11 @@
a {
display: inline-block;
width: 50%;
overflow: hidden;
img {
width: 320px;
height: 320px;
}
}
}
... ...