Luxurious top with design
Luxurious top with design
${function(){
return `
${data.starNum}/${data.starTotal}
`;
}()}
${function(){
return `
${data.showStarText === 'true' ? `
${data.starNum}/${data.starTotal}
` : ''}
`;
}()}
const TAG = 'spz-custom-revue-star';
class SPZCustomRevueStar extends SPZ.BaseElement {
constructor(element) {
super(element);
}
static deferredMount() {
return false;
}
buildCallback = () => {
this.action_ = SPZServices.actionServiceForDoc(this.element);
this.templates_ = SPZServices.templatesForDoc(this.element);
this.xhr_ = SPZServices.xhrFor(this.win);
this.starNum = this.element.getAttribute('starNum');
this.starTotal = this.element.getAttribute('starTotal');
this.showStarText = this.element.getAttribute('showStarText');
this.starColor = this.element.getAttribute('color');
this.interact = this.element.getAttribute('interact');
this.starSize = this.element.getAttribute('starSize') || 14;
}
mountCallback = () => {
this.doRender_({
starTotal: this.starTotal,
totalArray: Array.from({ length: Number(this.starTotal) }, (v, k) => k + 1),
starNum: this.starNum,
showStarText: this.showStarText,
starColor: this.starColor,
starSize: this.starSize
}).then(() => {
if (this.interact) {
this.addEventListeners_();
}
});
}
addEventListeners_ = () => {
const stars = document.querySelectorAll('.revue-star__star');
stars.forEach(star => {
star.addEventListener('click', event => {
const starEl = star.closest('.revue-star__star');
const starIndex = Number(starEl.dataset.index);
let isHalf = event.offsetX < star.offsetWidth / 2;
// rtl
if (document.documentElement.getAttribute('dir') === 'rtl') {
isHalf = event.offsetX > star.offsetWidth / 2;
}
const starValue = isHalf ? starIndex - 0.5 : starIndex;
this.starClickHandler_({ value: starValue });
});
});
}
renderStar = () => {
const isRtl = document.documentElement.getAttribute('dir') === 'rtl';
const stars = this.element.querySelectorAll('.revue-star__star');
stars.forEach((star, i) => {
const starIndex = i + 1;
const starEl = star.querySelector('svg:nth-child(2)');
const isHalf = this.starNum % 1 > 0 && Math.ceil(this.starNum) === starIndex;
const isSolid = starIndex <= Math.ceil(this.starNum);
starEl.style.display = isSolid ? 'block' : 'none';
if (isHalf) {
if (isRtl) {
// RTLåøå±äøļ¼å¦ęęÆåęļ¼ę¾ē¤ŗęęēå³åč¾¹
starEl.style.clipPath = `polygon(50% 0, 100% 0, 100% 100%, 50% 100%)`;
} else {
// LTRåøå±äøļ¼å¦ęęÆåęļ¼ę¾ē¤ŗęęēå·¦åč¾¹
starEl.style.clipPath = `polygon(0 0, 50% 0, 50% 100%, 0 100%)`;
}
} else {
starEl.style.clipPath = `polygon(0 0, 100% 0, 100% 100%, 0 100%)`
}
});
const showCountEle = this.element.querySelector('#revue-star-show-count');
showCountEle && SPZ.whenApiDefined(showCountEle).then((api) => {
api.render({ starNum: this.starNum, starTotal: this.starTotal });
});
}
doRender_ = (data) => {
return this.templates_
.findAndRenderTemplate(this.element, { starSize: this.starSize, ...data }, null)
.then((el) => {
const children = this.element.querySelector('*:not(template)');
children && SPZCore.Dom.removeElement(children);
this.element.appendChild(el);
})
.then(() => {
this.starNum = data.starNum;
this.renderStar();
});
}
starClickHandler_ = (event) => {
this.starNum = event.value;
this.renderStar();
this.triggerEvent_('change', { value: event.value });
}
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, SPZCustomRevueStar)
()
try {
const productId = window.SHOPLAZZA.meta.page.resource_id;
const productType = `default`;
const getProductReviews = (star_least) =>
fetch('/api/comment/count-star-multi',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
product_id: [productId],
star_least: star_least || 1,
}),
}).then(res => res.json());
try {
const section = document.querySelector('#revue-product-star');
if(productType === "gift_card" && section) {
section.style.display = 'none';
}
} catch(e) {
console.log(e);
window.addEventListener('load', () => {
try {
const section = document.querySelector('#revue-product-star');
if(productType=== "gift_card" && section) {
section.style.display = 'none';
}
} catch(e) {
console.log(e)
}
})
}
const getReviewsConfig = async () => {
let data = {};
const url = new URL(window.location.href);
const preview_theme_id = url.searchParams.get('preview_theme_id');
const commentConfig = await fetch('/api/comment-config', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
}).then(res => res.json());
data = commentConfig.data;
const themeConfig = await fetch(`/api/comment-config?theme_id=${preview_theme_id || ''}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
}).then(res => res.json());
if (themeConfig?.data && themeConfig.data.star_color) {
data.star_color = themeConfig.data.star_color;
}
if (preview_theme_id) {
data.star_least = window.apps_global && apps_global.reviews && apps_global.reviews.preview_star_least;
} else if (themeConfig?.data && themeConfig.data.product_settings) {
data.star_least = themeConfig.data.product_settings.star_least;
}
return data;
};
if (productId && window.SHOPLAZZA.meta.page.template_type == 1) {
getReviewsConfig().then(async res => {
const config = res;
let review = await getProductReviews(config.star_least);
review = review.data[productId];
if (!config.open_status || (!review.comment_avg_star && !config.show_no_comment_star)) {
const section = document.querySelector('#revue-product-star');
if (section) section.remove();
return;
}
const render = async () => {
const section = document.querySelector('#revue-product-star');
const starComponent = document.querySelector('#revue-product-star-component');
const count = document.querySelector('#revue-product-star-count');
count.innerText = review.published_count;
const api = await SPZ.whenApiDefined(starComponent);
api.doRender_({
starNum: review.comment_avg_star,
starTotal: 5,
showStarText: false,
starColor: config.star_color,
totalArray: Array.from({ length: 5 }, (v, k) => k + 1)
});
section.style.opacity = 1;
}
render();
document.addEventListener('dj.editor.update', render);
});
}
} catch (e) {console.warn(e)};
${function() {
const variantData = data.variant || {"id":"aefa1f87-52f7-4990-82f1-dcdfe213e69f","product_id":"fc71fe7c-45c0-48d1-82b8-8b278880bae8","title":"S","weight_unit":"kg","inventory_quantity":300,"sku":"","barcode":"","position":1,"option1":"S","option2":"","option3":"","note":"","image":{"src":"\/\/img.staticdj.com\/7821a30a4b877dfba6af730f42d79388.jpeg","path":"7821a30a4b877dfba6af730f42d79388.jpeg","width":740,"height":990,"alt":"","aspect_ratio":0.7474747474747475},"wholesale_price":[{"price":37.95,"min_quantity":1}],"weight":"0.2","compare_at_price":"67","price":"37.95","retail_price":"67","available":true,"url":"\/products\/diane\u00ae-luxurious-top-with-design?variant=aefa1f87-52f7-4990-82f1-dcdfe213e69f","available_quantity":300,"options":[{"name":"Size","value":"S"}],"off_ratio":"43","flashsale_info":{"variant_id":"aefa1f87-52f7-4990-82f1-dcdfe213e69f","product_id":"","quantity":0,"discount_id":"","limit_time":0,"limit_buy":0,"user_limit_buy":0,"discount_sales":0,"discount_sales_rate":"","discount_stock":0,"ends_at":0,"starts_at":0,"allow_oversold":"","allocation_method":"","price":"37.95","compare_at_price":"","discount_price":"37.95","customary_saved_price":"","customary_off_ratio":"","discount_saved_price":"","discount_off_ratio":"43","use_before_price":false,"before_price":"","title":"","properties":"","color_setting_promotional_copy":"","discount_quantity":0,"is_need_split":false},"sales":0};
const saveType = null;
const productSaveLabel = null;
return `
-
${ variantData.off_ratio }%
`; }()}
${(function () {
const automatic_discount_list = originData.automatic_discount_list;
// ę¾ē¤ŗē±»å
const DISPLAY_TYPE = {
DTE_FOLD: 'DTE_FOLD', // ęå
DTE_TILE: 'DTE_TILE' // å¹³éŗ
}
const DEFAULT_CONFIG = {
BG: 'rgba(235, 57, 27, 0.04)',
TEXT_COLOR: '#EB391B',
BORDER_COLOR: 'rgb(235, 57, 27)',
ADD_TO_CART_BG: 'transparent',
ADD_TO_CART_TEXT_COLOR: 'rgb(235, 57, 27)',
ADD_TO_CART_BORDER_COLOR: 'rgb(235, 57, 27)',
};
// ę¬å°č·³č½¬å¤å®(äøä¾čµå
Øå± appDiscountUtils,樔ęæę²ē®±äøåÆč§)
const __resolveHref = (s, landing) => {
if (!s || !s.is_redirection) return '';
const link = typeof s.link === 'string' ? s.link.trim() : '';
if (link && /^https?:\/\//i.test(link)) return link;
return landing || '';
};
const isExist = automatic_discount_list?.length > 0 && automatic_discount_list.some(item => item.discount[0].product_enabled);
// å¦ęę²”ęä»»ä½čŖåØęę£ļ¼åéčļ¼é²ę¢gapå ä½
if (!isExist) {
return `
`;
} else {
return `
${(function () {
return automatic_discount_list.map((item) => {
// 樔ēē±»å
const template_type = item.discount[0].template_type;
// ęÆå¦ę¾ē¤ŗčŖåØęę£
const is_show_automatic_discount = item.discount[0].product_enabled;
// ęę£å¾ę
const discount_icon = item.discount_icon;
// 第äøäøŖčŖåØęę£
const first_automatic_discount = item.discount[0];
// ę¾ē¤ŗęå å±ē¤ŗ
const isFold = (item.discount[0].display_type || DISPLAY_TYPE.DTE_FOLD) === DISPLAY_TYPE.DTE_FOLD;
// ęę¬ę°ē»
const text_arr = item.discount[0].config.texts;
// ę”ä»¶å¼ę°ē»
const condition_values = item?.discount[0]?.condition_values || [];
// č½å°é”µé¾ę„
const first_landing_url = `/promotions/discount-default/${first_automatic_discount.discount_id}`;
// äøę®µå¼č·³č½¬å³ē: ęē»č·³č½¬ URL,空å符串蔨示äøč·³
const finalHref = __resolveHref(first_automatic_discount, first_landing_url);
// čŖåØęę£ę»ę°
const automatic_discount_total = item.discount.length;
// ęÆå¦ę¾ē¤ŗęę£å¾ę
const isHasDiscountIcon = discount_icon ? true : false;
// ęÆå¦ę¾ē¤ŗęę£å¾ę äøęØ”ēē±»åäøäøŗtagåadd_to_cart
const isHasDiscountIconWithNoTag = (template_type != 'tag' && template_type != 'add_to_cart' && isHasDiscountIcon)? true : false;
// ęę¬é¢č²
let text_color = DEFAULT_CONFIG.TEXT_COLOR;
// čęÆé¢č²
const bgFn = (curBg) => template_type === "text" ? "transparent" : curBg;
let bg_color = bgFn(DEFAULT_CONFIG.BG);
// č¾¹ę”é¢č²
const borderFn = (curBorder) => template_type == "tag" ? curBorder : "initial";
let border_color = borderFn(DEFAULT_CONFIG.BORDER_COLOR);
// 樔ēé
ē½®
let template_config = first_automatic_discount.template_config;
// äøé®å č“ę ·å¼
let addToCartBtnBgColor = DEFAULT_CONFIG.ADD_TO_CART_BG;
let addToCartBtnTextColor = DEFAULT_CONFIG.ADD_TO_CART_TEXT_COLOR;
let addToCartBtnBorderColor = DEFAULT_CONFIG.ADD_TO_CART_BORDER_COLOR;
// å
åŗę¹ę”
try {
if(template_config.length !== 0){
template_config = JSON.parse(template_config);
text_color= isHasDiscountIconWithNoTag ? template_config.color[template_type].icon_text_color : template_config.color[template_type].text_color;
bg_color = bgFn(template_config.color[template_type].background_color);
const arrayRgba = bg_color.split(",");
arrayRgba.splice(3, 1, " 1)");
border_color = borderFn(`${arrayRgba.join(",")}`);
addToCartBtnTextColor = template_config.color[template_type].button_text_color;
addToCartBtnBorderColor = template_config.color[template_type].button_border_color;
addToCartBtnBgColor = template_config.color[template_type].button_background_color;
}
} catch (error) {
console.error('template_config_error', error);
template_config = {
color: {
[template_type]: {
icon_text_color: DEFAULT_CONFIG.TEXT_COLOR,
text_color: DEFAULT_CONFIG.TEXT_COLOR,
background_color: DEFAULT_CONFIG.BG
}
}
};
}
// ę ē¾
const isTag = template_type == 'tag';
// ęåå横å¹
const isTextAndBanner = template_type == 'text' || template_type == 'banner';
// ęÆå¦äøé®å č“
const isAddToCart = template_type == 'add_to_cart';
// ęåę ·å¼
const textStyle = `color: ${text_color}; background-color: transparent; border: none;`;
// ę ē¾ę ·å¼
const labelStyle = `color: ${text_color};border: 1px solid ${border_color};background-color:${bg_color};padding: 4px;`;
// 横å¹
ę ·å¼
const bannerStyle = `color: ${text_color};border: none; background-color:${bg_color}`;
// äøé®å č“å个容åØę ·å¼ļ¼åŖå
å«åØęę ·å¼ļ¼
const addToCartSingleContainerStyle = `color: ${text_color}; background-color:${bg_color};`;
// äøé®å č“ęé®ę ·å¼ļ¼åŖå
å«é
ē½®ēåØęę ·å¼ļ¼
const addToCartBtnStyle = `color: ${addToCartBtnTextColor}; background-color:${addToCartBtnBgColor}; border:1px solid ${addToCartBtnBorderColor};`;
// å¤å±ę ·å¼åØę ē¾ę ·å¼äøäøå±ē¤ŗé¢č²é
ē½®ļ¼é¤å¼ę ē¾ē±»åļ¼é¢č²é½åÆä»„åØå¤å±č¦ē
let outerStyle = '';
if (template_type == 'text') {
outerStyle = textStyle;
} else if (template_type == 'tag') {
outerStyle = "border: none;";
} else if (template_type == 'banner') {
outerStyle = bannerStyle;
}
/**
* 1. ę ē¾äøå®ęÆåē¬ę ·å¼å±ē¤ŗē
* 2. ęå ļ¼ęØŖååøå±ļ¼ęåå横å¹
ļ¼åå¹¶ęäøč”ęę¬ļ¼ ę ē¾ļ¼åē¬ę ·å¼å¤ē
* 3. å¹³éŗļ¼ēŗµååøå±ļ¼ęåć横å¹
åę ē¾ļ¼ ę ē¾ļ¼åē¬ę ·å¼å¤ēļ¼äøé®å č“é»č®¤é½ęÆå¹³éŗ
*/
let txtHtml = ``;
if (isFold) {
if(isTag) {
// ę ē¾
const spanText = text_arr.map((text) => {
return `
${text}`;
}).join('');
txtHtml = `
${spanText}
`;
} else {
// ęåå横å¹
txtHtml = `
${first_automatic_discount.config.text}
`;
}
} else {
// ęåå横å¹
, ä½ę ē¾ęčŖå·±ēę ·å¼ļ¼äøäøé®å č“ęåē¬ę ·å¼
const spanText = text_arr.map((text, index) => {
const condition_value = condition_values[index];
if(isAddToCart) {
return `
${text}
`
} else {
return `
${text}`;
}
}).join('');
// é½ęÆēŗµååøå±ļ¼ę ē¾ęé“č·
txtHtml = `
${spanText}
`;
}
/**
* ę¾ē¤ŗå¾ę ēå¤ę
*/
const discount_type = item.discount_type;
const isShowRebateIcon = ["DT_REBATE_CTQ_OTP", "DT_REBATE_CTQ_OTR", "DT_REBATE_CTA_OTP", "DT_REBATE_CTA_OTR", "DT_M_N_DISCOUNT"].includes(discount_type) && isTextAndBanner
const isShowBxgyIcon = ["DT_BUY_ONE_GET_ONE", "DT_BUY_X_GET_Y"].includes(discount_type)
const isShowBundleIcon = ["DT_CLASSIC_BUNDLE","DT_MIX_MATCH_BUNDLE"].includes(discount_type);
/**
* ęø²ęäøęę”ęę½å±ēęę£å蔨
*/
const discount_list_html = (curItem) => {
return `
${function() {
return curItem.discount.map(childItem => {
const childLandingUrl = `/promotions/discount-default/${childItem.discount_id}`;
const childFinalHref = __resolveHref(childItem, childLandingUrl);
childItem.__finalHref = childFinalHref;
return childFinalHref
? `
`
: `
`;
}).join('');
}()}
`;
}
return `
${txtHtml}
${finalHref ? `
` : ''}
${discount_list_html(item)}
${function() {
return text_arr.map((text) => {
return `
${text}
`;
}).join('');
}()}
`;
}).join('');
})()}
`
}
})()}
const TAG = "spz-custom-product-automatic";
class SpzCustomProductAutomatic extends SPZ.BaseElement {
constructor(element) {
super(element);
this.variant_id = 'aefa1f87-52f7-4990-82f1-dcdfe213e69f';
this.isRTL = SPZ.win.document.dir === 'rtl';
this.isAddingToCart_ = false; // å č“äøē¶ę
}
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.init();
// ēå¬äŗä»¶
this.bindEvent_();
}
async init() {
this.handleFitTheme();
const data = await this.getDiscountList();
this.renderApiData_(data);
}
async getDiscountList() {
const productId = 'fc71fe7c-45c0-48d1-82b8-8b278880bae8';
const variantId = this.variant_id;
const productType = 'default';
const reqBody = {
product_id: productId,
variant_id: variantId,
discount_method: "DM_AUTOMATIC",
customer: {
customer_id: window.C_SETTINGS.customer.customer_id,
email: window.C_SETTINGS.customer.customer_email
},
product_type: productType
}
const url = `/api/storefront/promotion/display_setting/text/list`;
const data = await this.xhr_.fetchJson(url, {
method: "post",
body: reqBody
}).then(res => {
return res;
}).catch(err => {
this.setContainerDisabled(false);
})
return data;
}
async renderDiscountList() {
this.setContainerDisabled(true);
const data = await this.getDiscountList();
this.setContainerDisabled(false);
// éę°ęø²ę ęåØé®é¢å¤ē
this.renderApiData_(data);
}
clearDom() {
const children = this.element.querySelector('*:not(template)');
children && SPZCore.Dom.removeElement(children);
}
async renderApiData_(data) {
const parentDiv = document.querySelector('.automatic_discount_container');
const newTplDom = await this.getRenderTemplate(data);
if (parentDiv) {
parentDiv.innerHTML = '';
parentDiv.appendChild(newTplDom);
} else {
console.log('automatic_discount_container is null');
}
}
doRender_(data) {
const renderData = data || {};
return this.templates_
.findAndRenderTemplate(this.element, renderData)
.then((el) => {
this.clearDom();
this.element.appendChild(el);
});
}
async getRenderTemplate(data) {
const renderData = data || {};
return this.templates_
.findAndRenderTemplate(this.element, { ...renderData, isRTL: this.isRTL })
.then((el) => {
this.clearDom();
return el;
});
}
setContainerDisabled(isDisable) {
const automaticDiscountEl = document.querySelector('.automatic_discount_container_outer');
if(isDisable) {
automaticDiscountEl.setAttribute('disabled', '');
} else {
automaticDiscountEl.removeAttribute('disabled');
}
}
// ē»å®äŗä»¶
bindEvent_() {
window.addEventListener('click', (e) => {
let containerNodes = document.querySelectorAll(".automatic-container .panel");
let bool;
Array.from(containerNodes).forEach((node) => {
if(node.contains(e.target)){
bool = true;
}
})
// ęÆå¦popoveré¢ęæē¹å»čå“
if (bool) {
return;
}
if(e.target.classList.contains('drowdown-icon') || e.target.parentNode.classList.contains('drowdown-icon')){
return;
}
const nodes = document.querySelectorAll('.automatic-container');
Array.from(nodes).forEach((node) => {
node.classList.remove('open-dropdown');
})
// å
¼å®¹äø»é¢
this.toggleProductSticky(true);
})
// ēå¬åä½åå
document.addEventListener('dj.variantChange', async(event) => {
// éę°ęø²ę
const variant = event.detail.selected;
if (variant.product_id == 'fc71fe7c-45c0-48d1-82b8-8b278880bae8' && variant.id != this.variant_id) {
this.variant_id = variant.id;
this.renderDiscountList();
}
});
}
// å
¼å®¹äø»é¢
handleFitTheme() {
// top å±ę§å½±åęåØ
let productInfoEl = null;
if (window.SHOPLAZZA.theme.merchant_theme_name === 'Wind' || window.SHOPLAZZA.theme.merchant_theme_name === 'Flash') {
productInfoEl = document.querySelector('.product-info-body .product-sticky-container');
} else if (window.SHOPLAZZA.theme.merchant_theme_name === 'Hero') {
productInfoEl = document.querySelector('.product__info-wrapper .properties-content');
}
if(productInfoEl){
productInfoEl.classList.add('force-top-auto');
}
}
// å
¼å®¹ wind/flash /hero äø»é¢ (stickyå±ę§å½±å popover å±ēŗ§å±ē¤ŗ, ä¼č¢«å
¶ä»å
ē“ č¦ē)
toggleProductSticky(isSticky) {
let productInfoEl = null;
if (window.SHOPLAZZA.theme.merchant_theme_name === 'Wind' || window.SHOPLAZZA.theme.merchant_theme_name === 'Flash') {
productInfoEl = document.querySelector('.product-info-body .product-sticky-container');
} else if (window.SHOPLAZZA.theme.merchant_theme_name === 'Hero') {
productInfoEl = document.querySelector('.product__info-wrapper .properties-content');
}
if(productInfoEl){
if(isSticky) {
// čæå评主é¢åęēstickyå±ę§å¼
productInfoEl.classList.remove('force-position-static');
return;
}
productInfoEl.classList.toggle('force-position-static');
}
}
setupAction_() {
this.registerAction('handleDropdown', (invocation) => {
const discount_id = invocation.args.discount_id;
const nodes = document.querySelectorAll('.automatic-container');
Array.from(nodes).forEach((node) => {
if(node.getAttribute('id') != `automatic-${discount_id}`) {
node.classList.remove('open-dropdown');
}
})
const $discount_item = document.querySelector(`#automatic-${discount_id}`);
$discount_item && $discount_item.classList.toggle('open-dropdown');
// å
¼å®¹äø»é¢
this.toggleProductSticky();
});
// å č“äŗä»¶
this.registerAction('handleAddToCart', (invocation) => {
// é»ę¢äŗä»¶åę³”
const event = invocation.event;
if (event) {
event.stopPropagation();
event.preventDefault();
}
// å¦ęę£åØå č“äøļ¼ē“ę„čæå
if (this.isAddingToCart_) {
return;
}
const quantity = invocation.args.quantity || 1;
this.addToCart(quantity);
});
}
// å č“ę¹ę³
async addToCart(quantity) {
// 设置å č“äøē¶ę
this.isAddingToCart_ = true;
const productId = 'fc71fe7c-45c0-48d1-82b8-8b278880bae8';
const variantId = this.variant_id;
const url = '/api/cart';
const reqBody = {
product_id: productId,
variant_id: variantId,
quantity: quantity
};
try {
const data = await this.xhr_.fetchJson(url, {
method: 'POST',
body: reqBody
});
// 触åå č“ęåę示
this.triggerAddToCartToast_();
return data;
} catch (error) {
error.then(err=>{
this.showToast_(err?.message || err?.errors?.[0] || 'Unknown error');
})
} finally {
// ę 论ęå失蓄ļ¼é½éē½®å č“ē¶ę
this.isAddingToCart_ = false;
}
}
showToast_(message) {
const toastEl = document.querySelector("#apps-match-drawer-add_to_cart_toast");
if (toastEl) {
SPZ.whenApiDefined(toastEl).then((apis) => {
apis.showToast(message);
});
}
}
// 触åå č“ęåę示
triggerAddToCartToast_() {
// å¦ęäø»é¢ęčŖå·±ēå č“ę示ļ¼åäøę¾ē¤ŗ
const themeAddToCartToastEl = document.querySelector('#add-cart-event-proxy');
if (themeAddToCartToastEl) return;
// ę¾ē¤ŗåŗēØēå č“ęåę示
this.showToast_("Added successfully");
}
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, SpzCustomProductAutomatic);
class SpzCustomDiscountBundle extends SPZ.BaseElement {
constructor(element) {
super(element);
}
isLayoutSupported(layout) {
return layout == SPZCore.Layout.LOGIC;
}
mountCallback() {}
unmountCallback() {}
setupAction_() {
this.registerAction('showAddToCartToast', () => {
const themeAddToCartToastEl = document.querySelector('#add-cart-event-proxy')
if(themeAddToCartToastEl) return
const toastEl = document.querySelector('#apps-match-drawer-add_to_cart_toast')
SPZ.whenApiDefined(toastEl).then((apis) => {
apis.showToast("Added successfully");
});
});
}
buildCallback() {
this.setupAction_();
};
}
SPZ.defineElement('spz-custom-discount-toast', SpzCustomDiscountBundle);
Almost sold out
Free worldwide shipping
30 Day Free Returns
${function(){
return `
Please select a Size
`;
}()}
Product was out of stock.
Estimated Deliveryļ¼Jun-14 - Jun-22
Enjoy free shipping on every order, delivered to your doorstep no matter where you are in the world.
Shop with confidence with our hassle-free returns policy, ensuring you love what you buy.
Your payment information is always protected with our advanced, encrypted checkout security.
Discover the essence of elegance and authenticity in our women's collection. Each garment is designed to enhance your natural beauty and boost your self-confidence. Our high-quality materials offer comfort and durability, while carefully selected details and finishes add a touch of sophistication to your style. With our dresses you will feel ready to stand out and express your unique style.
Size Information: We recommend you to always take one size up. Please see description for the size chart.
Custom Sizing: If you’re between sizes, we recommend choosing the next size up for comfort.
Measurement Tips: Measure your bust, waist, and hips to find your perfect size using our size guide.
After your payment is verified, we start working on your order immediately.
It usually takesup to 24 hours to process and ship your order.
We offer a 100% money-back guarantee within 30 days of receiving your order.