테마
REVIEW
- 리뷰를 선택하고 리뷰 정보를 가져올 수 있어요.
- 평점, 내용, 작성자, 이미지 등 다양한 리뷰 정보를 제공해요.
- 고객 리뷰 목록, 베스트 리뷰, 상품 상세 리뷰처럼 리뷰를 표시하는 블록에 적합해요.
html
<template>
{{#each property.reviews.data}}
<div>
{{authorName}} - {{rating}}점
<p>{{content}}</p>
</div>
{{/each}}
<button>다음 페이지</button>
</template>
<script>
bm.container.addEventListener('click', (event) => {
event.preventDefault();
if (event.target.matches('button')) {
const currentPage = bm.config('property:reviews.page');
bm.config('property:reviews.page', currentPage + 1);
bm.apply();
}
});
</script>jsx
"reviews": {
"data": [ // 리뷰 목록
{
"id": 1, // 리뷰 ID
"channel": "WEBSITE", // 리뷰 채널 (예: "WEBSITE", "NAVERPAY")
"authorName": "김**", // 작성자 이름
"authorEmail": "kim***", // 작성자 이메일
"isBestReview": false, // 베스트 리뷰 여부
"productId": "RJXRGSXKEAZK", // 상품 ID
"productName": "멋진 티셔츠", // 상품 이름
"productImage": "https://example.org/product.png", // 상품 이미지 URL
"optionTypes": [ // 작성 대상 상품 옵션
{
"option": {
"id": "8MGJMD9NYRWM", // 옵션 ID
"name": "사이즈" // 옵션 이름
},
"variation": {
"id": "YVSQ62UE6TQM", // 옵션 선택지 ID
"value": "M" // 옵션 선택지 값
}
}
],
"rating": 5, // 리뷰 평점
"content": "아주 멋진 티셔츠었어요!", // 리뷰 내용
"images": [ // 리뷰 이미지/영상 목록
{
"url": "https://example.org/review.png", // 미디어 URL
"type": "IMAGE" // 미디어 타입 (예: "IMAGE", "VIDEO", "IFRAME"). IFRAME은 NAVERPAY 채널에서만 사용
}
],
"commentsCount": 3, // 댓글 개수
"displayDate": "2025-01-30T10:34:01.351826" // 표시 일시
}
],
"count": 1 // 총 리뷰 개수
}bm.config()
bm.config()를 통해 데이터를 가져오는 방식을 설정할 수 있어요.
js
bm.config('property:reviews.page', page); // 페이지 번호 설정
bm.config('property:reviews.limit', limit); // 가져올 리뷰 개수 설정
bm.config('property:reviews.sort', sort); // 정렬 설정 (예: 'rating,desc', 'rating,asc', 'isBestReview,desc', 'displayDate,desc', 'displayDate,asc')
bm.config('property:reviews.search', search); // 본문 키워드 검색 필터
bm.config('property:reviews.rating', rating); // 별점 필터 (1-5)
bm.config('property:reviews.type', type); // 리뷰 타입 필터 (예: 'TEXT', 'MEDIA')
bm.config('property:reviews.isBestReview', isBestReview); // 베스트 리뷰 필터 (true, false)
bm.config('property:reviews.productId', productId); // 상품 ID 필터