1class ScriptDetailButtonComment extends Script { 2 constructor(params) { 3 super(params) 4 this.$btn_box = document.querySelector(`#${this.attrId} .unit-detail-button-comment`) 5 this.$btn = document.querySelector(`#${this.attrId} .unit-detail-button-comment .btn`) 6 this.commentConfig = {} 7 } 8 async init() { 9 this.initComment() 10 } 11 /** äºä»¶ç»å® */ 12 initComment() { 13 // è¯è®ºæé® 14 this.$btn.addEventListener('click', () => { 15 this.postComment() 16 document.querySelectorAll('[package-group]').forEach(el => el.style.position = 'static') 17 }) 18 } 19 /** å表è¯è®º */ 20 async postComment() { 21 const info = window.app.info 22 if (info.productDetail.detail_comment_login_show && !info.user.is_login) 23 return window.location.href = globalThis.Server.getRinseHref('/login.html', info.site) 24 await new Load('/assets/plugins/comment-form.js') 25 const commentPrams = { 26 thumb: info.page.detail_thumb, 27 title: info.page.detail_title, 28 href: globalThis.Server.getRinseHref(info.page.href, info.site), 29 product_id: info.page.content_id, 30 price_selling_min: info.productDetail.min_price, 31 price_selling_max: info.productDetail.max_price, 32 price_cost_min: info.productDetail.min_cost_price, 33 price_cost_max: info.productDetail.max_cost_price, 34 is_pattern: info.productDetail.is_pattern, // æ¯å¦å¹é å½åæ¬¾å¼ 35 is_discount: info.productDetail.is_discount, // æ¯å¦å¼å¯äºææ£ 36 discount_price: info.productDetail.discount_price, // å½åæ¬¾å¼ææ£åä»·æ ¼ 37 discount_original_price: info.productDetail.discount_original_price // å½åæ¬¾å¼ææ£åä»·æ ¼ 38 39 } 40 // console.log('è¿éç详æ å¢',info.productDetail) 41 new PluginCommentForm(commentPrams).modal() 42 } 43 render() { 44 if (window.app.info.productDetail.detail_comment_btn_show) this.$btn_box.classList.add('show') 45 } 46} 47
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.