Authored by 沈志敏

fix bug

... ... @@ -7,8 +7,7 @@ const _getProductBySkns = function(productObj) {
productSkn: productObj.defaultSkns,
method: 'h5.product.batch'
}).then((result) => {
let nskns = [];
productObj.defaultPros = [];
if (result && result.data && result.data.product_list && result.code === 200) {
result.data.product_list.forEach(function(val) {
var goods_id = Array.isArray(val.goods_list) && val.goods_list.length ? val.goods_list[0].goods_id : null;
... ... @@ -27,11 +26,8 @@ const _getProductBySkns = function(productObj) {
obj.brandurl = `//m.yohobuy.com/product/index/brand?domain=${val.brand_domain}&openby:yohobuy={"action":"go.brand","params":{"brand_id":${val.brand_id}}}`;
}
nskns.push(obj);
productObj.defaultPros.push(obj);
});
productObj.defaultSkns = nskns;
} else {
delete productObj.defaultSkns;
}
});
};
... ...
... ... @@ -66,10 +66,10 @@
{{#isEqualOr type 'productGroup'}}
{{! 商品池}}
<div class="product-container item{{numOfOneRow}}" {{#if proBgImg}}style="background:url({{proBgImg}})repeat;"{{/if}}>
<div class="product-source" {{#if searchCondition}}cloneitem="{{searchCondition.limit}}" condition='{{stringify searchCondition}}'{{/if}} fp="{{getAnalysis ../this @index}}">
<div class="product-source" {{#unless defaultPros.length}} {{#if searchCondition }}cloneitem="{{searchCondition.limit}}"{{/if}}{{/unless}} condition='{{stringify searchCondition}}' fp="{{getAnalysis ../this @index}}">
<input class="imgwh" type="hidden" value="193x257">
{{#ifand defaultSkns defaultSkns.length}}
{{#defaultSkns}}
{{#if defaultPros.length}}
{{#defaultPros}}
<div class="feature-product-info {{#if ../condition}}novisible{{/if}}">
<a class="first-part product-detail" href='{{producturl}}'>
<div class="product-detail-imgbox">
... ... @@ -94,7 +94,7 @@
</a>
{{/if}}
</div>
{{/defaultSkns}}
{{/defaultPros}}
{{else}}
<div class="feature-product-info novisible">
<a class="first-part product-detail" href=''>
... ... @@ -103,7 +103,7 @@
{{#if rigTopImg}}<img class="rigtopimg" src="{{image2 rigTopImg q=60}}">{{/if}}
<img class="product-detail-img" src="">
</div>
{{#isEqualOr showpname '1'}}<p class="product-name"></p>{{/isEqualOr}}
{{#isEqualOr showPrdName '1'}}<p class="product-name"></p>{{/isEqualOr}}
<div class="product-detail-text">
<div class="price">
<span class="sale-price"{{#if fontColor}}style="color:{{fontColor}};"{{/if}}></span>
... ... @@ -120,7 +120,7 @@
</a>
{{/if}}
</div>
{{/ifand}}
{{/if}}
</div>
</div>
{{/isEqualOr}}
... ...
... ... @@ -9,7 +9,7 @@ var isWechat = /micromessenger/i.test(navigator.userAgent);
function swiperInit() {
$('.swiper-container').each(function() {
var opt = {
loop: $(this).data('loop') === '1' ? true : false,
loop: $(this).data('loop') === 1 ? true : false,
slidesPerView: 'auto'
};
var spacebetween = $(this).data('spacebetween');
... ...
... ... @@ -58,14 +58,17 @@ module.exports = {
return style;
},
stringify: function(obj) {
if (!obj) {
return '';
}
return JSON.stringify(obj);
},
repeat: function(n, options) {
if (n) {
var str = '';
let str = '';
for (var i = 0; i < n; i++) {
var opt = {
for (let i = 0; i < n; i++) {
let opt = {
index: i,
first: i === 0
};
... ...