Backup camera for trucks, trucks camera wired backup camera
The VC4 camera features Wide Dynamic Range (WDR) technology, which automatically adjusts brightness and contrast to balance light and dark areas. Even under strong sunlight, backlight, or low-light conditions, it delivers clear images with enhanced detail.
New Arrival
Best Seller
${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)) 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":"18a3632f-41e0-45cb-8a34-87fa4ff75301","product_id":"1441f1f1-292f-4edf-afeb-fb797af3db75","title":"","weight_unit":"kg","inventory_quantity":0,"sku":"--A001010","barcode":"","position":1,"option1":"","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":59.99,"min_quantity":1}],"weight":"0","compare_at_price":"59.99","price":"59.99","retail_price":"59.99","available":true,"url":"\/products\/backup-camera-for-trucks-trucks-camera-wired-backup-camera-8yfc-1ja2?variant=18a3632f-41e0-45cb-8a34-87fa4ff75301","available_quantity":999999999,"options":[],"off_ratio":0,"flashsale_info":[],"sales":0};
const saveType = "amount";
const productSaveLabel = true;
return `
-
${saveType == 'percent' ? `-${variantData.off_ratio}% ` : `- ` }
`; }()}
Add to cart
- $59.99
${function(){
const wholesale_enabled = false;
const qty = data.quantity || 1;
const currentSelectVariant = data.variant;
const defaultVariant = (data.product && data.product.variants && data.product.variants[0]) || Object.keys(data).length > 1 ? data : null;
const productVariant = {"id":"18a3632f-41e0-45cb-8a34-87fa4ff75301","product_id":"1441f1f1-292f-4edf-afeb-fb797af3db75","title":"","weight_unit":"kg","inventory_quantity":0,"sku":"--A001010","barcode":"","position":1,"option1":"","option2":"","option3":"","note":"","image":null,"wholesale_price":[{"price":59.99,"min_quantity":1}],"weight":"0","compare_at_price":"59.99","price":"59.99","retail_price":"59.99","available":true,"url":"\/products\/backup-camera-for-trucks-trucks-camera-wired-backup-camera-8yfc-1ja2?variant=18a3632f-41e0-45cb-8a34-87fa4ff75301","available_quantity":999999999,"options":[],"off_ratio":0,"flashsale_info":[],"sales":0};
const variantData = currentSelectVariant || defaultVariant || productVariant;
const wholesale_price = variantData.wholesale_price || [];
if(wholesale_enabled && wholesale_price.length > 0) {
let wholesaleIndex = wholesale_price.findIndex(item => {
return item.min_quantity > qty;
});
if(wholesaleIndex < 0){
wholesaleIndex = wholesale_price.length - 1;
}else if(wholesaleIndex > 0){
wholesaleIndex = wholesaleIndex - 1;
}
const wholesalePrice = wholesale_price[wholesaleIndex] || '';
return `
`
}else {
const price = variantData && variantData.price;
return price != undefined ? `
` : ' ';
}
}()}
Buy it now
Product was out of stock.
Product is unavailable.
Estimated Delivery:Nov-15 - Nov-19
${function() {
const type = 'hero';
const postageFreeAmount = 1999;
const custom_text_hero = "Buy {amount} more to enjoy FREE Shipping";
const totalPrice = +data.total_price;
const diffPrice = postageFreeAmount - totalPrice;
const percentDiff = (diffPrice > 0 ? (totalPrice / postageFreeAmount * 100) : 100) + '%';
let tipText = "Your order is free delivery";
const custom_text_wind = "Buy {amount} more to enjoy FREE Shipping";
const custom_text = type === 'hero' ? custom_text_hero : custom_text_wind;
if (diffPrice > 0) {
tipText = custom_text.replace('{amount}', `
`);
}
return `
${type === 'hero' ?
`
` :
`
${tipText}
Your order is free delivery
`
}
`;
}()}
Vendor by:
SKU: --A001010
SKU: ${data.variant.sku}