PageSourceSearch

https://www.goodwaytechs.com/assets/js/unit/detail-button-comment.js

js goodwaytechs.com collected 2026-10-04 04:04:26 UTC 1,910 bytes, 47 lines download raw bytes

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.