(() => { const { EventManager, pageHelper } = ShopbySkin; const myProductReviewListHelper = pageHelper.myProductReviewListHelper(); myProductReviewListHelper.initialize(); let shopbyCommonData = {}; EventManager.on('PAGE_LOAD_COMPLETED', (commonData) => { shopbyCommonData = commonData; }); const moduleActionHandler = { REGISTER: (_, { productNo, reviewNo, usesAttachment }) => { EventManager.fire('OPEN_LAYER_MODAL', { name: 'product-review-form', title: '상품 후기', modalAddClass: 'product-review-form-modal', isFull: false, data: { productNo, reviewNo, usesAttachment, isSelectProduct: true, }, onClose: ({ reason }) => { if (reason === 'DID_SUBMIT') { EventManager.fire('MODAL_ALERT_OPEN', { noticeType: 'success', message: '상품후기가 등록되었습니다.', onClose: () => { location.reload(); }, }); } }, }); }, GRADE_BENEFIT: () => { EventManager.fire('OPEN_LAYER_MODAL', { name: 'grade-benefit-guide', title: '등급혜택 안내', isFull: false, data: { commonData: shopbyCommonData, }, }); }, }; document .querySelector('product-review-total-count') ?.addEventListener('click', ({ target }) => { const action = target.getAttribute('shopby-action'); const productNo = target .closest('[shopby-product-no]') ?.getAttribute('shopby-product-no'); const reviewNo = target .closest('[shopby-review-no]') ?.getAttribute('shopby-review-no'); const usesAttachment = target .closest('[shopby-uses-attachment]') ?.getAttribute('shopby-uses-attachment'); moduleActionHandler[action]?.(myProductReviewListHelper, { productNo, reviewNo, usesAttachment, }); }); document .querySelector('profile-summary') ?.addEventListener('click', ({ target }) => { const actionTarget = target.getAttribute('shopby-action'); if (!actionTarget) { return; } moduleActionHandler[actionTarget]({ target }); }); })();