Authored by htoooth

latest view

... ... @@ -487,7 +487,7 @@ function _getSortNavAsync(smallSortId, gender) {
// 保存在 gids 和 skns ,最近流览功能
const saveRecentGoodInCookies = (oldSkns, res, addSkns) => {
oldSkns = oldSkns || [];
oldSkns = oldSkns.split(',') || [];
_.remove(oldSkns, addSkns);
... ...
<script id="latest-walk-tpl" type="text/html">
\{{# latestWalk}}
<div class="good">
<a href="\{{href}}" target="_blank">
<img class="lazy" data-original="\{{img}}">
</a>
<a class="name" href="\{{href}}" target="_blank">\{{name}}</a>
<p class="price">
<span class="market-price">\{{marketPrice}}</span>
<span class="sale-price">\{{salePrice}}</span>
</p>
</div>
\{{/ latestWalk}}
</script>
\ No newline at end of file
... ... @@ -11,4 +11,9 @@
</p>
</div>
\{{/ latestWalk}}
</script>
\ No newline at end of file
</script>
<div class="lazy-load-object">
<textarea class="datalazyload" style="visibility: hidden;">
<script>fetchLatestWalk();</script>
</textarea>
</div>
... ...
... ... @@ -502,8 +502,7 @@ bindEvent.add(function() {
// yas
require('../common');
// 最近浏览
require('./detail/latest-walk');
require('./detail/latest-walk'); // 最近浏览
// 商品详情/材质洗涤切换
$('.description-material').on('click', '.title', function() {
... ...
... ... @@ -10,7 +10,12 @@ var lazyLoad = require('yoho-jquery-lazyload');
var $latestWalkCount = $('#latest-walk-count');
(function() {
var dataLazyLoad = require('../../plugins/lazy-load')(document);
// 数据懒加载
dataLazyLoad.init({cls: 'datalazyload', threshold: -50});
function fetchLatestWalk() {
var tpl;
if ($latestWalkCount.length === 0) {
... ... @@ -59,4 +64,6 @@ var $latestWalkCount = $('#latest-walk-count');
}
}
});
}());
}
window.fetchLatestWalk = fetchLatestWalk;
... ...