...
|
...
|
@@ -329,8 +329,6 @@ function getShopProductLinks() { |
|
|
let shopId = $(this).data('shopid');
|
|
|
let id = $(this)[0].id;
|
|
|
|
|
|
console.log(id, shopId);
|
|
|
|
|
|
if (shopId && id) {
|
|
|
shopArr.ids.push(id);
|
|
|
shopArr.shopIds.push(shopId);
|
...
|
...
|
@@ -352,7 +350,6 @@ function getShopProductLinks() { |
|
|
if (index >= 0) {
|
|
|
let divId = shopArr.ids[index];
|
|
|
let shopUrl = `//m.yohobuy.com/product/index/brand?shop_id=${shopInfo.shops_id}&openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shopInfo.shops_id}","shop_template_type":"${shopInfo.shop_template_type}","shop_name":"${shopInfo.shop_name}"${is_red_shop}}}`;// eslint-disable-line
|
|
|
console.log(shopUrl);
|
|
|
$('#' + divId).find('.shop-wrapper a').attr('href', shopUrl);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -926,57 +923,6 @@ function activityPlan() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 单独改变未完成的楼层的高度
|
|
|
function changeShopAndProductHeightSingle(parent, className) {
|
|
|
let img = $(parent).find('.' + className);
|
|
|
|
|
|
if (img[0] && !img.hasClass('completed')) {
|
|
|
// console.log(img[0].src, /(\.jpg|\.png)/.test(img[0].src));
|
|
|
if (/(\.jpg|\.png)/.test(img[0].src)) {
|
|
|
let image = new Image();
|
|
|
|
|
|
image.src = img[0].src;
|
|
|
image.onload = function() {
|
|
|
img.removeClass(className);
|
|
|
img.addClass('completed');
|
|
|
let height = $(parent).find('.product-wrapper .feature-product-info').height();
|
|
|
|
|
|
$(parent).find('.shop-wrapper .feature-shop-info').height(height);
|
|
|
};
|
|
|
} else {
|
|
|
setTimeout(changeShopAndProductHeightSingle, 300, parent, className);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 改变店铺+商品组中店铺的高度
|
|
|
function changeShopAndProductHeight() {
|
|
|
$('.shop-product-container').each(function() {
|
|
|
let img = $(this).find('.product-detail-img').eq(0);
|
|
|
let that = this;
|
|
|
|
|
|
if (img[0] && !img.hasClass('completed')) {
|
|
|
// console.log(img[0].src, /(\.jpg|\.png)/.test(img[0].src));
|
|
|
if (/(\.jpg|\.png)/.test(img[0].src)) {
|
|
|
let image = new Image();
|
|
|
|
|
|
image.src = img[0].src;
|
|
|
image.onload = function() {
|
|
|
img.addClass('completed');
|
|
|
let height = $(that).find('.product-wrapper .feature-product-info').height();
|
|
|
|
|
|
$(that).find('.shop-wrapper .feature-shop-info').height(height);
|
|
|
};
|
|
|
} else {
|
|
|
let className = 'no-completed-' + Math.random().toString(16).substr(2, 8);
|
|
|
|
|
|
img.addClass(className);
|
|
|
setTimeout(changeShopAndProductHeightSingle, 300, that, className);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$(function() {
|
|
|
if ($('.over').length) {
|
|
|
// 过期/删除 状态的 活动
|
...
|
...
|
@@ -1041,8 +987,6 @@ $(function() { |
|
|
// 定时计划
|
|
|
activityPlan();
|
|
|
|
|
|
changeShopAndProductHeight();
|
|
|
|
|
|
getShopProductLinks();
|
|
|
|
|
|
// 小程序相关处理
|
...
|
...
|
|