🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
1 / 13
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
🎁Men's Fashion Wasserdichte Quarzuhr💩
50% OFF

🎁Men's Fashion Wasserdichte Quarzuhr💩

€29.99 €59.99
Verkaufte StĂŒckzahl: 0
Color
Menge

FEATURES

WASSERBESTÄNDIGKEIT: Mit einer Wasserdichtigkeit von 30 Metern ist diese Uhr perfekt für den täglichen Gebrauch. Egal, ob Sie sich die Hände waschen, schwimmen oder in leichtem Regen stehen, diese Uhr hält alles aus.

ZUVERLÄSSIGES QUARZWERK: Diese Uhr ist mit einem hochwertigen Quarzwerk ausgestattet, das eine präzise und genaue Zeitmessung ermöglicht. Es sorgt für Zuverlässigkeit und gleichbleibende Leistung, damit Sie den ganzen Tag über den Zeitplan einhalten können.

ELEKTRONISCHES UND STYLISCHES DESIGN: Diese modische Uhr besticht durch ihr modernes, minimalistisches Design, das sowohl zu legeren als auch zu formellen Outfits passt. Ihre klaren Linien und ihr kühner Look machen sie perfekt für jeden stilbewussten Menschen.

LANGLEBIGER UND BEQUEMER SITZ: Diese Uhr wurde für das ganztägige Tragen konzipiert und verfügt über ein Mineralglas mit hoher Härte, das kratzfest und langlebig ist. Das glatte Oberflächenfinish sorgt für Komfort und ein elegantes Aussehen.

VIELSEITIG FÜR JEDE ANLASSUNG: Ob bei der Arbeit, in der Freizeit oder bei einer besonderen Veranstaltung, diese Uhr wertet Ihren Look mühelos auf. Ihr zeitloses Design macht sie für jede Gelegenheit geeignet.

SPEZIFIKATIONEN

Gehäuse-Material: Kunststoff

Armband Material: Kunststoff

Schließe Material: Rostfreier Stahl

Gewicht: 51.2g

Zifferblattbreite: 40.5mm

Farboptionen: Erhältlich in mehreren Farben

Paket einschließen: 1* Herren Mode Wasserdicht Quarz Uhr

HINWEISE

Die Uhr ist spritzwassergeschützt, sollte aber nicht für längere Zeit in Wasser getaucht werden, um ihre Langlebigkeit zu erhalten.

Um das Aussehen der Uhr zu erhalten, reinigen Sie das Armband und die Linse

