🎁EXTRA 5% DISCOUNT FOR NEW USERS | COUPON CODE: NEW5

🎁EXTRA 5% DISCOUNT FOR NEW USERS | COUPON CODE: NEW5

  • Log in
  • Create an account
  • Home
  • NEW
  • BEST SELLER
  • HONLIDAY
  • 👗DRESS
  • MIN & MATCH
  • SWIMSUIT🩱
  • ACCESSORIES
  • More links

  • Log in
  • Create an account
  • Home
  • NEW
  • BEST SELLER
  • HONLIDAY
  • 👗DRESS
  • MIN & MATCH
  • SWIMSUIT🩱
  • ACCESSORIES
  • Log in
  • Create an account
  • (function(){ let w = window.innerWidth; function setHeaderCssVar() { const headerEle = document.getElementById('shoplaza-section-header'); if(!headerEle){ return }; document.body.style.setProperty('--window-height', `${window.innerHeight}px`); document.body.style.setProperty('--header-height', `${headerEle.clientHeight}px`); const mdScorllHideEle = headerEle.querySelector('.header__mobile .header__scroll_hide'); if (mdScorllHideEle) { document.body.style.setProperty('--header-scroll-hide-height-md', `${mdScorllHideEle.clientHeight}px`); } const pcScorllHideEle = headerEle.querySelector('.header__desktop .header__scroll_hide'); if (pcScorllHideEle) { document.body.style.setProperty('--header-scroll-hide-height-pc', `${pcScorllHideEle.clientHeight}px`); } } function handlResize() { if(w == window.innerWidth){return}; w = window.innerWidth; setHeaderCssVar(); }; function init(){ setHeaderCssVar(); window.removeEventListener('resize', window._theme_header_listener) window._theme_header_listener = handlResize; window.addEventListener('resize', window._theme_header_listener); } init(); })();

    Hot sale

    View more
    View more

    Secret Garden Maxi Dress

    $49.99

    Tea Time Maxi Dress

    $49.99

    Summer Picnic Set

    $53.99

    Salt Water Whispers Maxi Dress

    $42.99

    Salt Water Whispers Maxi Dress Black

    $42.99
    Save 33% Save 33%

    Pink Mix Flower Print Mini Dress

    $39.99 $59.99

    Light Pink Toile Print Dress

    $38.99
    Save 51% Save 51%

    Lace V-neck Short Casual Dress

    $47.99 $97.99 +3
    Save 46% Save 46%

    Uncle Frank Pink Tropical Borders Dress

    $39.99 $73.89
    Save 43% Save 43%

    Shades of blue linen hibiscus print button down midi dress

    $39.99 $69.99
    Save 25% Save 25%

    Light Denim Puff Sleeve Button Down Maxi Dress

    $59.99 $79.99
    Save 33% Save 33%

    Ruffle shoulder shorts set

    $39.99 $59.99 +2
    Save 33% Save 33%

    Solid Close-Up Dress

    $39.99 $59.99
    Save 33% Save 33%

    Pink Floral Flutter Sleeve Midi Dress

    $39.99 $59.99
    Save 43% Save 43%

    Ivory and Pink Striped Relaxed Midi Dress

    $39.99 $69.99
    Save 43% Save 43%

    Sleeveless spaghetti strap ruffled striped pajama set

    $39.99 $69.99

    Holiday fashion

    Dark Denim Midi Dress

    $56.99
    Save 46% Save 46%

    Uncle Frank Pink Tropical Borders Dress

    $39.99 $73.89
    Save 25% Save 25%

    Light Denim Puff Sleeve Button Down Maxi Dress

    $59.99 $79.99
    Save 41% Save 41%

    Blue Mixed Print Puff Sleeve Midi Dress

    $46.89 $79.99
    Save 33% Save 33%

    Pink USA Patch Pearl Pullover Top

    $39.99 $59.99
    Save 43% Save 43%

    Ivory and Pink Striped Relaxed Midi Dress

    $39.99 $69.99
    Save 6% Save 6%

    Ivory and Pink Leopard Flower Top

    $46.99 $49.99
    Save 29% Save 29%

    Pink Striped Ruffle Maxi Dress

    $49.99 $69.99

    Dark Denim Midi Dress

    $56.99
    Save 46% Save 46%

    Uncle Frank Pink Tropical Borders Dress

    $39.99 $73.89
    Save 25% Save 25%

    Light Denim Puff Sleeve Button Down Maxi Dress

    $59.99 $79.99
    Save 41% Save 41%

    Blue Mixed Print Puff Sleeve Midi Dress

    $46.89 $79.99
    View more

    👗Dresses

    Save 33% Save 33%

    Green Mix Tropical Print Mini Dress

    $39.99 $59.99
    Save 33% Save 33%

    ALESSANDRA AZTEC MIDI DRESS

    $39.99 $59.99
    Save 37% Save 37%

    LE LEOPARD DRESS

    $37.99 $59.99

    Light Pink Toile Print Dress

    $38.99
    Save 44% Save 44%

    Floral Print V-neck Printed Casual Dress

    $32.99 $59.00 +2
    Save 37% Save 37%

    Hola Hotel Button Maxi Dress

    $43.99 $69.99
    Save 43% Save 43%

    Delicate Timing Floral Maxi Dress Blush

    $39.99 $69.99
    Save 33% Save 33%

    Blue Printed Short Sleeve Dress

    $39.99 $59.99
    Save 33% Save 33%

    Pink eyelet embroidered shirt dress

    $39.99 $59.99
    Save 39% Save 39%

    Paradise Twist Front Maxi Dress Blue Multi

    $42.99 $69.99
    Save 37% Save 37%

    Pink Flower Print Midi Dress

    $43.89 $69.99
    Save 26% Save 26%

    Women's V-neck Printed Loose Maxi Dress

    $36.99 $49.99
    Save 33% Save 33%

    Green Mix Tropical Print Mini Dress

    $39.99 $59.99
    Save 33% Save 33%

    ALESSANDRA AZTEC MIDI DRESS

    $39.99 $59.99
    Save 37% Save 37%

    LE LEOPARD DRESS

    $37.99 $59.99

    Light Pink Toile Print Dress

    $38.99
    Save 44% Save 44%

    Floral Print V-neck Printed Casual Dress

    $32.99 $59.00 +2
    Save 37% Save 37%

    Hola Hotel Button Maxi Dress

    $43.99 $69.99
    View more

    swimsuits

    View more
    View more
    Save 23% Save 23%

    Summer Fashion High Waist Bikini Set

    $32.98 $42.99
    Save 23% Save 23%

    Hippie Print Bikini Set

    $31.99 $41.80
    Save 38% Save 38%

    Printed Twist Cutout Bikini

    $27.99 $45.44
    Save 36% Save 36%

    Brown Retro Two-Piece Bikini Set

    $31.99 $49.99

    Orange western print V-neck bikini

    $31.77
    Save 28% Save 28%

    Cow Skull Print Hhigh-waisted Bikini

    $32.98 $45.99

    Vintage Cactus Print Bikini

    $32.98

    Green Geometric Print Bikini Set

    $31.98
    Save 18% Save 18%

    Black Ethnic Print Bikini Set

    $31.98 $38.98
    Save 18% Save 18%

    Wallen Western Cow Skull Two-Piece Bikini Set

    $32.90 $39.90
    Save 23% Save 23%

    Colorful Aztec Print Bikini Set

    $31.99 $41.80
    Save 46% Save 46%

    Western Print Swimsuit Set

    $36.99 $69.00

    Western Print Bikini Set

    $31.56
    Save 36% Save 36%

    Western Pattern Retro Print Shorts

    $22.99 $35.99 +1

    Vintage Blue Cowboy Print Bikini

    $32.98
    Save 49% Save 49%

    Old School Camo Women’s Swim Bikini

    $29.99 $59.00

    Accessories

    Retro French Style Color Oil Heart-shaped Earrings

    $20.35
    Save 50% Save 50%

    Women's Sunflower Diamond Bracelet

    $9.99 $19.99

    Christmas tree all-match fashion earrings

    $17.63
    Save 30% Save 30%

    Women's Retro Personalized Irregular Sunglasses

    $6.99 $9.99 +10

    Handcrafted Pearl Twining Semicircle Earrings

    $21.27
    Save 46% Save 46%

    Gold Metal Full Rim Frame Sunglasses

    $6.99 $12.99 +1
    Save 45% Save 45%

    Christmas Antlers Dog Earrings

    $10.99 $19.99

    Vintage Diamond Lucky Eye Ring

    $12.01

    French Style Vintage Forest Green Oil Drop Earrings

    $27.11

    Elegant Exaggerate Glaring Hoop Earrings

    $16.63 +4

    Heavy duty butterfly necklace with retro atmosphere

    $17.99

    Retro Geometric Eight-pointed Star Alloy Diamond Hollow Stud Earring

    $16.99

    Retro French Style Color Oil Heart-shaped Earrings

    $20.35
    Save 50% Save 50%

    Women's Sunflower Diamond Bracelet

    $9.99 $19.99

    Christmas tree all-match fashion earrings

    $17.63
    Save 30% Save 30%

    Women's Retro Personalized Irregular Sunglasses

    $6.99 $9.99 +10

    Handcrafted Pearl Twining Semicircle Earrings

    $21.27
    Save 46% Save 46%

    Gold Metal Full Rim Frame Sunglasses

    $6.99 $12.99 +1
    View more

    Subscribe today to hear first about our sales

    Please enter a valid email address.
    Please enter your email address.
    Thanks for subscribing

    Help&Supports

    • About Us
    • Shipping Information
    • Privacy Policy
    • Return Policy
    • INTELLECTUAL PROPERTY RIGHTS
    • Terms & Conditions
    • Contact Us

    Help&Supports

    • About Us
    • Shipping Information
    • Privacy Policy
    • Return Policy
    • INTELLECTUAL PROPERTY RIGHTS
    • Terms & Conditions
    • Contact Us

    Menu Navigation

    • Home
    • NEW
    • BEST SELLER
    • HONLIDAY
    • 👗DRESS
    • MIN & MATCH
    • SWIMSUIT🩱
    • ACCESSORIES

    Menu Navigation

    • Home
    • NEW
    • BEST SELLER
    • HONLIDAY
    • 👗DRESS
    • MIN & MATCH
    • SWIMSUIT🩱
    • ACCESSORIES

    Get in touch

    • cacuse@svip-support.com

    Get in touch

    • cacuse@svip-support.com

    We accept

    • American Express
    • Apple Pay
    • Mastercard
    • PayPal
    • Google Pay
    • Dankort
    • Discover
    • Dwolla
    • JCB
    • Klarna
    • Maestro
    • Visa

    We accept

    • American Express
    • Apple Pay
    • Mastercard
    • PayPal
    • Google Pay
    • Dankort
    • Discover
    • Dwolla
    • JCB
    • Klarna
    • Maestro
    • Visa
    © 2025 cacuse About Us Shipping Information Privacy Policy Return Policy INTELLECTUAL PROPERTY RIGHTS Terms & Conditions Contact Us
    View Cart
    const TAG = "spz-custom-popup"; const DISPLAY_TYPE = { POPUP: "PTT_POPUP" // 弹窗 }; const API = { LIST: `/api/storefront/promotion/placement/list`, // 获取弹窗列表 REPORT: `/api/storefront/promotion/placement/data/report` // 上报数据 }; const DISPLAY_DEVICE = { PC_AND_MOBILE: "PD_PC_MOBILE", // PC和移动端 PC: "PD_PC", // PC MOBILE: "PD_MOBILE" // 移动端 }; const REPORT_EVENT = { CLICK: "PE_CLICK", // 点击事件 IMPRESSION: "PE_IMPRESSION" // 曝光事件 }; class SpzCustomPopup extends SPZ.BaseElement { constructor(element) { super(element); this.popupList_ = []; // 弹窗数据 this.popupZIndex = 1050; // 弹窗层级 // 节流处理 每5s内多次点击 算一次点击上报 this.throttleReport = this.win.SPZCore.Types.throttle( this.win, (data) => { this.reportData(data) }, 5000 ) } static deferredMount() { return false; } buildCallback() { this.action_ = SPZServices.actionServiceForDoc(this.element); this.templates_ = SPZServices.templatesForDoc(this.element); this.xhr_ = SPZServices.xhrFor(this.win); this.setupAction_(); this.viewport_ = this.getViewport(); } mountCallback() { this.fetchData_(); } // 接口请求,获取数据 fetchData_() { const id = window.SHOPLAZZA.meta.page.template_type === 51 ? window.SHOPLAZZA.meta.page.resource_id : 0; return this.xhr_.fetchJson(API.LIST, { method: 'POST', body: { page_id: window.SHOPLAZZA.meta.page.template_type, placement_type: DISPLAY_TYPE.POPUP, discount_id: id } }).then((res) => { // 请求成功 执行render this.doRender_(res.list); }).catch((err) => { console.error(err); }); } // 渲染dom doRender_(data) { this.popupList_ = data || []; if (this.popupList_.length > 0) { this.popupList_.forEach((item) => { item.config = JSON.parse(item.config); }) } return this.templates_ .findAndRenderTemplate(this.element, { list: this.popupList_ }) .then((el) => { const children = this.element.querySelector('*:not(template)'); children && SPZCore.Dom.removeElement(children); this.element.appendChild(el); }) .then(() => { // 遍历显示弹窗 this.popupList_.forEach((item) => { this.showPopup_(item); }); }) } showPopup_(popup) { // 展示弹窗 符合展示条件的弹窗 const $popup = document.querySelector(`#popup-${popup.id}`); $popup && SPZ.whenApiDefined($popup).then((api)=> { const isPC = this.viewport_.getWidth() >= 960; const isMobile = this.viewport_.getWidth() < 960; const isMatchPCDevice = popup.device === DISPLAY_DEVICE.PC_AND_MOBILE || popup.device === DISPLAY_DEVICE.PC; const isMatchMobileDevice = popup.device == DISPLAY_DEVICE.PC_AND_MOBILE || popup.device === DISPLAY_DEVICE.MOBILE; if((isPC && isMatchPCDevice) || (isMobile && isMatchMobileDevice)) { // 根据推送时间 延迟展示弹窗 setTimeout(() => { api.open(); }, popup.delay_seconds * 1000); } }) } // 上报数据 async reportData(data) { this.xhr_.fetchJson(API.REPORT, { method: "POST", body: { placement_id: data.placement_id, event: data.event } }); } setupAction_() { this.registerAction('handleTrack', async(invocation) => { // 如果是主题编辑器则不用处理 if(window.top !== window.self) { return; } const data = invocation.args; const event = data.event; // 点击上报 节流处理 if(event === REPORT_EVENT.CLICK) { await this.throttleReport(data); } else { this.reportData(data); } }); } triggerEvent_(name, data) { const event = SPZUtils.Event.create(this.win, `${ TAG }.${ name }`, data || {}); this.action_.trigger(this.element, name, event); } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } } SPZ.defineElement(TAG, SpzCustomPopup);
    const TAG = "spz-custom-announcement"; const DISPLAY_TYPE = { ANNOUNCEMENT: "PTT_BANNER" // 公告栏 }; const API = { LIST: `/api/storefront/promotion/placement/list`, // 获取公告栏列表 REPORT: `/api/storefront/promotion/placement/data/report` // 上报数据 }; const DISPLAY_DEVICE = { PC_AND_MOBILE: "PD_PC_MOBILE", // PC和移动端 PC: "PD_PC", // PC MOBILE: "PD_MOBILE" // 移动端 }; const REPORT_EVENT = { CLICK: "PE_CLICK", // 点击事件 IMPRESSION: "PE_IMPRESSION" // 曝光事件 }; const POSITION = { TOP: "PP_TOP", // 顶部 BOTTOM: "PP_BOTTOM" // 底部 } const MODE = { FIXED: "PM_FIXED", // 固定 NORMAL: "PM_SCROLLING" // 滚动 } const THEME_NAME = window.SHOPLAZZA.theme.merchant_theme_name; class SpzCustomAnnouncement extends SPZ.BaseElement { constructor(element) { super(element); this.announcementList_ = []; // 公告栏数据 } static deferredMount() { return false; } buildCallback() { this.action_ = SPZServices.actionServiceForDoc(this.element); this.templates_ = SPZServices.templatesForDoc(this.element); this.xhr_ = SPZServices.xhrFor(this.win); this.setupAction_(); this.viewport_ = this.getViewport(); } mountCallback() { this.fetchData_(); this.createAnnouncementDom_(); this.listenCartChange_(); } fetchData_(type = '') { const id = window.SHOPLAZZA.meta.page.template_type === 51 ? window.SHOPLAZZA.meta.page.resource_id : 0; return this.xhr_.fetchJson(API.LIST, { method: 'POST', body: { page_id: window.SHOPLAZZA.meta.page.template_type, placement_type: DISPLAY_TYPE.ANNOUNCEMENT, discount_id: id } }).then((res) => { this.announcementList_ = res.list || []; if (this.announcementList_.length > 0) { this.announcementList_.forEach((item) => { item.config = JSON.parse(item.config); }); } if(type === 'cartChange') { this.announcementList_.forEach((item) => { this.updateText_(item); }); } else { this.doRender_(this.announcementList_); } }).catch((error) => { console.error(error); }) } doRender_(data) { return this.templates_ .findAndRenderTemplate(this.element, { list: this.announcementList_ }) .then((el) => { const children = this.element.querySelector('*:not(template)'); children && SPZCore.Dom.removeElement(children); this.element.appendChild(el); }) .then(() => { this.announcementList_.forEach((item) => { this.showAnnouncement_(item); }); }).then(() => { this.handleThemeCompatibility_(); }); } // 更新文案 updateText_(item) { const announcement = document.querySelector(`#announcement-${item.id}`); const announcementText = announcement.querySelectorAll('.announcement_text'); const textArr = item.config.text_discount.replace_texts; const textDom = textArr.map((text) => { return `${text}`; }).join(','); announcementText.forEach((text) => { text.innerHTML = textDom; }); } // 创建公告栏dom createAnnouncementDom_() { const isHero = /Hero/.test(THEME_NAME); const isEva = /Eva/.test(THEME_NAME); const headerEl = document.querySelector('[data-section-type="header"]'); const headerSticky = headerEl && SPZCore.Dom.computedStyle(this.win, headerEl).position === 'sticky'; // 创建滚动的底部公告栏 const announcementBottomContainer = document.createElement('div'); announcementBottomContainer.className = 'announcement__container_bottom bootstrap'; document.body.appendChild(announcementBottomContainer); // 创建固定的底部公告栏 const announcementBottomSticky = document.createElement('ljs-sticky'); announcementBottomSticky.className = 'announcement__container_bottom-sticky'; announcementBottomSticky.setAttribute('layout', 'container'); announcementBottomSticky.setAttribute('position', 'bottom'); announcementBottomSticky.style.position = 'fixed'; announcementBottomSticky.style.bottom = '0'; announcementBottomSticky.style.left = '0'; announcementBottomSticky.style.right = '0'; announcementBottomSticky.style.zIndex = '1030'; document.body.appendChild(announcementBottomSticky); const announcementTopContainer = document.createElement('div'); announcementTopContainer.classList.add('announcement__container_top'); if (isHero) { announcementTopContainer.classList.add('announcement__container_top_zIndex_1030'); } announcementTopContainer.classList.add('bootstrap'); document.body.insertBefore(announcementTopContainer, document.body.children[0]); const announcementTopFixedContainer = document.createElement('div'); announcementTopFixedContainer.classList.add('announcement__container_top-fixed'); if (isHero) { announcementTopFixedContainer.classList.add('announcement__container_top_zIndex_1030'); } announcementTopFixedContainer.classList.add('bootstrap'); const insertBeforeElement = headerSticky ? headerEl : document.body; insertBeforeElement.insertBefore(announcementTopFixedContainer, insertBeforeElement.children[0]); if (isEva) { const evaHeader = document.querySelector('header.header'); const isEvaMaskHeader = evaHeader && SPZCore.Dom.computedStyle(this.win, evaHeader).position === 'absolute'; let fixedBannerTopContainer = document.querySelector('.announcement__container_top-fixed'); if (isEvaMaskHeader) { if (fixedBannerTopContainer) { fixedBannerTopContainer.remove(); } const newBanner = document.createElement('div'); newBanner.className = 'announcement__container_top-fixed bootstrap'; document.body.insertBefore(newBanner, document.body.firstChild); fixedBannerTopContainer = newBanner; } else { if (!headerEl) return; const observer = new MutationObserver(() => { const isSticky = SPZCore.Dom.computedStyle(this.win, headerEl).position === 'sticky'; if (!isSticky) return; const isTopFixedAnnouncementInHeader = headerEl.querySelector('.announcement__container_top-fixed'); if (isTopFixedAnnouncementInHeader) return; const announcementTopFixedContainer = document.querySelector('.announcement__container_top-fixed'); if (announcementTopFixedContainer) { announcementTopFixedContainer.remove(); headerEl.insertBefore(announcementTopFixedContainer, headerEl.children[0]); observer.disconnect(); } }); observer.observe(headerEl, { attributes: true, attributeFilter: ['style', 'class'] }); } if (headerSticky && !isEvaMaskHeader && fixedBannerTopContainer) { fixedBannerTopContainer.style.position = 'relative'; fixedBannerTopContainer.style.zIndex = '29'; } } } // 展示公告栏 showAnnouncement_(item) { const announcement = document.querySelector(`#announcement-${item.id}`); const announcementBottomContainer = document.querySelector('.announcement__container_bottom'); const announcementBottomSticky = document.querySelector('.announcement__container_bottom-sticky'); const announcementTopContainer = document.querySelector('.announcement__container_top'); const announcementTopFixedContainer = document.querySelector('.announcement__container_top-fixed'); const isPC = this.viewport_.getWidth() >= 960; const isMobile = this.viewport_.getWidth() < 960; const isMatchPCDevice = item.device === DISPLAY_DEVICE.PC_AND_MOBILE || item.device === DISPLAY_DEVICE.PC; const isMatchMobileDevice = item.device == DISPLAY_DEVICE.PC_AND_MOBILE || item.device === DISPLAY_DEVICE.MOBILE; if((isPC && isMatchPCDevice) || (isMobile && isMatchMobileDevice)) { if (item.position === POSITION.BOTTOM) { if(item.mode === MODE.FIXED) { announcementBottomSticky && announcementBottomSticky.appendChild(announcement); } else { announcementBottomContainer && announcementBottomContainer.appendChild(announcement); } } else { if (item.mode === MODE.FIXED) { announcementTopFixedContainer && announcementTopFixedContainer.appendChild(announcement); } else { announcementTopContainer && announcementTopContainer.appendChild(announcement); } } this.reportData({ placement_id: item.id, event: REPORT_EVENT.IMPRESSION }); } } // 处理主题兼容 handleThemeCompatibility_() { try { const isBoost = /Boost/.test(THEME_NAME); const isHyde = /Hyde/.test(THEME_NAME); const isEva = /Eva/.test(THEME_NAME); const boostHeader = document.querySelector('.boost-header'); const fixedBannerTopContainer = document.querySelector('.announcement__container_top-fixed'); const notFixedBannerTopContainer = document.querySelector('.announcement__container_top'); const headerEl = document.querySelector('[data-section-type="header"]'); const headerSticky = headerEl && SPZCore.Dom.computedStyle(this.win, headerEl).position === 'sticky'; const header = document.querySelector('.header__fixed') || document.querySelector('.header__wrapper'); const headerFixed = header && SPZCore.Dom.computedStyle(this.win, header).position === 'fixed'; const handleScroll = SPZCore.Types.throttle(this.win, () => { if (isHyde) { if (header && headerSticky) { header.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } else { notFixedBannerTopContainer.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } } if (isEva) { const evaHeader = document.querySelector('header.header'); const isEvaMaskHeader = evaHeader && SPZCore.Dom.computedStyle(this.win, evaHeader).position === 'absolute'; if (!isEvaMaskHeader) return; if (evaHeader.classList.contains('header__fixed')) { evaHeader.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } else { notFixedBannerTopContainer.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } if(document.documentElement.scrollTop === 0) { evaHeader.style.marginTop = '0'; } } if (headerSticky) return; if (headerFixed) { header.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } else { const observer = new MutationObserver((mutationsList, observer) => { for (const mutation of mutationsList) { if (mutation.type === 'childList' && fixedBannerTopContainer.childElementCount > 0) { notFixedBannerTopContainer.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; observer.disconnect(); // 停止观察 break; } } }); // 开始观察 fixedBannerTopContainer 的子节点变化 observer.observe(fixedBannerTopContainer, { childList: true, subtree: true }); // 初始检查 if (fixedBannerTopContainer.childElementCount > 0) { notFixedBannerTopContainer.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } if(header) { header.style.marginTop = '0'; } } if (isBoost) { fixedBannerTopContainer.style.zIndex = '1031'; if (boostHeader && boostHeader.classList.contains('header__fixed')) { boostHeader.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } else { notFixedBannerTopContainer.style.marginTop = `${fixedBannerTopContainer.offsetHeight}px`; } } }, 16); window.addEventListener('scroll', handleScroll); window.dispatchEvent(new Event('scroll')); } catch (error) { console.error('error', error); } } // 上报数据 async reportData(data) { // 如果是主题编辑器则不用处理 if(window.top !== window.self) { return; } this.xhr_.fetchJson(API.REPORT, { method: "POST", body: { placement_id: data.placement_id, event: data.event } }); } // 监听购物车变化事件dj.cartChange listenCartChange_() { SPZUtils.Event.listen(document, 'dj.cartChange', (event) => { this.fetchData_('cartChange'); }); } setupAction_() { this.registerAction('handleClose', (invocation) => { const data = invocation.args; const id = data.id; const announcement = document.querySelector(`#announcement-${id}`); announcement && SPZCore.Dom.removeElement(announcement); window.dispatchEvent(new Event('scroll')); }); this.registerAction('handleJumpLink', (invocation) => { const data = invocation.args; if(!data.show_url) return; data.url && window.open(data.url, data.open_new_window ? '_blank' : '_self'); this.reportData({ placement_id: data.id, event: REPORT_EVENT.CLICK }); }); } triggerEvent_(name, data) { const event = SPZUtils.Event.create(this.win, `${ TAG }.${ name }`, data || {}); this.action_.trigger(this.element, name, event); } isLayoutSupported(layout) { return layout == SPZCore.Layout.CONTAINER; } } SPZ.defineElement(TAG, SpzCustomAnnouncement);