...
|
...
|
@@ -4,6 +4,7 @@ define('yohood', function(require, exports) { |
|
|
var common = require("common");
|
|
|
var share = require('plugins/share');
|
|
|
var freetile = require("lib/ui/jquery.freetile");
|
|
|
var tools = require("lib/util/tools");
|
|
|
var goodsSwiper = null;
|
|
|
require("plugins/slider");
|
|
|
require("plugins/imgZoom");
|
...
|
...
|
@@ -104,19 +105,28 @@ define('yohood', function(require, exports) { |
|
|
var product = data.data,
|
|
|
pic = '',
|
|
|
pos = offset,
|
|
|
part, topClass = '';
|
|
|
part, topClass = '', price = '', market_price = '';
|
|
|
if (data.code == 200 && product != "") {
|
|
|
$.each(product, function(i, v) {
|
|
|
//http://img05.static.yohobuy.com/thumb/2014/08/01/02/015008fea15e6a7c44afc0a6293e87b594-0150x0200-2-goodsimg.jpg
|
|
|
pic = v.pic.split('|')[0].replace(/-(\w+)-/g, '-0150x0200-');
|
|
|
//http://img12.static.yhbimg.com/goodsimg/2015/05/27/09/0235d475f72b11a24128a02c7fc24d4cfc.jpg?imageView/2/w/100/h/100
|
|
|
pic = pic.replace('imageView/2/w/100/h/100','imageView/2/w/200/h/200');
|
|
|
parts = v.price.split('.');
|
|
|
topClass = pos > 2 ? '' : 'red';
|
|
|
parts = v.price.split('.');
|
|
|
market_price = '';
|
|
|
//价格样式
|
|
|
price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
|
|
|
if(parseInt(v.market_price) > 0) //原价
|
|
|
{
|
|
|
parts = v.market_price.split('.');
|
|
|
market_price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
|
|
|
market_price = '<span class="original-price">¥ '+market_price+'</span>';
|
|
|
}
|
|
|
html += '<li><a href="' + v.url + '" target="_blank" title="' + v.name + '">' +
|
|
|
'<div class="img-box"><img src="' + pic + '" alt=""><span class="' + topClass + '">TOP ' + (++pos) + '</span></div>' +
|
|
|
'<p class="goods-name">' + v.name + '</p>' +
|
|
|
'<p class="price"><span class="original-price">¥ 309</span>¥' + (parts[0] + '.' + (parts[1] ? parts[1] : '00')) + '</p></a></li>';
|
|
|
'<p class="goods-name">' + tools.limitWords(v.name, 62) + '</p>' +
|
|
|
'<p class="price">'+market_price+'¥' + price + '</p></a></li>';
|
|
|
if (pos % 5 == 0) {
|
|
|
temp += template.replace('{li}', html);
|
|
|
html = '';
|
...
|
...
|
@@ -134,6 +144,10 @@ define('yohood', function(require, exports) { |
|
|
goodsSwiper.setup();
|
|
|
$('.limited-slide-next').removeClass('disable');
|
|
|
}
|
|
|
if(pos<=5) //去掉左右按钮
|
|
|
{
|
|
|
$(".limited-slide-control").remove();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
...
|
...
|
|