• ✈Free Shipping Over $69 ❤BUY 2 GET 10% OFF(CODE:AT10) ❤

  • ✈Free Shipping Over $69 ❤BUY 2 GET 10% OFF(CODE:AT10) ❤

  • ✈Free Shipping Over $69 ❤BUY 2 GET 10% OFF(CODE:AT10)❤

  • ✈Free Shipping Over $69 ❤BUY 2 GET 10% OFF(CODE:AT10)❤

Search

greekfeels greekfeels
greekfeels

Search Search
Account
  • Log in
  • Create an account
0 Cart
Close
  • Home
  • New Release Colorblock Bomber Jacket
    AKA
  • New Release Colorblock Bomber Jacket
    ΖΦΒ
  • New Release Colorblock Bomber Jacket
    ΔΣΘ
  • New Release Colorblock Bomber Jacket
    ΣΓΡ
  • Fashionable Casual Blazer Jacket and Skirt Set
    Women's fashion
  • Classic OES Print Pants
    OES
  • irregular print long jumper
    THE LINKS
  • ΓΦΔ
  • Simple Casual Loose Pocket Long Sleeve Dress
    JACK AND JILL
  • casual unisex printed T-shirt
    ΧΗΦ
  • Fashion Snake Bone Colored Diamond Bracelet
    ACC
  • Custom Orders
  • Log in
  • Home
  • AKA
  • ΖΦΒ
  • ΔΣΘ
  • ΣΓΡ
  • Women's fashion
  • OES
  • THE LINKS
  • ΓΦΔ
  • JACK AND JILL
  • ΧΗΦ
  • ACC
  • Custom Orders
  • More links
Login
Please enter your e-mail and password:
Forgot password?
Don't have an account? Create one
Subscribe today to hear first about our sales
Thanks for subscribing
© 2025 greekfeels
About Us
Contact Us
Privacy Policy
FAQ'S
Shipping Information
Return Policy
Payment Methods
Terms Of Service
Order Tracking

Sign up and save

Entice customers to sign up for your mailing list with discounts or exclusive offers. Include an image for extra impact.
Thanks for subscribing
Optional button
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);