${
(function(){
const popupList = originData.popupList;
return popupList?.length && popupList.map(item => {
if(item.placement_template === "PT_POPUP_BUY_X_GET_Y"){
const parseConfig = item.parseConfig;
const shopUrl = `https://${parseConfig.button.url}`;
let modalSize = '';
if(+parseConfig.width.value <= 600){
modalSize = 'small';
} else if(+parseConfig.width.value > 600 && +parseConfig.width.value <= 800){
modalSize = 'middle';
} else {
modalSize = 'large';
}
const imagePosition = parseConfig.image.position;
const wrapHeightMap = {
small: 'min-height:360px;',
middle: 'min-height:480px;',
large: 'min-height:600px;'
};
const image_size_top_map = {
small: 'height:208px;',
middle: 'height:295px;',
large: 'height:346px;'
};
const content_size_right_map = {
small: 'padding-top: 68px;',
middle: 'padding-top: 72px;',
large: 'padding-top: 76px;'
};
const content_size_top_map = {
small: 'padding: 20px 16px;',
middle: 'padding: 40px 16px;',
large: 'padding: 40px 16px;'
};
positionMap = {
top: {
imageStyle:`width:100%;${image_size_top_map[modalSize]}`,
contentStyle:`margin-top:0;padding: 16px;${content_size_top_map[modalSize]}`,
wrapStyle: 'flex-direction:column;',
},
left: {
imageStyle:'width:50%;height:100%;',
contentStyle:`width:50%;padding:16px;${content_size_right_map[modalSize]}`,
wrapStyle: 'flex-direction:row;',
},
right: {
imageStyle:'width:50%;height:100%;',
contentStyle:'width:50%;padding:16px;margin-top:0;',
wrapStyle: 'flex-direction:row-reverse;'
},
none: {
imageStyle:'display: none',
contentStyle:'width:100%;',
wrapStyle: 'width:100%;'
}
}
const keys = ['text_title','text_content','button'];
let sortKeys = [];
parseConfig.section.forEach(item => {
if(keys.includes(item)){
sortKeys.push(item)
}
})
const maskPercent = item.parseConfig.mask.value/100;
const backgroundImgStyle = (parseConfig.background.url && parseConfig.background.upload) ? `background-image:url(//img.staticdj.com/${parseConfig.background.url});background-size: cover;background-repeat: no-repeat;background-position: center;` : '';
const backgroundColorStyle = `background-color:${parseConfig.background.color || '#ffffff'}`;
return `
`
}else{
return ''
}
}).join('');
})()
}
${sortKeys.map(key => {
if(key == 'text_title'){
return `
${parseConfig.text_title.value}
`
}else if(key == 'text_content'){
return `
${parseConfig.text_content.value}
`
}else if(key == 'button'){
return `
`
}
}).join('')}
${data.starNum}/${data.starTotal}
${data.starNum}/${data.starTotal}
${!isPercentage ? `${data.count}` : `${(data.count / data.total * 100).toFixed(1)}%`}
${data.count > 99 ? '99+' : data.count < 1 ? '' : data.count}
${function() {
if(data.imgCover) {
if(media.videosrc) {
let src = '';
if (media.videosrc) {
src = media.videosrc + '.' + media.ext;
}
const videoDom = `
`;
if(!isPC){
return `
`;
if(!isPC){
return `
`
}else{
return `
`
}
}
} else {
if (media.videosrc) {
let src = '';
if (media.videosrc) {
src = media.videosrc + '.' + media.ext;
}
return `
`
} else if(media.mp4 || media.hls) {
return `
`
} else {
return `
`
}
}
}()}
${videoDom}
`
}
return `
${videoDom}
`
} else if(media.mp4 || media.hls) {
const videoDom = `
${videoDom}
`
}
return `
${videoDom}
`
} else {
if(!isPC){
return `
Newest
Newest
Most liked
Highest ratings
Lowest ratings
Newest
Most liked
Highest ratings
Lowest ratings
All
All(${list.count})
With Photos(${list.image_count})
All(${list.count})
With Photos(${list.image_count})
${arrow}
`);
for (let i = startNumber; i <= endNumber; i++) {
if (i === pageNum) {
nums.push(
`${i}
`
);
} else {
// 第一段:不大于3
if (pageNum <= 3) {
if (i < pageNum + 2 || i > Math.max(endNumber - 4, 0)) {
nums.push(`${i}
`);
}
if (i === pageNum + 2 && i < endNumber - 3) {
nums.push(`...
`);
}
}
// 第二段:大于3 到 倒数第三个
if (pageNum > 3 && pageNum < endNumber - 3) {
if (i < 3 || i > endNumber - 3 || (pageNum - 2 < i && i < pageNum + 2)) {
nums.push(`${i}
`);
}
if (i === 3 && pageNum - 1 !== 3) {
nums.push(`...
`);
}
if (i === endNumber - 4) {
nums.push(`...
`);
}
}
// 第三段: 倒数4个
if (pageNum >= Math.max(endNumber - 3, 4)) {
if (i < 3 || i > endNumber - 3 || i == pageNum - 1) {
nums.push(`${i}
`);
}
if (i === 3 && pageNum > 4 && endNumber > 5) {
nums.push(`...
`);
}
}
}
}
nums.push(`
${arrow}
`);
return `${nums.join(' ')}
`;
}()}
${data.starNum}/${data.starTotal}
${data.starNum}/${data.starTotal}
Write a Review
${data.title}
Reviews
(${data.comment_count > 500 ? '500+' : (data.comment_count || 0)})
Write a Review
View all
${item.username}
Verified
${item.content}
${data.shop_name} reply:
${item.reply && item.reply.length && item.reply[0].content}
${formatDate(item.created_at)}
View more
Wow you reached the bottom
View all
Write a Review
${data.comment_avg_star}
Total reviews: ${data.comment_count > 999 ? '999+' : data.comment_count}
${level}
Reviews
- All(${list.count})
- With Photos(${list.image_count})
Wow you reached the bottom
`;
} else {
return ``;
}
}()}
${function(){
return `
${function(){
if (media.videosrc) {
let src = '';
if (media.videosrc) {
src = media.videosrc + '.' + media.ext;
}
return `
`
} else if(media.mp4 || media.hls) {
return `
`
} else {
return `
`
}
}()}
No reviews available. The product reviews component has been hidden
Product Detail Reviews
