Buy 4 more at 10% discount.
选择语言
中文(简体)
阿布哈兹语
阿尔巴尼亚语
阿法尔语
阿拉伯语
阿卢尔语
阿姆哈拉语
阿乔利语
阿萨姆语
阿塞拜疆语
阿瓦德语
阿瓦尔语
埃维语
艾马拉语
爱尔兰语
爱沙尼亚语
奥克语
奥利亚语
奥罗莫语
奥塞梯语
巴布亚皮钦语
巴达维语
巴厘语
巴什基尔语
巴斯克语
巴塔克卡罗语
巴塔克托巴语
巴塔克西马隆贡语
巴乌雷语
白俄罗斯语
班巴拉语
邦阿西楠语
邦板牙语
保加利亚语
北索托语
奔巴语
比科尔语
俾路支语
冰岛语
波兰语
波斯尼亚语
波斯语
博杰普尔语
布里亚特语
布列塔尼语
藏语
草原马里语
查莫罗语
车臣语
楚克语
楚瓦什语
茨瓦纳语
聪加语
达里语
鞑靼语
丹麦语
掸语
德顿语
德语
迪维希语
迪尤拉语
蒂夫语
丁卡语
多格拉语
俄语
恩道语
恩德贝莱语(南部)
恩敦贝语
恩科字母(西非书面文字)
法罗语
法语
法语(加拿大)
梵语
菲律宾语
斐济语
芬兰语
丰语
弗里西语
弗留利语
富拉尼语
刚果语
高棉语
格陵兰语
格鲁吉亚语
贡根语
古吉拉特语
瓜拉尼语
哈卡钦语
哈萨克语
海地克里奥尔语
韩语
豪萨语
荷兰语
洪斯吕克语
吉尔吉斯语
吉土巴语
加利西亚语
加泰罗尼亚语
加语
捷克语
景颇语
卡纳达语
卡努里语
卡西语
凯克其语
科米语
科萨语
科西嘉语
克里米亚鞑靼语(拉丁文)
克里米亚鞑靼语(西里尔文)
克罗地亚语
克丘亚语
库尔德语(库尔曼吉语)
库尔德语(索拉尼)
廓克博若克语
拉丁语
拉特加莱语
拉脱维亚语
老挝语
立陶宛语
利古里亚语
林堡语
林加拉语
隆迪语
卢奥语
卢干达语
卢森堡语
卢旺达语
伦巴第语
罗马尼亚语
罗姆语
马都拉语
马恩岛语
马尔加什语
马尔瓦迪语
马耳他语
马拉地语
马拉雅拉姆语
马来语
马来语(爪夷文)
马其顿语
马绍尔语
玛姆语
迈蒂利语
毛里裘斯克里奥耳语
毛利语
梅泰语(曼尼普尔语)
蒙古语
孟加拉语
米南语
米佐语
缅甸语
苗语
纳瓦特尔语(东部瓦斯特卡)
南非荷兰语
南索托语
尼泊尔语
尼泊尔语言(尼瓦尔语)
努尔语
挪威语
帕皮阿门托语
旁遮普语(果鲁穆奇文)
旁遮普语(沙木基文)
葡萄牙语(巴西)
葡萄牙语(葡萄牙)
普什图语
齐切瓦语
奇加语
奇卢伯语
契维语
日语
瑞典语
萨巴特克语
萨米语(北部)
萨摩亚语
塞尔维亚语
塞拉利昂克里奥尔语
塞舌尔克里奥尔语
桑戈语
桑塔利语(拉丁文)
桑塔利语(欧甘文)
僧伽罗语
世界语
斯洛伐克语
斯洛文尼亚语
斯瓦特语
斯瓦希里语
苏格兰盖尔语
苏苏语
宿务语
索马里语
塔吉克语
塔马齐格特语(提非纳文)
塔马塞特语
塔希提语
泰卢固语
泰米尔语
泰语
汤加语
提格里尼亚语
图鲁语
图姆布卡语
图瓦语
土耳其语
土库曼语
瓦瑞语
望加锡语
威尔士语
威尼斯语
维吾尔语
文达语
沃洛夫语
乌德穆尔特语
乌尔都语
乌克兰语
乌兹别克语
西班牙语
西里西亚语
西西里语
希伯来语
希腊语
希利盖农语
夏威夷语
信德语
匈牙利语
修纳语
巽他语
牙买加土语
雅库特语
亚美尼亚语
亚齐语
伊班语
伊博语
伊洛卡诺语
意大利语
意第绪语
因纽特语(拉丁文)
因纽特语(音节)
印地语
印尼语
英语
尤卡坦玛雅语
约鲁巴语
粤语
越南语
爪哇语
中文(繁体)
宗卡语
祖鲁语
由
翻译
强力驱动
English
,
Deutsch
,
Italiano
,
Français
,
Español
USD
United States Dollars (USD)
Australian Dollars (AUD)
Canadian Dollars (CAD)
Euro (EUR)
United Kingdom Pounds (GBP)
Danish Kroner (DKK)
Japanese Yen (JPY)
Netherlands Antillean Guilder (ANG)
New Zealand Dollars (NZD)
Mexican Pesos (MXN)
Swedish Kronor (SEK)
Swiss Francs (CHF)
Singapore Dollars (SGD)
South Korean Won (KRW)
Jellybuddy
NEW IN
BEST SELLER
FOR HIM
Men's Shirts
Men's T-Shirts
Men's Tanks
Men's Bottoms
Men's Sets
Men's Cute Cartoon Jellyfish Art Print Casual Shirt
$28.99
FOR HER
Bastic Style
More links
English
,
Deutsch
,
Italiano
,
Français
,
Español
USD
United States Dollars (USD)
Australian Dollars (AUD)
Canadian Dollars (CAD)
Euro (EUR)
United Kingdom Pounds (GBP)
Danish Kroner (DKK)
Japanese Yen (JPY)
Netherlands Antillean Guilder (ANG)
New Zealand Dollars (NZD)
Mexican Pesos (MXN)
Swedish Kronor (SEK)
Swiss Francs (CHF)
Singapore Dollars (SGD)
South Korean Won (KRW)
Log in
Create an account
0
Close
NEW IN
BEST SELLER
FOR HIM
FOR HIM
Men's Shirts
Men's T-Shirts
Men's Tanks
Men's Bottoms
Men's Sets
FOR HER
Bastic Style
Log in
Create an account
English
,
Deutsch
,
Italiano
,
Français
,
Español
USD
United States Dollars (USD)
Australian Dollars (AUD)
Canadian Dollars (CAD)
Euro (EUR)
United Kingdom Pounds (GBP)
Danish Kroner (DKK)
Japanese Yen (JPY)
Netherlands Antillean Guilder (ANG)
New Zealand Dollars (NZD)
Mexican Pesos (MXN)
Swedish Kronor (SEK)
Swiss Francs (CHF)
Singapore Dollars (SGD)
South Korean Won (KRW)
Top searched
Men's Hedgehog Drinking Coconut Juice Art Print Casual Shirt
$28.99
FOR HIM
FOR HER
$28.99
Men's Cute Cartoon Jellyfish Art Print Casual Shirt
$28.99
$28.99
Men's Handsome Cat Surfing Art Print Casual Shirt
$28.99
$22.99
Men's Disco Tiger Art Print Vacation Shirt
$22.99
$24.99
Men's Funny Dog Vacation Style Print Shorts
$24.99
$28.99
Men's Vacation Style Macaw Art Print Short Sleeve Shirt
$28.99
$28.99
Men's Funny Crocodile Doodle Art Print Short Sleeve Shirt
$28.99
$28.99
Men's Multicolor Flowers Shark Print Short Sleeve Shirt
$28.99
$28.99
Men's Hedgehog Vacation Tropical Fruit Art Print Short Sleeve Shirt
$28.99
$28.99
Men's Cute Cartoon Jellyfish Art Print Casual Shirt
$28.99
$28.99
Men's Handsome Cat Surfing Art Print Casual Shirt
$28.99
$22.99
Men's Disco Tiger Art Print Vacation Shirt
$22.99
$24.99
Men's Funny Dog Vacation Style Print Shorts
$24.99
$28.99
Men's Vacation Style Macaw Art Print Short Sleeve Shirt
$28.99
$28.99
Men's Funny Crocodile Doodle Art Print Short Sleeve Shirt
$28.99
View more
$27.99
Women's Hawaii Tropical Plants Parrots Art Print Skirt
$27.99
$32.99
Women'S Retro Little Raccoon Drinking On Vacation Print Cami Midi Dress
$32.99
$32.99
Women'S Retro Otters Drinking On Vacation Print Cami Midi Dress
$32.99
$29.99
Women's Waves Watercolor Art Print Long Sleeve Shirt
$29.99
$32.99
Women's Leisure Otter Eating Ice Cream In A Pool Art Print Cami Midi Dress
$32.99
$8.99
Women's Turtle In Sunglasses Drinking Red Wine Print Tote Shoulder Bag
$8.99
$19.99
Women's Alligator Drinking Cocktail On Vacation Oil Painting Print Casual T-Shirt
$19.99
$21.99
Women's Coral Ocean Fish Art Print V Neck Mini Dress
$21.99
$27.99
Women's Hawaii Tropical Plants Parrots Art Print Skirt
$27.99
$32.99
Women'S Retro Little Raccoon Drinking On Vacation Print Cami Midi Dress
$32.99
$32.99
Women'S Retro Otters Drinking On Vacation Print Cami Midi Dress
$32.99
$29.99
Women's Waves Watercolor Art Print Long Sleeve Shirt
$29.99
$32.99
Women's Leisure Otter Eating Ice Cream In A Pool Art Print Cami Midi Dress
$32.99
$8.99
Women's Turtle In Sunglasses Drinking Red Wine Print Tote Shoulder Bag
$8.99
View more
New In
View all
Shop by Category
Men's Shirts
Men's T-Shirts
Men's Tanks
Men's Bottoms
Men's Sets
Cotton
$21.99
Men's The Great Negroni Wave Fun Cocktail Art Print Cotton Casual T-Shirt
$21.99
$19.99
Men's Sun Salt Sand Beach Vacation Pattern Cotton Tank Top
$19.99
$19.99
Men's Boy Holding Surfboard At The Seaside Print Cotton Casual T-Shirt
$19.99
$42.99
Men's Coconut Tree Pattern Print Casual Cotton Pants
$42.99
$21.99
Men's The Great Negroni Wave Fun Cocktail Art Print Cotton Casual T-Shirt
$21.99
$19.99
Men's Sun Salt Sand Beach Vacation Pattern Cotton Tank Top
$19.99
$19.99
Men's Boy Holding Surfboard At The Seaside Print Cotton Casual T-Shirt
$19.99
$42.99
Men's Coconut Tree Pattern Print Casual Cotton Pants
$42.99
View more
You May Also Like
Men's Cool Lion Reggae Soul Drinking Wine Vacation Art Print Casual Shirt
Quick Shop
Men's Leisure Hawaiian Vacation Otter Playing Guitar At The Seaside Art Print Shirt
Quick Shop
Men's Sunset Seaside Holiday Cocktail Black Cat Art Linen Blend Shirt
Quick Shop
Men's Pool UFO Sci-Fi Futuristic Art Print Casual Short Sleeve Shirt
Quick Shop
Men's Tree Of Life Mystical Watercolor Painting Casual Linen Blend Shirt
Quick Shop
Men's Casual Plain Textured Slant Pocket Elastic Drawstring Waist Cotton Linen Pants
Quick Shop
Men's Psychedelic Colorful Abstract Art Print Short Sleeve Shirt
Quick Shop
Men's Gentleman Monkey Champagne Oil Painting Print Linen Blend Shirt
Quick Shop
Men's Alligator And Flowers Art Print T-Shirt Shorts Set
Quick Shop
Men's Hawaiian Fox Drinking Vacation Print Short Sleeve Shirt
Quick Shop
Men's Fox Cocktail Hawaii Vacation Art Print Casual Shirt
Quick Shop
Men's Sailing Vacation Plants Art Print Short Sleeve Shirt
Quick Shop
Men's Crocodile Floral Cartoon Print Short Sleeve Shirt
Quick Shop
Men's Vacation Hawaii Sunset And Sunrise Scenery Printed Tank Top
Quick Shop
Men's Otter Cocktail Leisure Vacation Art Print Casual Shirt
Quick Shop
Men's Casual Hollow Out Knit Tank Top Drawstring Shorts Matching Set
Quick Shop
Men's A Coconut Tree And A Gorilla Print Short Sleeve Shirt
Quick Shop
Men's Travel in Rome Printed Tank Top
Quick Shop
Men's Japanese Art Octopus Graphic Printed Casual Pants
Quick Shop
Men's Cartoon Crocodile Graphic Print Short Sleeve Shirt
Quick Shop
Men's Shark Camouflage Print Short Sleeve Shirt
Quick Shop
Men's Vacation Floral Pattern Short Sleeve Shirt
Quick Shop
Men's Casual Solid Slant Pocket Elastic Waist Drawstring Straight-Leg Cotton Pants
Quick Shop
Men's Slant Pocket Striped Print Drawstring Beach Shorts
Quick Shop
Men's Slant Pockets Cotton And Linen Holiday Beach Shorts
Quick Shop
Men's Raccoon Drinking Juice At The Beach Vacation Print Casual Shirt
Quick Shop
Men's Colorful Striped Print Short Sleeve Shirt
Quick Shop
Men's Leaf Art Print T-Shirt
Quick Shop
Men's Sea Beach Silhouette Art Print Vacation Tank Top
Quick Shop
Men's Monkey And Banana Art Print Short Sleeve Shirt
Quick Shop
Men's Crab Art Print Shirt
Quick Shop
Men's Eiffel Tower Illustration Print Short Sleeve Shirt
Quick Shop
Men's Tiger Plant Art Print Short Sleeve Shirt
Quick Shop
Men's Hawaiian Resort Coconut Trees Art Print Short Sleeve Shirt
Quick Shop
Men's Lobster Art Print Shirt
Quick Shop
Men's Japanese Art Octopus Graphic Printed Casual Shorts
Quick Shop
Men's Elastic Waist Drawstring Solid Color Linen Blend Shorts
Quick Shop
Men's Gradient Hawaiian Tribal Plant Print Casual Shirt
Quick Shop
Men's The Great Negroni Wave Fun Cocktail Art Print Cotton Casual T-Shirt
Quick Shop
Men's Funny Art Foot Print Short Sleeve Shirt
Quick Shop
Men's Special Fish Cartoon Print Short Sleeve Shirt
Quick Shop
Men's Reggae Soul Lion Drinking Red Wine At The Beach Art Print T-Shirt
Quick Shop
Men's Retro Cat Cocktail Party Art Print Linen Blend Shirt
Quick Shop
Men's Otter Drinking Coconut Juice Vacation Print Casual Shirt
Quick Shop
Men's Chilling Smoking Cat Weed Art Print Shirt
Quick Shop
Men's Cute Cartoon Octopus Graphic Print Short Sleeve Shirt
Quick Shop
Men's Cartoon Japanese Art Sakura Print Shirt
Quick Shop
Men's Crocodile Cartoon Print Short Sleeve Shirt
Quick Shop
Men's Colorful Splash Ink Art Print Shirt
Quick Shop
Men's Vintage Newspaper Illustration Print Short Sleeve Shirt
Quick Shop
Men's Solid Color Drawstring Linen Blend Casual Shorts
Quick Shop
Men's Tropical Plants Flowers Printed Vacation Shirt
Quick Shop
Men's Flamingo Tropical Plant Vacation Art Print Casual Shirt
Quick Shop
Men's Vacation Dog Seaside Sunset Scenery Art Print Shirt
Quick Shop
Men's Coconut Tree Resort Hawaii Art Print Shirt
Quick Shop
Men's Vintage Plants Flowers Bees Art Print Shirt
Quick Shop
Men's Sailor Butterfly Skull Art Print Vacation Beach Linen Blend Shirt
Quick Shop
Men's Vacation Hawaiian Palm Tree Print Short Sleeve Shirt
Quick Shop
Men's Marine Art Octopus Print Short Sleeve Shirt
Quick Shop
Men's Floral Plant Art Print Waffle Zip Up Polo Shirt Shorts Set
Quick Shop
Men's Palm Trees On The Beach Art Print Shirt
Quick Shop
Men's Vacation Cartoon Seahorse Print Shirt
Quick Shop
Men's Geometric Textured Loose Short Sleeve Shirt Shorts Matching Set
Quick Shop
Men's Vacation Style Colorblock Art Print Casual T-Shirt
Quick Shop
Men's Lion Driving Travel Print Casual T-Shirt
Quick Shop
Men's Boho Flower Ethnic Totem Art Print Short Sleeve Shirt
Quick Shop
const isSpecialHeroTheme = window.SHOPLAZZA?.theme?.merchant_theme_name == 'Hero' && window.SHOPLAZZA?.theme?.merchant_theme_c_version == '2.2.19'; const specialHeroThemeClassName = 'hero_2_2_19_smart_recommend_block'; class SpzSmartBlockComponent extends SPZ.BaseElement { constructor(element) { super(element); this.templates_ = null; this.container_ = null; this.i18n_ = {}; this.config_ = {}; this.show_type_ = 3; this.product_resource_id_ = ''; this.collection_resource_id_ = ''; this.cart_items_ = []; this.customer_id_ = ''; this.order_id_ = ''; } static deferredMount() { return false; } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } buildCallback() { const template_type = window.C_SETTINGS.meta.page.template_type; if (template_type === 1) { this.show_type_ = 3; this.product_resource_id_ = window.C_SETTINGS.meta.page.resource_id; } else if (template_type === 2) { this.show_type_ = 4; this.collection_resource_id_ = window.C_SETTINGS.meta.page.resource_id; } else if (template_type === 15){ this.show_type_ = 5; } else if (template_type === 13){ this.show_type_ = 6; } else if (template_type === 20){ this.show_type_ = 7; this.customer_id_ = window.C_SETTINGS.customer.customer_id; } else if (template_type === 35){ this.show_type_ = 8; this.order_id_ = window.location.pathname.split('/').pop(); } this.templates_ = SPZServices.templatesForDoc(this.element); this.setAction_(); } mountCallback() { const that = this; const themeName = window.C_SETTINGS.theme.merchant_theme_name; const isGeek = /Geek/.test(themeName); this.fetchRules().then((res) => { if (res && res.rules && res.rules.length) { const blockEl = document.getElementById('smart_recommend_block'); this.initBlockClass(blockEl); this.initItemClass(blockEl); SPZ.whenApiDefined(blockEl).then((api) => { api.render({data: res}, true).then(() => { if (isGeek && that.show_type_ === 6) { blockEl.querySelector('.plugin_container_wrpper').style.padding = '30px 0'; } const recommendStyle = document.createElement('style'); recommendStyle.innerHTML = ` .plugin__recommend_container,.app-recommend-card { display: none !important; } `; document.head.appendChild(recommendStyle); const fetchList = []; res.rules.forEach((rule) => { fetchList.push(this.fetchRuleProductList(rule.id)); }); const fetchAll = Promise.all(fetchList); fetchAll.then((p_res) => { res.rules.forEach((rule, index) => { rule.products = p_res[index] && p_res[index].products; if (rule.products && rule.products.length) { const modalRender = document.getElementById('smart_recommend_js_root'); const $dest = document.getElementById('cart'); const isLifeStyle = /Life.*Style/.test(window.C_SETTINGS.theme.merchant_theme_name); if (modalRender && isLifeStyle && $dest.clientWidth > 767) { modalRender.classList.add('zb-mt-[-180px]') } } const ruleEl = document.getElementById('smart_recommend_rule_' + rule.id); SPZ.whenApiDefined(ruleEl).then((api) => { api.render({data: rule}, true).then(() => { that.impressListen(`#smart_recommend_rule_ul_${rule.id}`, function(){ that.trackRuleImpress(rule); }); const btnElList = document.querySelectorAll(`#smart_recommend_rule_ul_${rule.id} button`); btnElList.forEach((btnEl) => { if (btnEl && rule.config && rule.config.quick_shop_button_bg_color && rule.config.quick_shop_button_text_color) { btnEl.style.backgroundColor = rule.config.quick_shop_button_bg_color; btnEl.style.color = rule.config.quick_shop_button_text_color; } }); if (isSpecialHeroTheme) { ruleEl.querySelectorAll(`.smart_recommend_title`).forEach(dom=>{ dom.classList.add('type-title-font-family'); }); document.querySelectorAll(`.${specialHeroThemeClassName} #smart_recommend_rule_ul_${rule.id} .zb-recommend-price-line-through .money`).forEach(dom=>{ dom.classList.add('type-body-font-family'); }); }; }); }); }); }); }) }) } else { if (window.top !== window.self) { const template_type = window.C_SETTINGS.meta.page.template_type; const holderEl = document.getElementById('smart_recommend_preview_no_data_placeholder'); SPZ.whenApiDefined(holderEl).then((api) => { api.render({data: { isCart: template_type === 13, isCollection: template_type === 2, isProduct: template_type === 1, isIndex: template_type === 15 }}, true); }); } } }); } initBlockClass(blockEl) { if (!blockEl) return; if (blockEl.parentElement && blockEl.parentElement.offsetWidth === document.body.clientWidth) { blockEl.classList.add('smart_recommend_block_fullscreen'); }; if (isSpecialHeroTheme) { blockEl.classList.add(specialHeroThemeClassName); }; } initItemClass(blockEl) { if (blockEl) { const containerWidth = blockEl.offsetWidth; let itemWidth = ''; if (containerWidth > 780) { itemWidth = '16%'; } else if (containerWidth > 600) { itemWidth = '20%'; } else { itemWidth = '24%'; } const itemStyleEl = document.createElement('style'); itemStyleEl.innerHTML = `.zb-recommend-li-item{ width: ${itemWidth}; }`; document.body.appendChild(itemStyleEl); } } setAction_() { this.registerAction('quickShop', (data) => { const that = this; const product_id = data.args.product_id; const productIndex = data.args.productIndex; const rule_id = data.args.rule_id; const ssp = data.args.ssp; const scm = data.args.scm; const cfb = data.args.cfb; const ifb = data.args.ifb; const modalRender = document.getElementById('smart_recommend_product_modal_render'); if (modalRender) { document.body.appendChild(modalRender); } if (product_id) { this.fetchProductData(product_id).then((res) => { const product = res.products && res.products.length && res.products[0] || {}; product.cfb = cfb; product.ifb = ifb; SPZ.whenApiDefined(modalRender).then((api) => { api.render({product: product, productIndex: productIndex, rule_id: rule_id, ssp: ssp, scm: scm, show_type: that.show_type_}, true).then(() => { const modalEl = document.getElementById('smart_recommend_product_modal'); SPZ.whenApiDefined(modalEl).then((modal) => { that.impressListen('#smart_recommend_product_modal', function(){ that.trackQuickShop({ rule_id: rule_id, product_id: product_id }); }); modal.open(); }); const formEl = document.getElementById('smart_recommend_product_form'); SPZ.whenApiDefined(formEl).then((form) => { form.setProduct(product); }); const variantEl = document.getElementById('smart_recommend_product_variants'); SPZ.whenApiDefined(variantEl).then((variant) => { variant.handleRender(product); }); }); }) }); } }); this.registerAction('handleScroll', (data) => { this.directTo(data.args.rule_id, data.args.direction); }); this.registerAction('handleProductChange', (data) => { const variant = data.args.data.variant; const product = data.args.data.product; const imageRenderEl = document.getElementById('smart_recommend_product_image'); SPZ.whenApiDefined(imageRenderEl).then((api) => { api.render({ variant: variant, product: product }); }); }); this.registerAction('handleAtcSuccess', (detail) => { const data = detail.args; data.data.product = data.data.product || {}; data.data.variant = data.data.variant || {}; const product_id = data.data.product.id; const product_title = data.data.product.title; const variant_id = data.data.variant.id; const price = data.data.variant.price; const rule_id = data.rule_id; const aid = `smart_recommend.${this.show_type_}.${rule_id}`; const ifb = data.data.product.ifb; const cfb = data.data.product.cfb; const ssp = data.ssp; const scm = data.scm; const spm = `smart_recommend_${this.show_type_}.${data.spmIndex}`; const params = { id: product_id, product_id: product_id, number: 1, name: product_title, variant_id: variant_id, childrenId: variant_id, item_price: price, source: 'add_to_cart', _extra: { aid: aid, ifb: ifb, cfb: cfb, scm: scm, spm: `..${window.C_SETTINGS.meta.page.template_name}.${spm}`, ssp: ssp, } }; this.tranckAddToCart(params); }); this.registerAction('addATCHook', (data) => { const params = data.args; const spm = `smart_recommend_${this.show_type_}.${params.spmIndex}`; this.myInterceptor_ = window.djInterceptors && window.djInterceptors.track.use({ event: 'dj.addToCart', params: { aid: `smart_recommend.${this.show_type_}.` + params.rule_id, ssp: params.ssp, scm: params.scm, cfb: params.cfb, spm: `..${window.C_SETTINGS.meta.page.template_name}.${spm}`, }, once: true }); }); } tranckAddToCart(detail) { if (window.$) { window.$(document.body).trigger('dj.addToCart', detail); } } fetchRules() { const payload = { show_type: this.show_type_, }; let that = this; if (this.show_type_ === 6) { let line_items = []; return this.fetchCart().then((res) => { if (res && res.cart && res.cart.line_items) { line_items = res.cart.line_items.map((item) => { return { product_id: item.product_id, variant_id: item.variant_id, quantity: item.quantity, price: item.price } }); } payload.line_items = line_items; that.cart_items_ = line_items; return that.fetchRulesRequest(payload); }); } else { if (this.show_type_ === 3) { payload.line_items = [{ product_id: this.product_resource_id_ }]; } else if (this.show_type_ === 4) { payload.collection_id = this.collection_resource_id_; } else if (this.show_type_ === 7) { payload.customer_id = this.customer_id_; } else if (this.show_type_ === 8) { payload.order_id = this.order_id_; } return this.fetchRulesRequest(payload); } } fetchRulesRequest(payload) { return fetch(window.C_SETTINGS.routes.root + "/api/possum/recommend_query", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) }).then(function(res){ if(res.ok){ return res.json(); } }); } fetchCart() { return fetch(`/api/cart/cart-select?r=${Math.random().toString(36).slice(-4)}`) .then((res) => { if (res.ok) { return res.json(); } }); } fetchRuleProductList(rule_id) { const payload = { page: 1, limit: 100, fields: ["title", "url", "image", "min_price_variant.price", "min_price_variant.compare_at_price"], rule_id: rule_id, }; if (this.show_type_ === 3) { payload.line_items = [{ product_id: this.product_resource_id_ }]; } else if (this.show_type_ === 4) { payload.collection_id = this.collection_resource_id_; } else if (this.show_type_ === 6) { payload.line_items = this.cart_items_; } else if (this.show_type_ === 7) { payload.customer_id = this.customer_id_; } else if (this.show_type_ === 8) { payload.order_id = this.order_id_; } return fetch(window.C_SETTINGS.routes.root + "/api/possum/recommend_products", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) }).then(function(res){ if(res.ok){ return res.json(); } }).catch(function(err){ console.log(err); }); } fetchProductData(product_id) { return fetch(window.C_SETTINGS.routes.root + "/api/possum/products", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ product_ids: [product_id], fields: [ "images", "options", "min_price_variant", "variants"] }) }).then(function(res){ if(res.ok){ return res.json(); } }).catch(function(err){ console.log(err); const loadingEl = document.getElementById('smart_recommend_loading'); if (loadingEl) { loadingEl.style.display = 'none'; } }); } getStyle(ele, style) { if (!ele) return; if (window.getComputedStyle) { return window.getComputedStyle(ele)[style]; } return ele.currentStyle[style]; } directTo(id, direction) { const scrollElement = document.getElementById(`smart_recommend_rule_ul_${id}`); const blockWidth = parseInt(this.getStyle(scrollElement, 'width')); const scrollLength = (blockWidth * 0.19 - 12) * 5; const scrollPoint = scrollElement.scrollWidth - scrollElement.clientWidth; if (!scrollElement) return; if (direction === 'left') { if (document.dir === 'rtl') { scrollElement.scrollTo({ left: Math.abs(scrollElement.scrollLeft) >= scrollPoint - 100 ? 0 : scrollElement.scrollLeft - scrollLength, behavior: 'smooth' }); return; } scrollElement.scrollTo({ left: Math.max(scrollElement.scrollLeft - scrollLength, 0), behavior: 'smooth' }); } else { if (document.dir === 'rtl') { scrollElement.scrollTo({ left: Math.abs(scrollElement.scrollLeft) >= scrollPoint + 100 ? 0 : scrollElement.scrollLeft + scrollLength, behavior: 'smooth' }); return; } scrollElement.scrollTo({ left: scrollElement.scrollLeft >= scrollPoint - 100 ? 0 : scrollElement.scrollLeft + scrollLength, behavior: 'smooth' }); } } trackRuleImpress(rule) { if (window.sa && window.sa.track) { window.sa.track("plugin_common", { plugin_name: "upsell", event_type: "impressions", rule_id: rule.id, ssp: rule.ssp, scm: rule.scm, show_type: this.show_type_, support_app_block: window.C_SETTINGS.theme.support_app_block }); window.sa.track("module_impressions", { aid: `smart_recommend.${this.show_type_}.${rule.id}`, support_app_block: window.C_SETTINGS.theme.support_app_block }); } } trackQuickShop(data) { window.sa && sa.track && sa.track("plugin_common", { plugin_name: "upsell", event_type: "quick_shop", rule_id: data.rule_id, product_id: data.product_id, show_type: this.show_type_, }); } impressListen(selector, cb) { const el = document.querySelector(selector); const onImpress = (e) => { if (e) { e.stopPropagation(); } cb(); }; if (el && !el.getAttribute('imprsd')) { el.addEventListener('impress', onImpress) } else if (el) { onImpress(); } } } SPZ.defineElement('spz-custom-smart-block', SpzSmartBlockComponent);
Get 10% off your order
Sign up and unlock your instant discount
Subscribe
Thanks for subscribing
Optional button
111
GIFTS
POINTS
111
$0.00
1
Item has been added
const zebu_ativity_pop_show_history_key = 'zebu_ativity_pop_show_history'; class SpzCustomComponent extends SPZ.BaseElement { constructor(element) { super(element); this.templates_ = null; this.container_ = null; this._atcLineItem = {}; this.cart_ = {}; this.top_product_ids_ = []; this.products_ = []; this.activityId_ = null; this.rendered_ = false; this.myInterceptor_ = null; this.i18n_ = {}; this.config_ = {}; this.page_ = 1; this.limit_ = 10; this.loading_ = false; this.activityPopShowHistoryConfig = null; } static deferredMount() { return false; } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } buildCallback() { this.templates_ = SPZServices.templatesForDoc(this.element); this.setAction_(); } generateActivityPopShowHistoryKey(activity_id){ const customer_id = window.C_SETTINGS.customer.customer_id || 'unlogin'; return customer_id + '-' + activity_id; } judgeCanShowCartPop(data){ const pop_frequency = data.config.pop_frequency; if (pop_frequency == 'once'){ return { show: !window.sessionStorage.getItem('smart_pop_times'), type: 'once' }; } if( pop_frequency == 'not_limit' ){ return { show: true, type: 'not_limit' }; } const activityPopShowHistory = this.getActivityPopShowHistory(); if( !activityPopShowHistory ){ return { show: true, type: 'no_history' }; } const historyKey = this.generateActivityPopShowHistoryKey(data.id); const historyItem = activityPopShowHistory[historyKey]; if( !historyItem ){ return { show: true, type: 'no_history' }; } if( pop_frequency == 'once' ){ return { show: false, type: 'once' }; } const splitArray = pop_frequency.split(':'); if( splitArray.length != 3 ){ return { show: true, type: 'rule_error' }; } const limitType = splitArray[0]; const limitTypeNum = Number(splitArray[1]); const limitNum = Number(splitArray[2]); const startTime = Number(historyItem['startTime']); const count = Number(historyItem['count']); if( new Date().getTime() >= this.getLimitEndTime( startTime, limitType, limitTypeNum ) ){ return { show: true, type: 'another_range' }; } if( limitNum > count ){ return { show: true, type: 'under_limit' }; } return { show: false, type: 'exceed_range' }; } getActivityPopShowHistory(){ try{ const activityPopShowHistory = JSON.parse(window.localStorage.getItem(zebu_ativity_pop_show_history_key)); if( typeof activityPopShowHistory != 'object' ) return null; return activityPopShowHistory; }catch(e){ return null; } } addActivityPopShowHistory(props){ if( !props ) return; const { data, ruleCheckResult } = props; const pop_frequency = data.config.pop_frequency; if( pop_frequency == 'once' ){ return window.sessionStorage.setItem('smart_pop_times', Number(window.sessionStorage.getItem('smart_pop_times')) + 1); } const historyKey = this.generateActivityPopShowHistoryKey(data.id); const activityPopShowHistory = this.getActivityPopShowHistory() || {}; const historyItem = activityPopShowHistory[historyKey]; if( ruleCheckResult.type == 'another_range' || !historyItem ){ activityPopShowHistory[historyKey] = { startTime: new Date().getTime(), count: 1, }; }else{ activityPopShowHistory[historyKey].count += 1; } return window.localStorage.setItem(zebu_ativity_pop_show_history_key,JSON.stringify(activityPopShowHistory)); } removeActivityPopShowHistory(){ return window.localStorage.removeItem(zebu_ativity_pop_show_history_key); } getLimitEndTime(startTime, rangeType, rangeNum){ if( rangeType == 'day' ){ return startTime + 24*60*60*1000 * rangeNum; } if( rangeType == 'week' ){ return startTime + 24*60*60*1000 * 7 * rangeNum; } if( rangeType == 'month' ){ const date = new Date(startTime); date.setMonth( date.getMonth() + rangeNum ); return date.getTime(); } return startTime; } mountCallback() { this.i18n_ = (window.smartRecommendI18n && window.smartRecommendI18n[document.documentElement.lang] || window.smartRecommendI18n['en-US']) || {}; const cartPopRenderEl = document.getElementById("smart_cart_pop_render"); const modalEl = document.getElementById("smart_cart_pop_modal"); const spmBase = `smart_recommend_2`; const extra = { spmBase: spmBase, i18n: this.i18n_, }; const that = this; document.addEventListener('dj.addToCart', (event) => { try { const e = event.detail; if (e.source === 'buy_now' || window.__upsell_block || this.rendered_) return; that.fetchActivityData({product_id: e.product_id, variant_id: e.variant_id}).then(data => { if (!data || !data.products || !data.products.length) return; const ruleCheckResult = that.judgeCanShowCartPop(data); if( !ruleCheckResult.show ) return; that.config_ = data.config; const recommendStyle = document.createElement('style'); recommendStyle.innerHTML = ` #plugin_recommend_atc_pop { display: none !important; } `; document.head.appendChild(recommendStyle); SPZ.whenApiDefined(cartPopRenderEl).then(function(api){ api.render(Object.assign({}, data, extra), true).then(function() { that.rendered_ = true; if (data.products.length) { const headEl = document.getElementById("smart_cart_pop_head_render"); if (headEl) { SPZ.whenApiDefined(headEl).then(function(head){ head.render({ data: data }); }); } SPZ.whenApiDefined(modalEl).then(function(api){ that.impressListen('#smart_cart_pop_activity', function(){ that.trackPluginImpression_(data); }); api.open(); that.activityPopShowHistoryConfig = { data, ruleCheckResult }; const intersectionObserver = new IntersectionObserver( function (entries) { if (entries[0].intersectionRatio > 0){ !that.loading_ && (that.products_.length - that.target_top_product_num_) === that.page_ * that.limit_ && that.viewMore(); } }, { threshold: [0.1] } ); if( document.querySelector('#smart_cart_pop_view_more_text') ){ intersectionObserver.observe( document.querySelector('#smart_cart_pop_view_more_text') ); } }); } }) }); }) } catch (e) { console.error(e); } }); } unmountCallback() { } viewMore () { const cartPopRenderEl = document.getElementById("smart_cart_pop_render"); const that = this; const data = {}; SPZ.whenApiDefined(cartPopRenderEl).then(function(api){ that.fetchActivityData({ page: that.page_ + 1, limit: that.limit_ }).then(function(data) { data.products = that.products_; data.target_top_product_num = that.target_top_product_num_; data.i18n = that.i18n_; data.spmBase = `smart_recommend_2`; api.render(data); }) }) } fetchActivityData(data) { const that = this; if (data.product_id) { that._atcLineItem = data; } that.loading_ = true; return that.getCart().then(cart => { that.cart_ = cart.cart; return fetch(window.C_SETTINGS.routes.root + "/api/possum/recommend_activities", { method: "POST", headers: { "Content-Type": "application/json", "store-id": window.C_SETTINGS.shop.shop_id, }, body: JSON.stringify({ "show_type": 2, "line_item": { "product_id": that._atcLineItem.product_id, "variant_id": that._atcLineItem.variant_id, }, line_items: cart.cart.line_items, "page": data.page || 1, "limit": data.limit || 10, }) }).then(function(res){ if(res.ok){ return res.json(); } }).then(function(data){ data.cart = cart.cart; if (data.page === 1) { that.target_top_product_num_ = data.target_top_product_num || 0; } that.products_ = that.products_.concat(data.products || []); that.page_ = data.page || 1; that.limit_ = data.limit || 10; return data; }).catch(function(e){ console.log(e); }).finally(function(){ that.loading_ = false; }) }); }; setMatchDrawerHeight_(data) { const modalContent = document.querySelector("#smart_cart_pop_product_list"); const windowHeight = window.innerHeight; modalContent.style.maxHeight = windowHeight * 0.85 + "px"; } setAction_() { this.registerAction('changeBannerColor', (data) => { if (!data.args.data || !data.args.data.data || !data.args.data.data.data) return false; const config = data.args.data.data.data.config; const bannerBgEl = document.querySelector('.smart_cart_pop_banner_bg'); if (bannerBgEl && config) { bannerBgEl.style.background = config.banner_bg_color; bannerBgEl.style.color = config.banner_text_color; } }); this.registerAction('handleProductChange', (data) => { const that = this; const imageEl = document.getElementById(`smart_cart_pop_image_${data.args.data.product_id}`); SPZ.whenApiDefined(imageEl).then(function(api){ api.render({ data: data.args.data, config: that.config_ }); }); const atcTextEl = document.getElementById(`smart_cart_pop_atc_${data.args.data.product_id}`); SPZ.whenApiDefined(atcTextEl).then(function(api){ api.render({ data: data.args.data, defaultText: data.args.defaultText, soldOutText: that.i18n_.sold_out }); }); if (data.args.data.variant.available) { document.getElementById(`smart_cart_pop_atc_btn_${data.args.data.product_id}`).classList.remove('zb-pointer-events-none'); } else { document.getElementById(`smart_cart_pop_atc_btn_${data.args.data.product_id}`).classList.add('zb-pointer-events-none'); } }); this.registerAction('handleProduct', (detail) => { const that = this; this.renderProductsForm_(detail.args.data.data); }); this.registerAction('addATCHook', (data) => { const params = data.args; this.myInterceptor_ = window.djInterceptors && window.djInterceptors.track.use({ event: 'dj.addToCart', params: { aid: 'smart_recommend.2.' + params.activity_id, ssp: params.ssp, scm: params.scm, cfb: params.cfb, spm: `..${window.C_SETTINGS.meta.page.template_name}.${params.spm}`, }, once: true }); }); this.registerAction('handleAtcSuccess', (detail) => { detail.args.data.product = detail.args.data.product || {}; detail.args.data.variant = detail.args.data.variant || {}; const defParams = detail.args.product.split('__'); const product_id = detail.args.data.product.id; const product_title = detail.args.data.product.title; const variant_id = detail.args.data.variant.id; const price = detail.args.data.variant.price; const aid = defParams[0]; const ifb = detail.args.data.product.ifb; const cfb = detail.args.data.product.cfb; const scm = defParams[1]; const spm = defParams[2]; const ssp = defParams[3]; const params = { id: product_id, product_id: product_id, number: 1, name: product_title, variant_id: variant_id, childrenId: variant_id, item_price: price, source: 'add_to_cart', _extra: { aid: aid, ifb: ifb, cfb: cfb, scm: scm, spm: `..${window.C_SETTINGS.meta.page.template_name}.${spm}`, ssp: ssp, } }; const activity_id = `${detail.args.activity_id}`; const target_drive_way = detail.args.target_drive_way; document.getElementById(`smart_cart_pop_loading_${product_id}`).classList.add('zb-hidden'); document.getElementById(`smart_cart_pop_added_${product_id}`).classList.remove('zb-hidden'); setTimeout(() => { document.getElementById(`smart_cart_pop_added_${product_id}`).classList.add('zb-hidden'); document.getElementById(`smart_cart_pop_atc_${product_id}`).classList.remove('zb-hidden'); document.getElementById(`smart_cart_pop_atc_btn_${product_id}`).classList.remove('zb-pointer-events-none'); }, 1000); this.tranckAddToCart(params); if (target_drive_way === 'rebate') { const bannerEl = document.getElementById(`smart_cart_pop_banner`); this.getRecommendInfo(activity_id).then(res => { if (res && res.rebate_tips) { bannerEl.innerHTML = res.rebate_tips; } }) } }); this.registerAction('handleCartSummary', (event) => { const that = this; const checkoutButtonEle = document.getElementById("smart_cart_pop_checkout_button"); if (checkoutButtonEle) { SPZ.whenApiDefined(checkoutButtonEle).then(function(api){ api.render({ i18n: that.i18n_ }, false); }); } const tipEl = document.getElementById("smart_cart_pop_tip_info"); const cart = event && event.args && event.args.data && event.args.data.data; if (!tipEl || !cart) return; let total_price = cart.total_price; if (!total_price) { SPZ.whenApiDefined(tipEl).then(function(api){ api.render({ total_price: total_price, i18n: that.i18n_ }, false); }); } else { this.getBindDiscount_(cart.line_items).then(res => { if (res && res.discount_code){ const total = cart.line_price - cart.total_discount - res.bundle_discount_value; if (total > 0) { total_price = total; } else { total_price = 0; } } SPZ.whenApiDefined(tipEl).then(function(api){ api.render({ total_price: total_price, i18n: that.i18n_ }, false); }); }) } }); this.registerAction('open', () => { this.setMatchDrawerHeight_(); this.addActivityPopShowHistory( this.activityPopShowHistoryConfig ); }); this.registerAction('close', () => { this.rendered_ = false; this.products_ = []; window.djInterceptors && window.djInterceptors.track.eject(this.myInterceptor_); }); } getCart() { return fetch(`${window.C_SETTINGS.routes.root || ''}/api/cart`, { method: 'GET', headers: { 'Content-Type': 'application/json; charset=UTF-8', }, }).then(res => res.json()) } getRecommendInfo (activity_id) { return this.getCart().then(cart => { this.cart_ = cart.cart; return fetch(`${window.C_SETTINGS.routes.root || ''}/api/possum/recommend_info`, { method: 'POST', headers: { 'Content-Type': 'application/json; charset=UTF-8', }, body: JSON.stringify({ show_type: 2, rule_id: `${activity_id}`, line_items: cart.cart.line_items, line_item: this._atcLineItem, }) }).then(res => res.json()) }) } renderProductsForm_(data) { const products = data.products; const listPopRenderEl = document.getElementById("smart_cart_pop_render"); if (!listPopRenderEl) return; listPopRenderEl.querySelectorAll('.smart_cart_pop_atc_btn_bg').forEach(function(el){ el.style.color = data.config.add_to_cart_button_text_color; el.style.background = data.config.add_to_cart_button_color; }); products.forEach(function(product){ const productId = product.id; const productFormEls = listPopRenderEl.querySelectorAll(`ljs-product-form[product-id="${productId}"]`); let variantsEl = listPopRenderEl.querySelectorAll(`ljs-product-form[product-id="${productId}"] #smart_cart_pop_variant_${productId}_mobile ljs-variants`); if (window.innerWidth > 768) { variantsEl = listPopRenderEl.querySelectorAll(`ljs-product-form[product-id="${productId}"] #smart_cart_pop_variant_${productId}_pc ljs-variants`); } productFormEls.forEach(function(el){ SPZ.whenApiDefined(el).then(function(api){ api.setProduct(product); }); }); variantsEl.forEach(function(el){ SPZ.whenApiDefined(el).then(function(api){ api.handleRender(product); }); }) }); } tranckAddToCart(detail) { if (window.$) { window.$(document.body).trigger('dj.addToCart', detail); } } trackPluginImpression_(rule){ if (window.sa && window.sa.track) { window.sa.track("module_impressions", { aid: `smart_recommend.2.${rule.id}` }); } } getBindDiscount_(carts) { let bundle_sale_ids = []; try { bundle_sale_ids = sessionStorage['bundle_sale_ids'] && JSON.parse(sessionStorage['bundle_sale_ids']).filter((item, index, arr) => arr.indexOf(item, 0) === index).slice(-5); } catch (err) { console.error(err); } if (!carts.length) { Promise.resolve(); } return fetch(`${window.C_SETTINGS.routes.root || ''}/api/bundle-sales/cart`, { method: 'POST', headers: { 'Content-Type': 'application/json; charset=UTF-8', 'store-id': window.C_SETTINGS.shop.shop_id, }, body: JSON.stringify({ cart: carts, action_type: 'cart', bundle_sale_ids }) }).then(res => res.json()) } impressListen(selector, cb) { const el = document.querySelector(selector); const onImpress = (e) => { if (e) { e.stopPropagation(); } cb(); }; if (el && !el.getAttribute('imprsd')) { el.addEventListener('impress', onImpress) } else if (el) { onImpress(); } } } SPZ.defineElement('spz-custom-smart', SpzCustomComponent);
See detail
$0.00
Quantity
1
原文
请对此翻译评分
您的反馈将用于改进谷歌翻译