class SpzCustomDiscountBundleProducts extends SPZ.BaseElement { constructor(element) { super(element); this.xhr_ = SPZServices.xhrFor(this.win); this.getDiscountPriceApi = "\/api\/storefront\/promotion\/calculate\/discounted_price"; this.buyNowApi = "\/api\/checkout\/order"; this.batchAtcApi = "\/api\/cart\/batch"; // æŹŸćŒäżĄæŻé›†ćˆ this.productStyleInfo = []; // ćŒčçȘ—ć†…é€‰æ‹©æŹŸćŒé›†ćˆ this.modalVariantInfo = []; this.show_classic_bundle_spu_style = false; this.bundleProducts = []; //æ†ç»‘ć•†ć“ this.bundleConfig = {}; //例æ–čæŒ‰é’źé…çœź this.discountId = ""; this.discountType = ""; this.discountInfo = ""; this.lineItems = []; this.tempCss = {}; this.renderQuickShop_ = this.win.SPZCore.Types.debounce(this.win, this.renderQuickShopModal.bind(this), 500); } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } buildCallback() { this.setupAction_(); }; init(data = []) { this.productStyleInfo = data; } handleRequestError_(data) { this.showToast(data?.message || data?.errors?.[0] || 'Unknown error'); }; showToast(message) { SPZ.whenApiDefined(document.getElementById("discount_toast")).then((apis) => { apis.showToast(message); }); } //ć€–éƒšç»„ä»¶è°ƒç”šäŒ ć€Œ setBundleData(products, config = "", id = "", type = "", info = {}) { this.bundleProducts = products; if(config) { this.bundleConfig = config; this.discountId = id; this.discountType = type; this.discountInfo = info; if(type === 'DT_CLASSIC_BUNDLE' && info.enable_min_purchase_qty && info.min_purchase_qty_type == 'spu') { this.show_classic_bundle_spu_style = true; } // ç»ć…žæ†ç»‘ćˆć§‹ćŒ–ć•†ć“æ•°æź if(type == 'DT_CLASSIC_BUNDLE') { this.productStyleInfo = products.map((item) => { return this.getFilteredVariants_(item, 'single'); }); } } } handleChangeSort() { const result = this.productStyleInfo.reduce((map, item) => { if (!map[item.product_id]) { map[item.product_id] = []; } map[item.product_id].push(item); return map; }, {}); Object.values(result).forEach((item) => { this.handleSpzVariantRender_(item, item[0].product_id); this.handleProductOption_(item[0].product_id, true); }); } // 调甚spz-tag组件的doRenderæ–čæł• handleSpzVariantRender_(data, id) { const spzVariantTag = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionSpzVariantTags-${id}`); spzVariantTag && SPZ.whenApiDefined(spzVariantTag).then((api) => { api.render(data, true); }); } // æ‰§èĄŒç»ć…žæ†ç»‘æœ€äœŽèŽ­äč°æ•°é‡æ›Žæ–° handleMinPurchaseQtyUpdate_(data, id) { const minPruchaseQty = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionMinPurchaseQty-${id}`); minPruchaseQty && SPZ.whenApiDefined(minPruchaseQty).then((api) => { api.render(data, true); }); } // 曎新价栌 updateProductPrice_(data) { const bottomBtnContainer = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionBottomContainer`); if (data.length == 0) { bottomBtnContainer && SPZ.whenApiDefined(bottomBtnContainer).then((api) => { const renderInfo = { setting: this.bundleConfig, ...{ original_price: 0, received_discounts: 0, picked_qty: 0 } } api.render({original_price: 0, received_discounts: 0}, true); }); return; } const reqBody = { discount_id: this.discountId, customer: { customer_id: '', email: '', }, sales_channel: { sale_channel_type: "online", sale_channel_id: '337152' }, line_items: data } // ćŠ‚æžœć·Č经有䞀äžȘèŻ·æ±‚ćœšç­‰ćŸ…ïŒŒé‚Łäčˆć–æ¶ˆèż™äžȘèŻ·æ±‚ if (this.debounceTimer) { clearTimeout(this.debounceTimer); } this.debounceTimer = setTimeout(() => { this.xhr_.fetchJson(this.getDiscountPriceApi, { method: "post", body: reqBody }).then((res)=>{ // æ›Žæ–°ć•†ć“ćˆ—èĄšä»·æ Œ Object.keys(res.line_items).forEach((key) => { const currentProductPrice = SPZCore.Dom.scopedQuerySelector(document.body, `#appDiscountProductPrice-${key}`); currentProductPrice && SPZ.whenApiDefined(currentProductPrice).then((api) => { api.render(res.line_items[key], true); }); }); // 曎新ćș•éƒšæŒ‰é’źæ€»ä»·/æ€»æŠ˜æ‰Łä»· const picked_qty = data.reduce((acc, item) => { return acc + item.quantity; }, 0); bottomBtnContainer && SPZ.whenApiDefined(bottomBtnContainer).then((api) => { const data = { setting: this.bundleConfig, ...{ ...res.total_price, picked_qty } } api.render(data, true); }); }).catch((err)=>{ this.handleRequestError_(err); }).finally(()=>{ }) }, 100); } // èż˜ćŽŸć•†ć“ä»·æ Œ resetProductPrice_(data) { const {price, compare_at_price, id} = data; const currentProductPrice = SPZCore.Dom.scopedQuerySelector(document.body, `#appDiscountProductPrice-${id}`); currentProductPrice && SPZ.whenApiDefined(currentProductPrice).then((api) => { api.render({total_received_discounts: price, total_price: compare_at_price}, true); }); } //怄理䞎selector组件的äș€äș’ handleProductOption_(productId, show) { const currentProductOption = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionSelectOption-${productId}`); if (!currentProductOption) { return; }; currentProductOption.toggleAttribute('show', show); const isSelected = currentProductOption.hasAttribute('selected'); // !show ć–æ¶ˆé€‰äž­ // !isSelected 选侭敆擁 if (!show || !isSelected) { const productSelector = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionProductSelector`); productSelector && SPZ.whenApiDefined(productSelector).then((api) => { api.toggle_({ option: productId, value: show }); }); } } // 混搭ćŒčçȘ—ć†…çš„ć‰ç«Żćș“ć­˜æ ĄéȘŒ handleModalInventoryCheck_(data) { if(this.discountType == 'DT_MIX_MATCH_BUNDLE' || this.discountType == 'DT_CLASSIC_BUNDLE') { const currentVariantAddNum = this.modalVariantInfo.find((item) => item.variant_id == data.variant_id)?.quantity || 0; const quickShopBody = SPZCore.Dom.scopedQuerySelector(document.body, '#apps-discount-quick-shop-body'); if(!!data.variant && currentVariantAddNum == Number(data.variant.available_quantity)) { quickShopBody && quickShopBody.setAttribute('status', 'soldout'); } else { quickShopBody && quickShopBody.setAttribute('status', 'available'); } } else { return; } } // æ·»ćŠ ć•†ć“ć­æŹŸćŒ renderVariantTag() { let variantInfo; const quickShopBody = SPZCore.Dom.scopedQuerySelector(document.body, '#apps-discount-quick-shop-body'); quickShopBody && SPZ.whenApiDefined(quickShopBody).then((api) => { variantInfo = api.getVariantsData(); const productId = variantInfo.product_id; const variantId = variantInfo.variant_id; const minPruchaseQtyRender = variantInfo.product.discount_min_purchase_qty || variantInfo.variant.discount_info.discount_min_purchase_qty; if(this.discountType === 'DT_MIX_MATCH_BUNDLE') { const index = this.productStyleInfo.findIndex((item) => item.variant_id == variantInfo.variant_id); if (index != -1) { this.productStyleInfo[index].quantity = Number(this.productStyleInfo[index].quantity) + Number(variantInfo.quantity); this.updateProductPrice_(this.productStyleInfo); } else { this.productStyleInfo.push(this.getFilteredVariants_(variantInfo)); // è‹„ćœ“ć‰ć•†ć“ć·Čé€‰äž­ïŒŒæ›Žæ–°ć•†ć“ä»·æ Œ const currentProductOption = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionSelectOption-${productId}`); const isSelected = currentProductOption && currentProductOption.hasAttribute('selected'); isSelected && this.updateProductPrice_(this.productStyleInfo); } const selectedVariantsFilter = this.productStyleInfo.filter((item) => item.product_id == productId); this.handleSpzVariantRender_(selectedVariantsFilter, productId); this.handleProductOption_(productId, true); } else { if(this.discountInfo.enable_min_purchase_qty == true && this.discountInfo.min_purchase_qty_type == 'spu' && minPruchaseQtyRender > 1) { const index = this.modalVariantInfo.findIndex((item) => item.variant_id == variantId); if (index != -1) { this.modalVariantInfo[index].quantity = Number(this.modalVariantInfo[index].quantity) + 1; } else { this.modalVariantInfo.push(this.getFilteredVariants_(variantInfo, 'classic_spu')); } const modalVariantTag = SPZCore.Dom.scopedQuerySelector(document.body, '#promotionModalVariantTagRender'); modalVariantTag && SPZ.whenApiDefined(modalVariantTag).then((api) => { api.render(this.modalVariantInfo, true); }); this.handleModalInventoryCheck_(variantInfo); const selectedVariantsNum = this.modalVariantInfo.reduce((acc, item) => { return acc + item.quantity; }, 0); if(selectedVariantsNum == minPruchaseQtyRender) { this.handleSpzVariantRender_([this.getFilteredVariants_(variantInfo)], productId); this.productStyleInfo = this.productStyleInfo.filter((item) => item.product_id != productId).concat(this.modalVariantInfo); const renderData = this.productStyleInfo.filter((item) => item.product_id == productId).map((item) => { return { ...item, is_classic_bundle_product_list_variant_tag: true } }); const classicSpuTag = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionClassicSpuTags-${productId}`); classicSpuTag && SPZ.whenApiDefined(classicSpuTag).then((api) => { api.render(renderData, true); }); this.updateProductPrice_(this.productStyleInfo); const quickView = SPZCore.Dom.scopedQuerySelector(document.body, '#apps-discount-quick-view'); quickView && SPZ.whenApiDefined(quickView).then((api)=>{ api.close(); }); this.modalVariantInfo = []; } else { return; } } // this.productStyleInfo äž­ć·Č歘朹侎productId, variantIdéƒœç›žćŒçš„ć•†ć“ ćˆ™ç›ŽæŽ„return 慳闭ćŒčçȘ— const isExist = this.productStyleInfo.some((item) => item.product_id == productId && item.variant_id == variantId); if (isExist) { const quickView = SPZCore.Dom.scopedQuerySelector(document.body, '#apps-discount-quick-view'); quickView && SPZ.whenApiDefined(quickView).then((api)=>{ api.close(); }); return; } // è‹„ this.productStyleInfo äž­ć·Č歘朹侎productIdç›žćŒçš„ć•†ć“ïŒŒćˆ™äžć†æ·»ćŠ  ćŠćˆ™æ›żæą const index = this.productStyleInfo.findIndex((item) => item.product_id == productId); if (index != -1) { this.productStyleInfo[index] = this.getFilteredVariants_(variantInfo); } else { this.productStyleInfo.push(this.getFilteredVariants_(variantInfo)); } const selectedVariantsFilter = this.productStyleInfo.filter((item) => item.product_id == productId); this.handleSpzVariantRender_(selectedVariantsFilter, productId); this.handleMinPurchaseQtyUpdate_({discount_min_purchase_qty: minPruchaseQtyRender}, productId); this.updateProductPrice_(this.productStyleInfo); } const quickView = SPZCore.Dom.scopedQuerySelector(document.body, '#apps-discount-quick-view'); quickView && SPZ.whenApiDefined(quickView).then((api)=>{ api.close(); }); }); } // ć•ć˜äœ“ç‚čć‡»æ·»ćŠ æŒ‰é’ź renderSingleVariant(data) { const { product_id } = data; const currentProduct = this.bundleProducts.find((product) => product.id == product_id); // è‹„ćœ“ć‰ć•†ć“ć·Čć­˜ćœšïŒŒćˆ™äžć†æ·»ćŠ  è€Œæ˜Żæ›Žæ–°æ•°é‡ const index = this.productStyleInfo.findIndex((item) => item.product_id == product_id); if (index != -1) { this.productStyleInfo[index].quantity = Number(this.productStyleInfo[index].quantity) + 1; this.updateProductPrice_(this.productStyleInfo); } else { this.productStyleInfo.push(this.getFilteredVariants_(currentProduct, 'single')); } const renderProductArr = this.productStyleInfo.filter((item) => item.product_id == product_id); this.handleSpzVariantRender_(renderProductArr, product_id); this.handleProductOption_(product_id, true); } // èż‡æ»€é€‰äž­ć•†ć“çš„ć­æŹŸćŒ èŽ·ć–æœ‰ç”šçš„äżĄæŻ product_id,variant_id,price,compare_at_price,quantity,title,variant_title getFilteredVariants_(data, type = '') { const { id, title, variants, inventory_tracking, inventory_policy, inventory_quantity, product_type } = data; const { product_id, variant_id, variant, quantity, product, discount_min_purchase_qty } = data; const isSingle = type == 'single'; const variantData = isSingle ? (variants[0] || data) : variant; const productData = isSingle ? data : product; let item_quantity = 0; if (this.discountType === 'DT_MIX_MATCH_BUNDLE') { item_quantity = isSingle ? 1 : Number(quantity); } else if (type === 'classic_spu') { item_quantity = 1; } else { item_quantity = discount_min_purchase_qty || productData.discount_min_purchase_qty || variantData.discount_info.discount_min_purchase_qty || 1; } return { product_id: isSingle ? id : product_id, variant_id: variantData?.id || '', price: variantData?.price || '0.00', compare_at_price: variantData?.compare_at_price || '0.00', quantity: item_quantity, inventory_tracking: productData.inventory_tracking, inventory_policy: productData.inventory_policy, inventory_quantity: productData.inventory_quantity, product_type: productData.product_type || this.bundleProducts.find((item) => item.id == product_id)?.product_type || this.bundleProducts.find((item) => item.id == id)?.product_type || '', title: productData.title, variant_title: variantData?.options.map((option) => option.value).join('/') || '', is_multi_style: productData.variants.length > 1, } } handleLoading_ (event) { const { type, action } = event; const loadingElementId = type === 'product' ? '#discount-match-drawer-products_loading' : '#apps-discount-whole-loading'; const loadingElement = document.querySelector(loadingElementId); if (loadingElement) { SPZ.whenApiDefined(loadingElement).then((api) => { if (action === 'show') { api.show_(); } else { api.close_(); } }); } } handleSelectProduct(productArr) { // 从this.productStyleInfo èż‡æ»€ć‡ș选侭的敆擁 const selectedProducts = this.productStyleInfo.filter((item) => productArr.includes(item.product_id)); this.updateProductPrice_(selectedProducts); } // æžČæŸ“ćŠ èŽ­ćŒčçȘ—憅ćźč async renderQuickShopModal(data){ this.handleLoading_({type: 'whole', action: 'show'}); this.xhr_.fetchJson(`/api/storefront/promotion/landing_page/product?product_id=${data.product_id}&discount_id=${this.discountId}&apply_scenario=1`, { method: "get", }).then(async(res)=>{ //flashäž»éą˜æ”Ÿblockæœ‰ć±‚çș§é—źéą˜ if(/Flash/.test(window.C_SETTINGS.theme.merchant_theme_name) && document.querySelector(".productInfoSection")) { this.tempCss.zIndex = document.querySelector(".product-info-body").style.zIndex; document.querySelector('.product-info-body').style.zIndex="1048"; } this.handleLoading_({type: 'whole', action: 'close'}); const $quickShop = await SPZ.whenApiDefined(document.querySelector('#apps-discount-quick-view-render')); // 漚äč‰é»˜èꀿžČæŸ“çš„ć­æŹŸćŒ const selectedVariant = res.product.variants.find((v)=> (v.available && v.is_hit_discount)) || res.product.variants[0]; let selectedValues = {}; selectedVariant.options.length && selectedVariant.options.forEach(item => { selectedValues[item.name] = item.value; }) // é»˜èź€é€‰äž­çš„ ć­æŹŸćŒă€ options res.product.defaultSelectValues = selectedValues; let data = {...res.product, product:res.product, selectedVariant, show_classic_bundle_spu_style: this.show_classic_bundle_spu_style, discountType: this.discountType}; $quickShop.render(data); // æ‰“ćŒ€ćŠ èŽ­ćŒčçȘ— SPZ.whenApiDefined(document.querySelector(`#apps-discount-quick-view`)).then((api)=>{ api.open(); }); }).catch((err)=>{ this.handleLoading_({type: 'whole', action: 'close'}); }) } // èŽ·ć–é€‰äž­çš„ć•†ć“ids getDefaultSelectorOptions_() { try { const selectedOptions = SPZCore.Dom.scopedQuerySelectorAll(document.body, '[id^="promotionSelectOption-"][selected]'); return SPZCore.Types.toArray(selectedOptions).map((item) => item.getAttribute('option')); } catch (error) { return []; } } // ćˆ é™€ć•†ć“ć­æŹŸćŒ deleteVariantTag(data) { const { product_id, variant_id } = data; if(this.discountInfo.enable_min_purchase_qty == true && this.discountInfo.min_purchase_qty_type == 'spu') { const modalProductVariants = this.modalVariantInfo.filter((item) => item.product_id == product_id && item.variant_id != variant_id); const modalVariantTag = SPZCore.Dom.scopedQuerySelector(document.body, '#promotionModalVariantTagRender'); modalVariantTag && SPZ.whenApiDefined(modalVariantTag).then((api) => { api.render(modalProductVariants, true); }); this.handleModalInventoryCheck_(data); this.modalVariantInfo = modalProductVariants; return; } const currentProductVariants = this.productStyleInfo.filter((item) => item.product_id == product_id && item.variant_id != variant_id); this.handleSpzVariantRender_(currentProductVariants, product_id); // 曎新selectedVariants this.productStyleInfo = this.productStyleInfo.filter((item) => item.variant_id != variant_id); if(currentProductVariants.length > 0) { // currentProductVariants äž­ćȘ芁有䞀éĄčæ˜Żć€šæŹŸćŒć•†ć“ïŒŒć°±æ›Žæ–°ä»·æ Œ const isMultiStyle = currentProductVariants.some((item) => item.is_multi_style); if (!isMultiStyle) return; this.handleProductOption_(product_id, true); const selected = this.getDefaultSelectorOptions_(); this.updateProductPrice_(this.productStyleInfo.filter((item) => selected.includes(item.product_id))); } else { this.handleProductOption_(product_id, false); this.resetProductPrice_(this.bundleProducts.find((item) => item.id == product_id)); } } // ćŠ èŽ­ćŒčçȘ—æœȘć‚äžŽæŽ»ćŠš ćŠ èŽ­æŒ‰é’źäžćŻç‚č懻 TODO 拆ć‡ș杄 handleNotHitDiscount_(data) { const $quickShopBody = document.querySelector('#apps-discount-quick-shop-body'); //ćœ“ć‰ć­æĄ†ćŒæœȘć‘œäž­æŽ»ćŠš if(data.variant.is_hit_discount == false) { $quickShopBody.setAttribute('variantstatus', 'notHitDiscount') } else { $quickShopBody.setAttribute('variantstatus', '') } } setupAction_() { // ć­æŹŸćŒ æœȘć‚äžŽæŽ»ćŠš this.registerAction('handleNotHitDiscount', (invocation) => { const data = invocation.args.data; this.handleNotHitDiscount_(data); }); // æžČæŸ“ćŠ èŽ­ćŒčçȘ— this.registerAction('renderQuickShop', (invocation) => { const data = invocation.args; this.renderQuickShop_(data); }); this.registerAction('renderSingleVariant', (invocation) => { const data = invocation.args; this.renderSingleVariant(data); }); this.registerAction('getVariantInfo', (invocation) => { this.renderVariantTag(); }); this.registerAction('deleteVariantTag', (invocation) => { const data = invocation.args; this.deleteVariantTag(data); }); this.registerAction('getSelectedProduct', (invocation) => { const data = invocation.args.data; this.handleSelectProduct(data); }); //TODO ćŠ èŽ­äž‹ć•é€»èŸ‘ć•ç‹Źæ‹†ç»„ä»¶ this.registerAction('handleClick', (data) => { if(this.discountType == 'DT_CLASSIC_BUNDLE') { this.lineItems = this.productStyleInfo; } else { const selectedOptions = SPZCore.Dom.scopedQuerySelectorAll(document.body, '[id^="promotionSelectOption-"]'); const idArr = [...selectedOptions].reduce((acc, item) => { if (item.hasAttribute('selected')) { const optionValue = item.getAttribute('option'); if (optionValue) { acc.push(optionValue); } } return acc; }, []); this.lineItems = this.productStyleInfo.filter((item) => idArr.includes(item.product_id)); } const action = data.args.action === "cart"; if(action) { //add to cart this.xhr_ .fetchJson(this.batchAtcApi, { method: 'POST', body: { line_items: this.lineItems.map((item) => { return { product_id: item.product_id, variant_id: item.variant_id, quantity: Number(item.quantity) } }) } }) .then((data) => { setTimeout(() => { window.location.href = '/cart'; }); }) .catch(async (error) => { await error.then((data) => { this.handleRequestError_(data); }); }); } else { //checkout this.xhr_ .fetchJson(this.buyNowApi, { method: 'POST', body: { line_items: (this.lineItems || []).map((product) => { return { quantity: Number(product.quantity), variant_id: product.variant_id, note: product.note || '', properties: product.properties || {} } }), refer_info: { source: 'buy_now' } } }) .then(async (data) => { if (data.state === 'success') { window.location.href = data.data?.checkout_url; } this.handleRequestError_(data); }) .catch(async (error) => { await error.then((data) => { this.handleRequestError_(data); }); }); } }); this.registerAction('resetModalVariantInfo', () => { //flashäž»éą˜æ”Ÿblockæœ‰ć±‚çș§é—źéą˜ if(/Flash/.test(window.C_SETTINGS.theme.merchant_theme_name) && document.querySelector(".productInfoSection")) { document.querySelector('.product-info-body').style.zIndex = this.tempCss.zIndex; } this.modalVariantInfo = []; }); this.registerAction('handleModalInventoryCheck', (invocation) => { const data = invocation.args.data; this.handleModalInventoryCheck_(data); }); }; }; SPZ.defineElement('spz-custom-discount-bundle-products', SpzCustomDiscountBundleProducts);
class SpzCustomDiscountBundle extends SPZ.BaseElement { constructor(element) { super(element); this.xhr_ = SPZServices.xhrFor(this.win); this.variant_id = '85139eea-dd4d-48d9-87ae-f568459d6abd'; this.discountCardApi = "\/api\/storefront\/promotion\/product_details_page\/card"; this.productsApi = "\/api\/storefront\/promotion\/product_page\/product\/list"; this.bundleRenderElement = "appDiscountProductBundle"; this.model = { loading: false, page: 2, limit: 20, params: { count: 0, has_more: false, sort: { by: "price", direction: "asc" } } } this.discountId = ""; this.discountType = ""; this.bundleProducts = []; //æ†ç»‘æŽ»ćŠšć•†ć“ this.buttomConfig = {};//æ€»ä»·ćŠäž‹æ–čæŒ‰é’źé…çœź this.renderDiscount = this.win.SPZCore.Types.debounce(this.win, this.discountHandel.bind(this) , 500); } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } async getDiscountCardList() { const productId = '48fb136a-bf1f-4c45-8490-1c6c28cf0e10'; const productType = ''; const variantId = this.variant_id; const reqBody = { product_id: productId, variant_id: variantId, discount_types: ["DT_CLASSIC_BUNDLE","DT_MIX_MATCH_BUNDLE"], discount_methods: ["DM_AUTOMATIC"], customer: { customer_id: '', email: '', }, product_type: productType } const data = await this.xhr_.fetchJson(this.discountCardApi, { method: "post", body: reqBody }).then(res => { return res; }).catch(err => { console.error(err); }) return data; }; async discountHandel() { const $bundle = document.querySelector(".app-discount-bundle-inner"); $bundle && SPZCore.Dom.removeElement($bundle); const data = await this.getDiscountCardList(); if(!data.discount_info || data.discount_info.discount_id === "0") { return; } //ć˜é‡è”‹ć€Œ this.bundleProducts = data.product_info.product; this.buttomConfig = data.product_setting; this.discountId = data.discount_info.discount_id; this.discountType = data.discount_info.discount_type; this.model.params ={ count: data.product_info.count, has_more: data.product_info.has_more, sort: data.product_info.sort } //ç»™æ†ç»‘ç»„ä»¶äŒ ć€Œ SPZ.whenApiDefined(document.getElementById("appDiscountBundleProductsFunc")).then((api) => { api.setBundleData(this.bundleProducts, this.buttomConfig, this.discountId, this.discountType, data.discount_info); }) document.querySelector(".app_discount_bundle").dataset.discountType = data.discount_info.discount_type; SPZ.whenApiDefined(document.getElementById(this.bundleRenderElement)) .then(apis => { apis.render(data,true).then(() => { SPZ.whenApiDefined(document.getElementById("bundleProductsRender")).then((api) => { api.render(data,true).then(() => { this.bindEvent_(); if(this.bundleProducts.length < 5) { document.querySelector(".app-discount-bundle-arrow-left").style.display="none"; document.querySelector(".app-discount-bundle-arrow-right").style.display="none"; } //ç»ć…žæ†ç»‘æžČæŸ“æŒ‰é’ź if(this.discountType === "DT_CLASSIC_BUNDLE") { SPZ.whenApiDefined(document.getElementById("promotionBottomContainer")).then((api) => { const buttonData = { setting: this.buttomConfig, ...data.product_info.total_price } api.render(buttonData, true); }) } }) }) }) .then(() => { document.querySelector(".app-discount-bundle-inner").classList.add("discount_bundle_" + data.product_setting.template_type || "vertical"); }); }); //æœŹćœ°è°ƒèŻ• æ”Ÿć•†èŻŠblock里 const isSection = document.querySelector( 'div[data-section-type^="shoplazza://apps/publicapp/blocks/discount_bundle/"] .app_discount_bundle' ); if(!isSection) { document.querySelector(".app_discount_bundle").classList.add("productInfoSection"); } }; // èŽ·ć–ćŠ èœœçš„ć•†ć“æ•°æźïŒŒæ‹ŒæŽ„htmlæšĄæż async loadData(cb) { // èŻ·æ±‚æ•°æź this.model.loading = true; //æŸ„èŻąæŽ»ćŠšć•†ć“æŽ„ćŁ const reqBody = { discount_id: this.discountId, page: this.model.page, limit: this.model.limit, "apply_scenario": "AS_ENTITLED_PRODUCT", sort: this.model.params.sort, sales_channel: { sale_channel_type: "online", sale_channel_id: '337152' }, product_id: '48fb136a-bf1f-4c45-8490-1c6c28cf0e10' } this.xhr_.fetchJson(this.productsApi, { method: "post", body: reqBody }).then(async(res)=>{ const count = res.count; this.model.params.has_more = res.has_more; if (count > 0) { this.model.page++; if (res.products && res.products.length > 0) { let products = res.products.map((product) => { return { ...product, url: appDiscountUtils.globalizePath(product.url), image_padding_bottom: appDiscountUtils.image_padding_bottom(product.image.width, product.image.height,'no-limit'), discount_type: this.discountType } }); // èŽ·ć–ć•†ć“ćˆ—èĄšæžČæŸ“æšĄæż, dom挂蜜 const $content = document.querySelector(".app-discount-bundle-products"); this.templates_ = SPZServices.templatesForDoc(); this.templates_.renderTemplate(document.querySelector('#appDiscountBundleProductsTemplate'), products).then((el) => { const childNodes = el.querySelectorAll('.as-render-product-item'); if (childNodes && childNodes.length > 0) { $content.append(...childNodes); } }).then(() => { //重新æžČ染ljs-selector const productSelector = SPZCore.Dom.scopedQuerySelector(document.body, `#promotionProductSelector`); productSelector && SPZ.whenApiDefined(productSelector).then((api) => { api.init(); }); }); this.bundleProducts = [...this.bundleProducts, ...res.products]; SPZ.whenApiDefined(document.getElementById("appDiscountBundleProductsFunc")).then((api) => { api.setBundleData(this.bundleProducts); }) // 监搬loadćŽ»æŽ‰ç°è‰ČèƒŒæ™Ż document.dispatchEvent(new CustomEvent('fire.load.img')); // è§Šć‘æ‡’ćŠ èœœ cb && cb(products); window.lazyLoadInstance && window.lazyLoadInstance.update(); } } this.model.loading = false; }).catch((err)=>{ console.error(err); this.model.loading = false; }) }; setupAction_() { this.registerAction('shiftMove', (data) => { const $el = document.querySelector(".app-discount-bundle-products"); const action = data.args.direct === "right"; const scrollwidth = action ? $el.offsetWidth : -$el.offsetWidth; $el.scrollBy({ left: scrollwidth, behavior: 'smooth' }); }); }; bindEvent_() { // ç›‘ćŹć­æŹŸćŒćˆ‡æąïŒŒé‡æ–°æžČ染 document.addEventListener('dj.variantChange', async(event) => { const variant = event.detail.selected; if (variant.product_id == '48fb136a-bf1f-4c45-8490-1c6c28cf0e10') { this.variant_id = variant.id; } this.renderDiscount(); }); // ç›‘ćŹæ»šćŠšïŒŒèŻ·æ±‚æ•°æź const $el = document.querySelector(".app-discount-bundle-products"); if($el) { $el.addEventListener("scroll", this.win.SPZCore.Types.debounce( this.win, () => { const isLeft = $el.scrollLeft === 0; const isRightEnd = $el.scrollLeft + $el.offsetWidth + 10 >= $el.scrollWidth; const isBottomEnd = $el.scrollTop + $el.clientHeight + 10 >= $el.scrollHeight; const isEnd = isBottomEnd && isRightEnd; if(isEnd && this.model.params.has_more && !this.model.loading) { this.loadData(); } }, 50 )) }; }; buildCallback() { this.setupAction_(); }; mountCallback() { this.renderDiscount(); this.bindEvent_(); }; } SPZ.defineElement('spz-custom-discount-bundle', SpzCustomDiscountBundle);
Kundenbewertungen

Das sagen unsere Kunden:

Kommentare veröffentlichen
Bewertungen der Kunden
Wow, du bist ganz unten angekommen
Neueste
Am meisten gemocht
Höchste Bewertungen
Niedrigste Bewertungen
×
class SpzCustomFileUpload extends SPZ.BaseElement { constructor(element) { super(element); this.uploadCount_ = 0; this.fileList_ = []; } buildCallback() { this.action = SPZServices.actionServiceForDoc(this.element); this.registerAction('upload', (data) => { this.handleFileUpload_(data.event?.detail?.data || []); }); this.registerAction('delete', (data) => { this.handleFileDelete_(data?.args?.data); }); this.registerAction('preview', (data) => { this.handleFilePreview_(data?.args?.data); }); this.registerAction('limit', (data) => { this.handleFileLimit_(); }); this.registerAction('sizeLimit', (data) => { this.handleFileSizeLimit_(); }); } isLayoutSupported(layout) { return layout == SPZCore.Layout.LOGIC; } setData_(count, file) { this.uploadCount_ = count; this.fileList_ = file; } handleFileUpload_(data) { data.forEach(i => { if(this.fileList_.some(j => j.url === i.url)) return; this.fileList_.push(i); }) this.uploadCount_++; sessionStorage.setItem('fileList', JSON.stringify(this.fileList_)); this.triggerEvent_("handleFileUpload", { count: this.uploadCount_, files: this.fileList_}); if(this.fileList_.length >= 5){ document.querySelector('#review_upload').style.display = 'none'; } if(this.fileList_.length > 0){ document.querySelector('.apps-reviews-write-anonymous-box').style.marginTop = '8px'; } } handleFileDelete_(index) { this.fileList_.splice(index, 1); this.uploadCount_--; sessionStorage.setItem('fileList', JSON.stringify(this.fileList_)); this.triggerEvent_("handleFileDelete", { count: this.uploadCount_, files: this.fileList_}); document.querySelector('#review_upload').style.display = 'block'; if(this.fileList_?.length === 0){ document.querySelector('.apps-reviews-write-anonymous-box').style.marginTop = '132px'; } } handleFilePreview_(index) { const finalPreviewData = this.fileList_[index]; const filePreviewModal = document.getElementById('filePreviewModal'); const fullScreenVideo = document.getElementById('fullScreenVideo'); const fullScreenImage = document.getElementById('fullScreenImage'); const previewModalClose = document.getElementById('previewModalClose'); const previewLoading = document.getElementById('previewLoading'); filePreviewModal.style.display = 'block'; previewLoading.style.display = 'flex'; if(finalPreviewData?.type === 'video'){ const media = this.mediaParse_(this.fileList_[index]?.url); fullScreenVideo.addEventListener('canplaythrough', function() { previewLoading.style.display = 'none'; }); fullScreenImage.src = ''; fullScreenImage.style.display = 'none'; fullScreenVideo.style.display = 'block'; fullScreenVideo.src = media.mp4 || ''; } else { fullScreenImage.onload = function() { previewLoading.style.display = 'none'; }; fullScreenVideo.src = ''; fullScreenVideo.style.display = 'none'; fullScreenImage.style.display = 'block'; fullScreenImage.src = finalPreviewData.url; } previewModalClose.addEventListener('click', function() { filePreviewModal.style.display = 'none'; }); } handleFileLimit_() { alert(window.AppReviewsLocale.comment_file_limit || 'please do not upload files more than 5'); this.triggerEvent_("handleFileLimit"); } handleFileSizeLimit_() { alert(window.AppReviewsLocale.comment_file_size_limit || 'File size does not exceed 10M'); } clear(){ this.fileList_ = []; this.uploadCount_ = 0; sessionStorage.setItem('fileList', JSON.stringify(this.fileList_)); this.triggerEvent_("handleClear", { count: this.uploadCount_, files: this.fileList_}); document.querySelector('#review_upload').style.display = 'block'; } mediaParse_(url) { var result = {}; try { url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) { try { result[key] = decodeURIComponent(value); } catch (e) { result[key] = value; } }); result.preview_image = url.split('?')[0]; } catch (e) {}; return result; } triggerEvent_(name, data) { const event = SPZUtils.Event.create(this.win, name, data); this.action.trigger(this.element, name, event); } } SPZ.defineElement('spz-custom-file-upload', SpzCustomFileUpload);
The review would not show in product details on storefront since it does not support to.