${function() {
if (data === undefined || typeof data !== 'string' || data == '') return '';
const searchEmpty = ("Your search for \"{test}\" did not yield any results.").replace('{test}', data);
return `
/**
* Custom discount code component that handles displaying and managing discount codes
* @extends {SPZ.BaseElement}
*/
class SpzCustomDiscountCode extends SPZ.BaseElement {
constructor(element) {
super(element);
// API endpoint for fetching discount codes
this.getDiscountCodeApi = "\/api\/storefront\/promotion\/code\/list";
// Debounce timer for resize events
this.timer = null;
// Current variant ID
this.variantId = "92ac3a0b-3190-4b77-a70b-f03eaeab1ebb";
// Store discount code data
this.discountCodeData = {}
}
/**
* Check if layout is supported
* @param {string} layout - Layout type
* @return {boolean}
*/
isLayoutSupported(layout) {
return layout == SPZCore.Layout.LOGIC;
}
/**
* Initialize component after build
*/
buildCallback() {
this.templates_ = SPZServices.templatesForDoc();
this.viewport_ = this.getViewport();
// Bind methods to maintain context
this.render = this.render.bind(this);
this.resize = this.resize.bind(this);
this.switchVariant = this.switchVariant.bind(this);
}
/**
* Setup component when mounted
*/
mountCallback() {
this.getData();
// Add event listeners
this.viewport_.onResize(this.resize);
this.win.document.addEventListener('dj.variantChange', this.switchVariant);
}
/**
* Cleanup when component is unmounted
*/
unmountCallback() {
this.viewport_.removeResize(this.resize);
this.win.document.removeEventListener('dj.variantChange', this.switchVariant);
// 清除定时器
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
}
/**
* Handle resize events with debouncing
*/
resize() {
if (this.timer) {
clearTimeout(this.timer)
this.timer = null;
}
this.timer = setTimeout(() => {
if (appDiscountUtils.inProductBody(this.element)) {
this.render();
} else {
this.renderSkeleton();
}
}, 200);
}
/**
* Handle variant changes
* @param {Event} event - Variant change event
*/
switchVariant(event) {
const variant = event.detail.selected;
if (variant.product_id == '1f9aa258-8694-4a8d-9f78-ca3448e50c61' && variant.id != this.variantId) {
this.variantId = variant.id;
this.getData();
}
}
/**
* Fetch discount code data from API
*/
getData() {
if (appDiscountUtils.inProductBody(this.element)) {
const reqBody = {
product_id: "1f9aa258-8694-4a8d-9f78-ca3448e50c61",
variant_id: this.variantId,
product_type: "default",
}
if (!reqBody.product_id || !reqBody.variant_id) return;
this.discountCodeData = {};
this.win.fetch(this.getDiscountCodeApi, {
method: "POST",
body: JSON.stringify(reqBody),
headers: {
"Content-Type": "application/json"
}
}).then(async (response) => {
if (response.ok) {
let data = await response.json();
if (data.list && data.list.length > 0) {
data.list[0].product_setting.template_config = JSON.parse(data.list[0].product_setting.template_config);
// Format timestamps to local timezone
const zone = this.win.SHOPLAZZA.shop.time_zone;
data.list = data.list.map(item => {
if(+item.ends_at !== -1) {
item.ends_at = appDiscountUtils.convertTimestampToFormat(+item.ends_at, zone);
}
item.starts_at = appDiscountUtils.convertTimestampToFormat(+item.starts_at, zone);
return item;
});
}
this.discountCodeData = data;
this.render();
} else {
this.clearDom();
}
}).catch(err => {
console.error("discount_code", err)
this.clearDom();
});
} else {
this.renderSkeleton();
}
}
/**
* Clear component DOM except template
*/
clearDom() {
const children = this.element.querySelector('*:not(template)');
children && SPZCore.Dom.removeElement(children);
}
/**
* Render discount codes with formatted dates
*/
render() {
// Render using discount code model
SPZ.whenApiDefined(document.querySelector('#spz_custom_discount_code_model')).then(renderApi => {
renderApi.doRender_({
discountCodeData: this.discountCodeData
})
}).catch(err => {
this.clearDom();
})
}
renderSkeleton() {
// Render template for non-product pages
this.templates_
.findAndRenderTemplate(this.element, {
isMobile: appDiscountUtils.judgeMobile()
})
.then((el) => {
this.clearDom();
this.element.appendChild(el);
})
.catch(err => {
this.clearDom();
});
}
}
// Register custom element
SPZ.defineElement('spz-custom-discount-code', SpzCustomDiscountCode);
Size:
${data.value}
Color: Blanchedalmond
${data.targetOption}
Quantity
Made to Order
SKU : FSJ202405081B-3
SKU : ${data.variant && data.variant.sku}
Share the love
Description
Radiate elegance with these chic nude ballet flats. Featuring a closed square toe and ankle wrap design in soft mesh, these shoes blend style and comfort seamlessly for any occasion.
Color: Nude
Material: Mesh
Toe: Closed Square toe
Wrap-around ankle tie design
Handcrafted
US sizing. Fits true to size.
Refund and Exchange Policy
Refund and Exchange Policy
Exchange
Refund
Condition
1. Within 30 days from the delivered date. 2. Original New
1. Before returning the package to us for any reason, please email your request to support@fsjshoes.com. In the email please include 1/ order number 2/ items requesting to be returned and 3/ reason for return.
2. When your return request has been approved, please write your order number on a piece of white paper and put it inside the shipping package.
3. Please retain a receipt/proof of postage from your local post office and email the tracking number to us.
The Shipping Fee
Borne by us
Borne by buyer
Processing Time
We will prepare the new items that you exchange and deliver them within 3 days after we receive you exchange parcel.
Within 3 working days after we receive your returning parcel
Address
No.516 5th Floor,Ist Build.,No.666, Middle Section of Tianfu Avenue, High-tech Zone, Chengdu, China
Note: This address is not a return address, please contact customer service to obtain the return address.
Size Chart
Measuring Guide
1. Measure your foot and legs
2. Measure your boots
Recently viewed
${data.map(data => `
`).join('')}
${data.map(data => `
`).join('')}
Reviews
No reviews yet, why don't you leave the first review?